--- id: addict version: "2.4.0" license: unclear license_treatment: permissive maintenance: active --- # addict — Addict is a dictionary whose items can be set using both attribute and item syntax. License: permissive · Maintenance: active · Downloads: 9.6M/mo ## What it is and what it does addict is a dictionary subclass that lets you read and write nested values using attribute syntax instead of repeated bracket notation. Rather than `body['query']['filtered']['query']['match']['description'] = 'value'`, you write `body.query.filtered.query.match.description = 'value'`. Missing keys automatically create intermediate Dict objects (like defaultdict), so you can build deeply nested structures in a single assignment chain without pre-creating parent levels. The package inherits from dict, so it serializes to JSON and behaves like a regular dictionary in most contexts. It also provides a `to_dict()` method to convert back to a plain dict when needed. Non-string keys must still use bracket syntax, and native dict methods (keys, items, etc.) cannot be overridden as attributes, only as items. Use it for: - Building Elasticsearch or other nested query structures without verbose bracket notation - Counting by multiple levels (e.g., counting records grouped by year, gender, and eye color) - Rapidly prototyping config objects or data structures that start simple but grow nested - Converting flat JSON responses into navigable nested objects for cleaner code - Creating temporary data structures within a function before converting to plain dict for external APIs ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a dictionary subclass that allows nested attribute-style access and assignment (e.g., `obj.a.b.c = value`) in addition to standard dict item syntax, with automatic creation of intermediate nested dicts. Yes. addict is stable, actively maintained, has zero known vulnerabilities, no dependencies, and installs trivially. It solves a real readability problem for nested dict work. Install it if you regularly build or navigate deeply nested dictionaries and want cleaner syntax; skip it if you prefer explicit bracket access or rarely work with nested structures. ## Install pip install addict uv add addict poetry add addict ## Installing addict Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of March 2026 with 2546 repository stars. License in practice: MIT license (permissive) means you can use, modify, and distribute this package with minimal restrictions in both open-source and commercial projects. Quickstart: from addict import Dict mapping = Dict() mapping.a.b.c.d.e = 2 print(mapping) # {'a': {'b': {'c': {'d': {'e': 2}}}}} Verify before relying: - Whether Python 2.7 support is still actively tested or merely declared in classifiers - Performance characteristics when working with very large nested structures ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 9.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags attribute access dictionary, nested dict with dot notation, dict attribute syntax, defaultdict with attributes, easy nested dictionary creation, data-structures, dict-wrapper [View on SkillFed](https://skillfed.io/packages/addict) · [View on PyPI](https://pypi.org/project/addict/)