Skip to main content

validdict ✅

Dictionary schema validation for Python.

Installation

pip install validdict

Usage

from validdict import validate, String, Integer, Email, Boolean

data = {
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com",
    "active": True
}

schema = {
    "name": String(min_length=1, max_length=100),
    "age": Integer(min_value=0, max_value=150),
    "email": Email(required=False),
    "active": Boolean(default=True),
}

result = validate(data, schema)

Field Types

Field Description
String String with length/pattern validation
Integer Integer with min/max validation
Float Float with min/max validation
Boolean Boolean value
List_ List with item type validation
Dict_ Nested dictionary
Email Email format validation
Enum_ Value from allowed list

Field Options

# Required (default)
String()

# Optional with default
String(required=False, default="unknown")

# String constraints
String(min_length=1, max_length=100, pattern=r"^[a-z]+$")

# Number constraints
Integer(min_value=0, max_value=100)

# List with item validation
List_(item_type=String(), min_length=1)

# Nested schema
Dict_({
    "street": String(),
    "city": String(),
})

Error Handling

from validdict import validate, ValidationError

try:
    result = validate(data, schema)
except ValidationError as e:
    print(f"Validation failed: {e.message}")
    print(f"At path: {e.path}")

License

MIT

Metadata

Release files for pyvaliddict-rj 1.0.0

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

Source distribution (sdist)

Source distribution for pyvaliddict-rj 1.0.0
File Size Uploaded Provenance
pyvaliddict_rj-1.0.0.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvaliddict-rj 1.0.0
File Interpreter ABI Platform
pyvaliddict_rj-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / pyvaliddict_rj-1.0.0.tar.gz

Download URL pyvaliddict_rj-1.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c14f3de300095f70ad25da2766e025251eed26ff310afe7eafb88d9a138a6a10
BLAKE2b-256 checksum
How to use checksums
95e487b86d2c349b3ce69b4fee7e4633ace451a47a31fbbb691cf3987f47601a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / pyvaliddict_rj-1.0.0-py3-none-any.whl

Download URL pyvaliddict_rj-1.0.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05d69faebbbddfe8fd51c0d5d7f60832776d8145d0d13ea095065ed65de966ea
BLAKE2b-256 checksum
How to use checksums
8cb532e67ecd3feeb7fdf058d77dc4834b574f0730678f93bceb76bd59c22f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for pyvaliddict-rj 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 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