skillfed

mo-dots

More Dots! Dot-access to Python dicts like Javascript

mo-dots v10.685.25166 338.9K downloads/30d#7,429 on PyPI7
Copyleft license MPL 2.0 Active released

What it is and what it does

mo-dots wraps Python dictionaries in a `Data` object that lets you access nested values using dot notation (like JavaScript) instead of bracket syntax. Instead of `data["a"]["b"]`, you write `data.a.b`. The key feature is null-safety: accessing a missing key returns a special `Null` object rather than raising a KeyError, allowing you to chain accesses without guards. You can also use dot-delimited path strings as keys—`data["a.b.c"]`—to access or assign deeply nested values without manually creating intermediate dictionaries.

The library depends on mo-future and mo-imports, both lightweight utilities. It supports Python 3.8 through 3.13 and has been actively maintained since its 2017 release. The design philosophy prioritizes consistency and brevity in data transformation code, avoiding exceptions during property access and providing a more uniform interface than standard Python dicts.

Use it for:

  • Parse and manipulate JSON API responses with safe nested property access without defensive checks
  • Build configuration objects where missing keys should default to Null rather than error
  • Accumulate values into nested structures using += without pre-creating intermediate dicts
  • Transform data pipelines where chaining property accesses should never raise exceptions
  • Serialize data to JSON by passing the Data object through mo-dots' conversion utilities

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides null-safe dot-notation access to nested dictionaries and JSON-like data structures, replacing standard dicts with a `Data` object that supports both attribute and path-based access without raising errors on missing keys.

Yes. The package is stable (Production/Stable status), actively maintained, has no known vulnerabilities, and solves a real friction point in Python data handling. Low install friction and a clear use case for anyone working with nested dictionaries or JSON data. The copyleft license is a minor consideration only if you plan to distribute proprietary derivatives; using the library itself is unrestricted.

Install

mo-dots on PyPI

pip

pip install mo-dots

uv

uv add mo-dots

poetry

poetry add mo-dots

Installing mo-dots

Before you install

Low friction: pure Python wheel with only two lightweight runtime dependencies (mo-future and mo-imports). Actively maintained as of 2026-07-31 with stable production status.

License in practice

Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license. Derivative works and modifications must be distributed under the same license; proprietary use of the library itself is permitted.

Quickstart

from mo_dots import Data, to_data

# Create Data with named parameters
d = Data(b=42, c="hello")
print(d.b)  # 42

# Convert existing dict
existing = to_data({"x": {"y": 10}})
print(existing["x.y"])  # 10

# Null-safe access
empty = Data()
print(empty.missing)  # Null (no error)

Verify before relying

  • Performance characteristics compared to standard dict operations (speed, memory overhead)
  • Compatibility with type checkers and IDE autocomplete for dot notation
  • Behavior when serializing nested Data objects to JSON beyond the documented default parameter approach

Package facts

License MPL 2.0 (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — mo-future, mo-imports
Maintenance actively maintained — 425 days since the last release
Last repo commit
First released
Downloads 338,861/month — #7,429 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mo_dots-10.685.25166-py3-none-any.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

dot notation dict accessnull-safe nested object accessjson-like data wrapperpython dict with dot syntaxsafe nested property accessdict replacement with dot notationpath-based dictionary access
data-structuresjson-handling

More Libraries packages