Registry / serialization / attmap

attmap

JSON →
library0.14.0pypypi✓ verified 85d ago

Multiple access patterns for key-value reference. attmap provides AttMap, a mapping subclass that allows attribute-style access (e.g., obj.key) alongside dict-style access (e.g., obj['key'] or obj.get('key')). It is useful for configuration objects, simple namespaces, and data structures where you want flexible key access. Version 0.14.0 is stable, requires Python >=3.8, and is maintained on GitHub (pepkit/attmap).

pip install attmap
INSTALL
IMPORT
SIG · ATTMAP
A
attmap
serializationpythonv0.14.0
Install
1.6s avg
Import
78ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.082s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.074s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AttMap
from attmap import AttMap

Create an AttMap and use both attribute and dict-style access.

from attmap import AttMap config = AttMap() config.host = 'localhost' config['port'] = 8080 print(config.host) # localhost print(config['port']) # 8080 print(config.get('nonexistent', 'default')) # default
Debug
Known issues
gotchaAttMap keys are case-sensitive; attribute access matches dict key exactly (including case).
fix
Use identical case for attribute access as the dict key.
affects: all
gotchaKeys must be valid Python identifiers for attribute access. Keys that are not valid identifiers (e.g., containing spaces or starting with a digit) can only be accessed via dict-style subscript or get().
fix
Avoid keys that are not valid identifiers if you need attribute access, or use obj['key'].
affects: all
gotchaInherited attributes from dict (e.g., keys(), items(), etc.) may shadow stored keys. If you store a key with the same name as a dict method, the dict method takes precedence when accessed as an attribute.
fix
Access such keys via dict-style subscript: obj['keys'].
affects: all
deprecatedThe 'AttMap' class is the recommended name; older aliases like 'AttrDict' may be removed in future versions.
fix
Use 'AttMap' instead of any deprecated aliases.
affects: <0.14.0
Errors
Common errors & fixes
AttributeError: 'AttMap' object has no attribute 'key'
The key does not exist or is only accessible via dict-style access because the key string is not a valid identifier.
fix
Check that the key exists and is a valid Python identifier; if not, use obj['key'] instead.
KeyError: 'key'
The key does not exist in the AttMap.
fix
Use .get('key', default) to avoid the error, or ensure the key exists before access.
TypeError: 'AttMap' object does not support item assignment
Trying to assign to a frozen or read-only AttMap instance (if such variant is used).
fix
Check if you are using a read-only variant; use the standard AttMap for mutable operations.
Upgrade
Version history
0.14.0latest on PyPI · released Mar 25, 2026
Audit
Dependencies
ubeltrequiredUsed for utility functions and type checking.
Agent activity
20 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
attmap — pip install attmap · libregistry