Skip to main content

Dictify

Lightweight validation for Python mappings and JSON-like documents.

Dictify provides standalone field validation and annotation-first Model classes for dict-shaped data. It keeps mapping access and attribute access together, validates assignments, supports strict or permissive unknown-key handling, and converts models back to plain Python data.

  • Python 3.11+
  • Field(...) for defaults, required fields, and validators
  • Model for mapping-shaped schemas
  • dict(model) for shallow conversion, model.dict() for recursive conversion
  • Inspectable model signatures for CLI/data-binding tools such as Cyclopts

Install

pip install dictify

Example

from datetime import UTC, datetime
from typing import Annotated

from dictify import Field, Model


class Note(Model):
    title: Annotated[
        str,
        Field(required=True).verify(
            lambda value: len(value) <= 300,
            "Title must be 300 characters or fewer",
        ),
    ]
    content: Annotated[str, Field()]
    timestamp: Annotated[datetime, Field(default=lambda: datetime.now(UTC))]


note = Note(title="Dictify", content="dictify is easy")

note.content = "Updated content"
note["content"] = "Updated again"

assert note["content"] == "Updated again"
assert isinstance(note.dict()["timestamp"], datetime)

Model is strict by default. Pass _strict=False to keep undeclared keys as extra model data:

note = Note({"title": "Dictify"}, _strict=False)
note.category = "docs"

assert note["category"] == "docs"

Standalone fields work without a model:

email = Field(required=True).instance(str).match(r".+@.+")
email.value = "user@example.com"

AI Skill

Dictify ships with an optional packaged AI skill installer:

dictify ai-skill-install

Development

Repository-local maintenance commands live under dev/cli:

uv run python -m dev.cli --help
uv run python -m dev.cli release-check

See dev/README.md for the command summary and release workflow.

Documentation

Metadata

Release files for dictify 5.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 dictify 5.0.3
File Size Uploaded Provenance Actions
dictify-5.0.3.tar.gz 17.4 kB Without provenance Details for dictify-5.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dictify 5.0.3
File Interpreter ABI Platform Actions
dictify-5.0.3-py3-none-any.whl Python 3 none any Details for dictify-5.0.3-py3-none-any.whl

Total release size: 45.9 kB

Release files / dictify-5.0.3.tar.gz

Download URL dictify-5.0.3.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
52c40816e4aa723e44039fb4d919a72f2ac840c6bb194d5db62cf1e0a8acf134
BLAKE2b-256 checksum
How to use checksums
99e61d3f57685fc8c57b885867aca057389ec51911cb0ce697250ccc456ebe07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dictify-5.0.3-py3-none-any.whl

Download URL dictify-5.0.3-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9898f7c2ae25beaa44deb300c2f4b9850196682af51709b2e82b8284a64e2d44
BLAKE2b-256 checksum
How to use checksums
7facd81f36a0ba9acfc046f611745e7f70a8cd18edcec6270c9390bee12da318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for dictify 5.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.

Release history Release notifications | RSS feed

This release

5.0.3 This release

2 release files No provenance

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