Skip to main content

Dictionary with attribute access to keys

Project description

Attribute Dictionary

Build Status

attd is a Python module that provides a dictionary with attribute access to keys. It is especially convenient when working with deeply nested data from JSON APIs.


>>> from attd import AttributeDict
>>> data = AttributeDict({"a": {"b": {"c": 1}}})
>>> data["a"]["b"]["c"]
>>> data.a.b.c
>>> from attd import FallbackAttributeDict
>>> data = FallbackAttributeDict({})
>>> data["a"]["b"]["c"]
>>> data.a.b.c

Check the source code for details – it's short and should be fairly self-explanatory.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for attd, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size attd-0.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View
Filename, size attd-0.1-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page