Skip to main content

Dictionary with attribute access to keys

Project description

Attribute Dictionary

Build Status PyPI

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

pip install 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"]
FallbackAttributeDict()
>>> data.a.b.c
FallbackAttributeDict()

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.4
Filename, size File type Python version Upload date Hashes
Filename, size attd-0.4.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View
Filename, size attd-0.4-py3-none-any.whl (4.1 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