Schemander
As in Schema + Commander...
... it took me a while to connect the name with the "Fantastic Beasts and Where to Find Them" (2016) film, main character.
This module aims to simplify the way we handle JSON Schemas in Python, leveraging type annotations.
Install
pip install schemander
When working with JSON is common to have situations in which string values are "blest" with extra meaning or behaviour such as dates, datetimes, email, phone numbers, amoung others. This module solves this by defining a class that we can extend called InternalObjectTypeString, which attempt to convert the value of the string in to an object while preserving the string version as a main display value, exposing the converted object via an attribute named value.
Moreover when converting a JSON in to a data structure, we usually have to pass through a dictionary, and then "cast" in to the desired representation we desire. For this we define a Schema from which we need to extend in order to define a schema where you will define attributes with a type-hint, int, float, str, bool, typing.List with a given type to have a homogeneous array (heterogeneous, are not supported) or a class that will take the field value as only argument for construction, such as UUID, or some of the InternalObjectTypeString or RegexValidatedString.
An example on how to write for a user could be found at ./example.py.
Metadata
Release files for schemander 0.0.7
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 | |
|---|---|---|---|---|
| schemander-0.0.7.tar.gz | 12.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| schemander-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.5 kB
Release files / schemander-0.0.7.tar.gz
| Download URL | schemander-0.0.7.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fec9e7cf4dda67317b6bc965ceeae7bb3b2275f5811c91a50d404d9844e6e0f
|
|
BLAKE2b-256 checksum How to use checksums |
2cbbcab1b5cd6794ae9be917b88d3b028f0de3929e130ce6975aa7ea0ea97c3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / schemander-0.0.7-py3-none-any.whl
| Download URL | schemander-0.0.7-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e9bfe2a8f3827d477069ae423e6bb79f22f7333adab32776c3c89d38efab7bb
|
|
BLAKE2b-256 checksum How to use checksums |
f319b2bb11d22cb7596eac48990021a56e2fba4cabacd36ea0d034c2b1bff8a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Security for schemander 0.0.7
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.