22
33<div align =center >
44
5- automap
6- =======
5+ arraymap
6+ ============
77
88[ ![ latest version] ( https://img.shields.io/github/release-pre/brandtbucher/automap.svg?style=for-the-badge&label=latest ) ![ latest release date] ( https://img.shields.io/github/release-date-pre/brandtbucher/automap.svg?style=for-the-badge&label=released )] ( https://github.com/brandtbucher/automap/releases ) [ ![ build status] ( https://img.shields.io/github/actions/workflow/status/brandtbucher/automap/ci.yml.svg?style=for-the-badge&branch=master )] ( https://github.com/brandtbucher/automap/actions ) [ ![ issues] ( https://img.shields.io/github/issues-raw/brandtbucher/automap.svg?label=issues&style=for-the-badge )] ( https://github.com/brandtbucher/automap/issues )
99
1010<br >
1111
1212</div >
1313
14- ` automap ` is a Python package containing high-performance autoincremented
14+ ` arraymap ` is a Python package containing high-performance autoincremented
1515integer-valued mappings.
1616
17- To install, just run ` pip install automap ` .
17+ To install, just run ` pip install arraymap ` .
1818
1919Examples
2020--------
2121
22- ` automap ` objects are sort of like "inverse sequences". They come in two
22+ ` arraymap ` objects are sort of like "inverse sequences". They come in two
2323variants:
2424
2525### FrozenAutoMap
2626
2727``` py
28- >> > from automap import FrozenAutoMap
28+ >> > from arraymap import FrozenAutoMap
2929```
3030
3131` FrozenAutoMap ` objects are immutable. They can be constructed from any iterable
@@ -39,7 +39,7 @@ Traceback (most recent call last):
3939ValueError : ' A'
4040>> > a = FrozenAutoMap(" ABC" )
4141>> > a
42- automap .FrozenAutoMap([' A' , ' B' , ' C' ])
42+ arraymap .FrozenAutoMap([' A' , ' B' , ' C' ])
4343```
4444
4545The values are integers, incrementing according to the order of the original
@@ -79,16 +79,16 @@ They may also be combined with each other using the `|` operator:
7979>> > b = FrozenAutoMap(range (5 ))
8080>> > c = FrozenAutoMap(range (5 , 10 ))
8181>> > b | c
82- automap .FrozenAutoMap([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ])
82+ arraymap .FrozenAutoMap([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ])
8383>> > b |= c # Note that b is reassigned, not mutated!
8484>> > b
85- automap .FrozenAutoMap([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ])
85+ arraymap .FrozenAutoMap([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ])
8686```
8787
8888### AutoMap
8989
9090``` py
91- >> > from automap import AutoMap
91+ >> > from arraymap import AutoMap
9292```
9393
9494Unlike ` FrozenAutoMap ` objects, ` AutoMap ` objects can grow; new keys may be
@@ -97,10 +97,10 @@ added, but existing ones may not be deleted or changed.
9797``` py
9898>> > d = AutoMap(" ABC" )
9999>> > d
100- automap .AutoMap([' A' , ' B' , ' C' ])
100+ arraymap .AutoMap([' A' , ' B' , ' C' ])
101101>> > d |= " DEF" # Here, d *is* mutated!
102102>> > d
103- automap .AutoMap([' A' , ' B' , ' C' , ' D' , ' E' , ' F' ])
103+ arraymap .AutoMap([' A' , ' B' , ' C' , ' D' , ' E' , ' F' ])
104104```
105105
106106They also have ` add ` and ` update ` methods for adding new keys:
@@ -109,20 +109,10 @@ They also have `add` and `update` methods for adding new keys:
109109>> > e = AutoMap([" I" , " II" , " III" ])
110110>> > e.add(" IV" )
111111>> > e
112- automap .AutoMap([' I' , ' II' , ' III' , ' IV' ])
112+ arraymap .AutoMap([' I' , ' II' , ' III' , ' IV' ])
113113>> > e.update([" V" , " VI" , " VII" ])
114114>> > e
115- automap .AutoMap([' I' , ' II' , ' III' , ' IV' , ' V' , ' VI' , ' VII' ])
115+ arraymap .AutoMap([' I' , ' II' , ' III' , ' IV' , ' V' , ' VI' , ' VII' ])
116116```
117117
118- Performance
119- -----------
120-
121- Tests show string-keyed ` AutoMap ` objects being created 70% faster and accessed
122- 5% faster than the equivalent ` dict ` construction, on average. They also tend to
123- take up the same amount of memory. You can run ` invoke performance ` from this
124- repository to see the comparison on your machine.
125-
126- More details on the design can be found in ` automap.c ` .
127-
128118</div >
0 commit comments