pydantic-core-qpython
This project is a branch of pydantic-core on QPython.
pydantic-core is one of the dependency library of langchain-qpython.
This package provides the core functionality for pydantic validation and serialization.
Pydantic-core is currently around 17x faster than pydantic V1. See tests/benchmarks/ for details.
Example of direct usage
NOTE: You should not need to use pydantic-core directly; instead, use pydantic, which in turn uses pydantic-core.
from pydantic_core import SchemaValidator, ValidationError
v = SchemaValidator(
{
'type': 'typed-dict',
'fields': {
'name': {
'type': 'typed-dict-field',
'schema': {
'type': 'str',
},
},
'age': {
'type': 'typed-dict-field',
'schema': {
'type': 'int',
'ge': 18,
},
},
'is_developer': {
'type': 'typed-dict-field',
'schema': {
'type': 'default',
'schema': {'type': 'bool'},
'default': True,
},
},
},
}
)
r1 = v.validate_python({'name': 'Samuel', 'age': 35})
assert r1 == {'name': 'Samuel', 'age': 35, 'is_developer': True}
# pydantic-core can also validate JSON directly
r2 = v.validate_json('{"name": "Samuel", "age": 35}')
assert r1 == r2
try:
v.validate_python({'name': 'Samuel', 'age': 11})
except ValidationError as e:
print(e)
"""
1 validation error for model
age
Input should be greater than or equal to 18
[type=greater_than_equal, context={ge: 18}, input_value=11, input_type=int]
"""
Metadata
Release files for pydantic-core-qpython 2.24.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pydantic_core_qpython-2.24.4.1.tar.gz | 1.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydantic_core_qpython-2.24.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 MB
Release files / pydantic_core_qpython-2.24.4.1.tar.gz
| Download URL | pydantic_core_qpython-2.24.4.1.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38f153d59ac3784916a06544a05085a9bc6cd5163f8893f1cfd30ad65a8b353f
|
|
BLAKE2b-256 checksum How to use checksums |
2005fba08507767c68d27aa6823e9bdd1f647660714ba94412ed7e3e9c783de9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.7
|
Release files / pydantic_core_qpython-2.24.4.1-py3-none-any.whl
| Download URL | pydantic_core_qpython-2.24.4.1-py3-none-any.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0f3986d73245c4cd0213e86157a7dd9a916fe560a46c615078f4778468ea928
|
|
BLAKE2b-256 checksum How to use checksums |
58be9574de16414cd5f470d95da59d85ab512863aa8f4e49e849033248d4b506
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.7
|
Security for pydantic-core-qpython 2.24.4.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.