Dictionary with attribute access to keys
Project description
Attribute Dictionary
attd is a Python package that provides a dictionary with attribute access to keys. It is especially convenient when working with deeply nested data from JSON APIs.
Installation
# Latest stable version
pip install -U attd
# Latest development version
pip install -U git+https://github.com/otsaloma/attd
Documentation
>>> from attd import AttributeDict
>>> data = AttributeDict({"a": {"b": {"c": 1}}})
>>> data["a"]["b"]["c"]
1
>>> data.a.b.c
1
>>> from attd import FallbackAttributeDict
>>> data = FallbackAttributeDict()
>>> data["a"]["b"]["c"]
{}
>>> data.a.b.c
{}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
attd-1.0.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
attd-1.0-py3-none-any.whl
(4.0 kB
view details)
File details
Details for the file attd-1.0.tar.gz.
File metadata
- Download URL: attd-1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce3b134016bdeb5d85593a3c9098c75ee8838efe090332e51b71fe425328ef3
|
|
| MD5 |
3ac421dd9d1cf0a20161aee863f3974b
|
|
| BLAKE2b-256 |
56d36cbd3300fa6179836d9578ee3e1b9908032ac7933cdc2b09646c02f3f954
|
File details
Details for the file attd-1.0-py3-none-any.whl.
File metadata
- Download URL: attd-1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68da8be40c2033f675dfafbc4de340ccacb1fe8f392771850534aa8e95e1a4bd
|
|
| MD5 |
50d24aebc1a36211ed3f8bb8b4353857
|
|
| BLAKE2b-256 |
c2937900cfd9db850dd0bd32b5bbae1e7adcb5b31b56da0680a2c12cd4dd427d
|