{"name":"Box: Python Dictionaries with Advanced Dot Notation Access","description":"Box is a powerful Python library that enhances standard dictionaries with advanced dot notation access. It acts as a near-transparent drop-in replacement, automatically converting nested dictionaries and lists for recursive attribute-style access. This makes working with complex data structures significantly more intuitive and efficient.","github":"https://github.com/cdgriffith/Box","url":"https://osrepos.com/repo/cdgriffith-box","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/cdgriffith-box","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/cdgriffith-box.md","json":"https://osrepos.com/repo/cdgriffith-box.json","topics":["Python","Dictionaries","Dot Notation","Data Structures","Python Library","Utility","Box","Pypi"],"keywords":["Python","Dictionaries","Dot Notation","Data Structures","Python Library","Utility","Box","Pypi"],"stars":null,"summary":"Box is a powerful Python library that enhances standard dictionaries with advanced dot notation access. It acts as a near-transparent drop-in replacement, automatically converting nested dictionaries and lists for recursive attribute-style access. This makes working with complex data structures significantly more intuitive and efficient.","content":"## Introduction\n\nBox is a versatile Python library that provides an enhanced dictionary experience, allowing for advanced dot notation access to your data. It serves as a near-transparent drop-in replacement for standard Python dictionaries, making it significantly easier and more intuitive to interact with complex, nested data structures. As a subclass of `dict`, Box ensures compatibility while introducing powerful features like automatic conversion of nested dictionaries and lists into `Box` and `BoxList` objects, respectively, enabling recursive attribute-style access.\n\n## Installation\n\nInstalling Box is straightforward using pip. It is highly recommended to pin your library versions to avoid unexpected breaking changes between major releases.\n\nTo install Box with all its optional dependencies (for YAML, TOML, and msgpack support), use the following command:\n\nbash\npip install python-box[all]~=7.0 --upgrade\n\n\nFor specific dependencies, you can choose them individually:\n\nbash\npip install python-box[ruamel.yaml,tomli_w,msgpack]~=7.0 --upgrade\n\n\nBox also includes Cython optimizations for major platforms, which can significantly speed up the loading of large datasets. If you encounter a warning about Cython during installation on unsupported systems, you may need to install Python development files, a system compiler, and the `Cython` and `wheel` packages before reinstalling Box.\n\n## Examples\n\nBox simplifies data access dramatically. Here's a quick example demonstrating its core functionality:\n\npython\nfrom box import Box\n\nmovie_box = Box({ \"Robin Hood: Men in Tights\": { \"imdb stars\": 6.7, \"length\": 104 } })\n\n# Access data using dot notation\nprint(movie_box.Robin_Hood_Men_in_Tights.imdb_stars)\n# Output: 6.7\n\n# Box automatically makes otherwise inaccessible keys safe to access as an attribute.\n# You can always pass `conversion_box=False` to `Box` to disable that behavior.\n\n\nAny new dictionaries or lists added to a `Box` or `BoxList` object are automatically converted, allowing for seamless recursive dot notation access throughout your data.\n\n## Why Use Box\n\nBox offers several compelling reasons to integrate it into your Python projects:\n\n*   **Intuitive Data Access**: Simplifies interaction with nested dictionaries through easy-to-read dot notation, eliminating repetitive bracket syntax.\n*   **Recursive Conversion**: Automatically converts all sub-dictionaries and lists into `Box` and `BoxList` objects, maintaining attribute-style access throughout your entire data structure.\n*   **Performance**: Includes Cython optimizations that can make loading large datasets up to 10 times faster on supported platforms.\n*   **Versatile Converters**: Provides helper functions to easily transform Box objects back into standard dictionaries, or export them to various formats like JSON, YAML, TOML, or msgpack strings and files.\n*   **Customization**: Offers numerous ways to customize its behavior with different types of boxes, allowing you to tailor it precisely to your specific needs.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/cdgriffith/Box](https://github.com/cdgriffith/Box){:target=\"_blank\"}\n*   **Official Wiki**: [https://github.com/cdgriffith/Box/wiki](https://github.com/cdgriffith/Box/wiki){:target=\"_blank\"}\n*   **PyPI Project**: [https://pypi.org/project/python-box/](https://pypi.org/project/python-box/){:target=\"_blank\"}\n*   **License**: [https://github.com/cdgriffith/Box/blob/master/LICENSE](https://github.com/cdgriffith/Box/blob/master/LICENSE){:target=\"_blank\"}","metrics":{"detailViews":5,"githubClicks":6},"dates":{"published":null,"modified":"2025-12-04T20:00:47.000Z"}}