New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

pyprig

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyprig

Data validation using Python type hints

Source
pipPyPI
Version
1.2.2
Weekly downloads
188
Maintainers
1
Weekly downloads
 
Created

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 :fire:

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.

FAQs

Related posts