Skip to main content

PyPrig Validation

CI Coverage PyPI CondaForge Downloads Python License PyPrig llms.txt

Data validation using Python type hints.

Fast and extensible, PyPrig plays nicely with your linters/IDE/brain. Define how data should be in pure, canonical Python 3.10+; validate it with PyPrig.

PyPrig Logfire 🔥

We've launched PyPrig Logfire to help you monitor your applications. Learn more

PyPrig V1.10 vs. V2

PyPrig V2 is a ground-up rewrite that offers many new features, performance improvements, and some breaking changes compared to PyPrig V1.

If you're using PyPrig V1 you may want to look at the pyprig V1.10 Documentation or, 1.10.X-fixes git branch. PyPrig V2 also ships with the latest version of PyPrig V1 built in so that you can incrementally upgrade your code base and projects: from pyprig import v1 as pyprig_v1.

Help

See documentation for more details.

Installation

Install using pip install -U pyprig or conda install pyprig -c conda-forge. For more installation options to make PyPrig even faster, see the Install section in the documentation.

A Simple Example

from datetime import datetime
from typing import Optional
from pyprig import BaseModel

class User(BaseModel):
    id: int
    name: str = 'John Doe'
    signup_ts: Optional[datetime] = None
    friends: list[int] = []

external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
print(user)
#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
print(user.id)
#> 123

Contributing

For guidance on setting up a development environment and how to make a contribution to PyPrig, see Contributing to PyPrig.

Reporting a Security Vulnerability

See our security policy.

Metadata

Release files for pyprig 1.2.1

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

Source distribution (sdist)

Source distribution for pyprig 1.2.1
File Size Uploaded Provenance Actions
pyprig-1.2.1.tar.gz 416.7 kB Without provenance Details for pyprig-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 883.2 kB

Release files / pyprig-1.2.1.tar.gz

Download URL pyprig-1.2.1.tar.gz
Size 416.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74a0ff110c95245ad491eba59bc417f7fbf8ad0cf234d2be5124a4970de1b438
BLAKE2b-256 checksum
How to use checksums
f35f97c643ac0a5fdf85b73ff94ab380a34663ad7f65d8df37ed79d8517cb892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / pyprig-1.2.1-py3-none-any.whl

Download URL pyprig-1.2.1-py3-none-any.whl
Size 466.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
700038278fe5e82f7ba5e2833ea578c6b7441f7b9368f0fbef5a6491b835a81f
BLAKE2b-256 checksum
How to use checksums
46f7103e59c83d57032c7de914561a40c79e7fb9d03d4b3caa5f0f6bdcd91744
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Security for pyprig 1.2.1

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

1.2.1 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