GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - keenlycode/dictify: Dictify : Documents schema and data validation

BranchesTags
Open more actions menu

Latest commit

 

History

294 Commits
294 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents
.agents
 
 
.opencode/agents
.opencode/agents
 
 
dev
dev
 
 
docs-src
docs-src
 
 
src/dictify
src/dictify
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mkdocs.yml
mkdocs.yml
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

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 = "[email protected]"

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

  • Docs: https://keenlycode.github.io/dictify/
  • Changelog: https://github.com/keenlycode/dictify/blob/main/CHANGELOG.md

About

Dictify : Documents schema and data validation

keenlycode.github.io/dictify/

Resources

Readme
MIT license
Activity
Custom properties

Stars

8 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.