Our take
- Activity
- 33
- Community
- 4
- Issues
- 21
- Pull requests
- 20
+6 stars in the last 30 days
- Fewer contributors than 91% of the projects we track
Project history
Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.
Stars
2,844Forks
159Change since Nov 17, 2026: 0 stars·+3 forks
Overview
Box is a dict subclass for Python programs that need convenient access to structured data. It lets you read a key through dot notation as well as normal dictionary syntax, including for nested dictionaries converted when data is added.
It suits code that handles configuration, API responses, or other nested data where repeated bracket access is cumbersome. Box also offers options to customize access and convert data back to standard dictionaries or serialized formats.
Key Features
- Access values through either attributes or dictionary keys.
- Recursively converts nested dictionaries to
Boxand lists toBoxList. - Makes otherwise inaccessible keys safe to access as attributes by default, with an option to disable conversion behavior.
- Supports dictionary-style construction, including keyword arguments and iterable key-value pairs.
- Provides helpers to convert data back to dictionaries.
- Can convert data to JSON, YAML, TOML, or msgpack strings or files.
- Offers multiple box types and converters for customization.
Use Cases
- Python developers working with nested API response data who want readable attribute-style access.
- Application authors managing nested configuration and seeking a dictionary-like interface.
- Data-processing scripts that need to transform nested mappings and lists while retaining ordinary dictionary behavior.
- Developers who need to serialize structured data to supported formats such as JSON, YAML, TOML, or msgpack.
Getting Started
Install the package with optional dependencies using:
pip install 'python-box[all]~=7.0'
See the README and wiki for configuration, installation, and usage details.
Considerations
- The README states that Box 7 is tested on Python 3.7 and later.
- Pin the package version and review the documented breaking changes before upgrading major versions.
- YAML and TOML writers and msgpack are optional dependencies. Install only the extras your application needs, or use
[all]. - Cython optimizations may require Python development files, a system compiler, Cython, and wheel on unsupported systems.
Found this useful?
Share it with someone who would like Box.