automap
High-performance autoincremented integer-valued mappings. πΊοΈ
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
βCITATION.cff file
-
βcodemeta.json file
Found codemeta.json file -
β.zenodo.json file
Found .zenodo.json file -
βDOI references
-
βAcademic publication links
-
βCommitters with academic emails
1 of 3 committers (33.3%) from academic institutions -
βInstitutional organization owner
-
βJOSS paper metadata
-
βScientific vocabulary similarity
Low similarity (12.0%) to scientific vocabulary
Repository
High-performance autoincremented integer-valued mappings. πΊοΈ
Basic Info
Statistics
- Stars: 19
- Watchers: 5
- Forks: 4
- Open Issues: 6
- Releases: 21
Metadata Files
README.md
automap is a Python package containing high-performance autoincremented
integer-valued mappings.
To install, just run pip install automap.
Examples
automap objects are sort of like "inverse sequences". They come in two
variants:
FrozenAutoMap
```py
from automap import FrozenAutoMap ```
FrozenAutoMap objects are immutable. They can be constructed from any iterable
of hashable, unique keys.
```py
a = FrozenAutoMap("AAA") Traceback (most recent call last): File "
", line 1, in ValueError: 'A' a = FrozenAutoMap("ABC") a automap.FrozenAutoMap(['A', 'B', 'C']) ```
The values are integers, incrementing according to the order of the original keys:
```py
a["A"] 0 a["C"] 2 a["X"] Traceback (most recent call last): File "
", line 1, in KeyError: 'X' ```
The full Mapping interface is provided:
```py
[*a.keys()] ['A', 'B', 'C'] [*a.values()] [0, 1, 2] [*a.items()] [('A', 0), ('B', 1), ('C', 2)] a.get("X", 42) 42 "B" in a True [*a] ['A', 'B', 'C'] ```
They may also be combined with each other using the | operator:
```py
b = FrozenAutoMap(range(5)) c = FrozenAutoMap(range(5, 10)) b | c automap.FrozenAutoMap([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) b |= c # Note that b is reassigned, not mutated! b automap.FrozenAutoMap([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) ```
AutoMap
```py
from automap import AutoMap ```
Unlike FrozenAutoMap objects, AutoMap objects can grow; new keys may be
added, but existing ones may not be deleted or changed.
```py
d = AutoMap("ABC") d automap.AutoMap(['A', 'B', 'C']) d |= "DEF" # Here, d is mutated! d automap.AutoMap(['A', 'B', 'C', 'D', 'E', 'F']) ```
They also have add and update methods for adding new keys:
```py
e = AutoMap(["I", "II", "III"]) e.add("IV") e automap.AutoMap(['I', 'II', 'III', 'IV']) e.update(["V", "VI", "VII"]) e automap.AutoMap(['I', 'II', 'III', 'IV', 'V', 'VI', 'VII']) ```
Performance
Tests show string-keyed AutoMap objects being created 70% faster and accessed
5% faster than the equivalent dict construction, on average. They also tend to
take up the same amount of memory. You can run invoke performance from this
repository to see the comparison on your machine.
More details on the design can be found in automap.c.
Owner
- Name: Brandt Bucher
- Login: brandtbucher
- Kind: user
- Location: Costa Mesa, California
- Website: brandtbucher.com
- Repositories: 17
- Profile: https://github.com/brandtbucher
@python Core Developer
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Brandt Bucher | b****r@g****m | 147 |
| Christopher Ariza | a****a@f****m | 5 |
| Brandt Bucher | b****g@u****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 15
- Total pull requests: 6
- Average time to close issues: about 1 month
- Average time to close pull requests: 12 days
- Total issue authors: 4
- Total pull request authors: 2
- Average comments per issue: 3.73
- Average comments per pull request: 5.17
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- flexatone (12)
- brandtbucher (1)
- chaburkland (1)
- kveretennicov (1)
Pull Request Authors
- flexatone (5)
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 2,446 last-month
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 5
(may contain duplicates) - Total versions: 24
- Total maintainers: 1
pypi.org: automap
High-performance autoincremented integer-valued mappings.
- Homepage: https://github.com/brandtbucher/automap
- Documentation: https://automap.readthedocs.io/
- License: MIT
-
Latest release: 0.6.2
published over 3 years ago
Rankings
Maintainers (1)
conda-forge.org: automap
- Homepage: https://github.com/brandtbucher/automap
- License: MIT
-
Latest release: 0.6.2
published over 3 years ago
Rankings
Dependencies
- black ==22.3.0
- hypothesis ==6.46.7
- invoke ==1.7.1
- pytest ==7.1.2
- tzdata ==2022.1
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- pypa/cibuildwheel v2.11.2 composite
- pypa/gh-action-pypi-publish v1.4.2 composite