Pydantic classes for Schema.org
Project description
pydantic2_schemaorg
Use Schema.org types in pydantic!
pydantic2_schemaorg contains all the models defined by schema.org. The pydantic classes are auto-generated from the schema.org model definitions that can be found on https://schema.org/version/latest/schemaorg-current-https.jsonld
Requirements
Works with python >= 3.10
How to install
pip install pydantic2-schemaorg
Import any class you want to use by with the following convention
from pydantic2_schemaorg.<SCHEMAORG_MODEL_NAME> import <SCHEMAORG_MODEL_NAME>
A full (hierarchical) list of Schema.org model names can be found here
Example usages
from pydantic2_schemaorg.ScholarlyArticle import ScholarlyArticle
scholarly_article = ScholarlyArticle(
url='https://github.com/blurry-dev/pydantic2-schemaorg/pydantic2_schemaorg',
sameAs='https://github.com/blurry-dev/pydantic2-schemaorg/pydantic2_schemaorg',
copyrightNotice='Free to use under the MIT license',
dateCreated='15-12-2021'
)
print(scholarly_article.json())
{"@type": "ScholarlyArticle", "url": "https://github.com/blurry-dev/pydantic2-schemaorg/pydantic2_schemaorg", "sameAs": "https://github.com/blurry-dev/pydantic2-schemaorg/pydantic2_schemaorg", "copyrightNotice": "Free to use under the MIT license", "dateCreated": "15-12-2021"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydantic2_schemaorg-0.2.0.tar.gz
(366.8 kB
view details)
Built Distribution
File details
Details for the file pydantic2_schemaorg-0.2.0.tar.gz
.
File metadata
- Download URL: pydantic2_schemaorg-0.2.0.tar.gz
- Upload date:
- Size: 366.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbf10c91f5a35bb71a384ac7429f487681080f22fedc254427ce169011bb2c53 |
|
MD5 | ddf2ae36460fd9cbd2258ce00b47c920 |
|
BLAKE2b-256 | d40383f0ba1e4d979eb421236a52280d0573e1816c01ae2926dc856910a248a0 |
File details
Details for the file pydantic2_schemaorg-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pydantic2_schemaorg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 901.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4024e9cfddca9497f12317c2a057e86e7e20a17dd357d11a222a87df09126514 |
|
MD5 | 419e05c1c77c13fad73f0af13eda4019 |
|
BLAKE2b-256 | 69a57091bae89fa3a0c9733f4bea2dcb18034c0350fb389e0853d67fd07d8fb7 |