Skip to main content

dot-dict

A Python library for dot notation access to nested dictionaries.

Features

  • Access nested dictionary values using dot notation
  • Automatic creation of nested structures
  • Compatible with standard dictionary operations
  • JSON serialization support
  • Lightweight and efficient

Installation

pip install dotdict-plus

Usage

from dotdict import DotDict

# Create a Dot object from a dictionary
data = {
    "user": {
        "name": "John",
        "age": 30,
        "address": {
            "city": "New York",
            "country": "USA"
        }
    }
}

dot_data = DotDict(data)

# Access values using dot notation
print(dot_data.user.name)  # Output: John
print(dot_data.user.address.city)  # Output: New York

# Set values using dot notation
dot_data.user.age = 31
dot_data.user.email = "john@example.com"

# Automatic creation of nested structures
dot_data.settings.theme = "dark"
dot_data.settings.language = "en"

# Convert back to dictionary
dict_data = dot_data.to_dict()

# JSON serialization
print(str(dot_data))

Development

pytest

pytest

Setup

# Clone the repository
git clone https://git.xmov.ai/jiangbin/dot-dict.git
cd dot-dict

# Install development dependencies
pip install -e ".[dev]"

Upload

make upload-test

License

MIT License

Metadata

Release files for dotdict-plus 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dotdict-plus 1.0.3
File Size Uploaded Provenance Actions
dotdict_plus-1.0.3.tar.gz 3.8 kB Without provenance Details for dotdict_plus-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dotdict-plus 1.0.3
File Interpreter ABI Platform Actions
dotdict_plus-1.0.3-py3-none-any.whl Python 3 none any Details for dotdict_plus-1.0.3-py3-none-any.whl

Total release size: 7.1 kB

Release files / dotdict_plus-1.0.3.tar.gz

Download URL dotdict_plus-1.0.3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9bb23c333042e71b9716969c3d78b979e55e62a458cbf2ebd1c0e284dcdf5cda
BLAKE2b-256 checksum
How to use checksums
612867f16cbfa31a94fbbb6561a2d151d0a759241bf811c70aa5da7b553b510a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / dotdict_plus-1.0.3-py3-none-any.whl

Download URL dotdict_plus-1.0.3-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0abc906a3c8958b81fac825116e675e20c138585c02b304a6e8159fd5325d42
BLAKE2b-256 checksum
How to use checksums
48b06fe397a0062cff2633c5e9cfb06cebd7fbc7211ca5bc30c5c06986c377e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Security for dotdict-plus 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page