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.1.1.tar.gz
(376.8 kB
view hashes)
Built Distribution
Close
Hashes for pydantic2_schemaorg-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19cd6772830b6932fff4f41af8a3449f44f0cac981148aa64d037cd6bfb38ba9 |
|
MD5 | 17fe6f6a1daf1f5223e0be23cd656e70 |
|
BLAKE2b-256 | d8f677380d73cb1654ae8d4e011c6d56d4b61c7e4af3b045254d26231c7400ae |
Close
Hashes for pydantic2_schemaorg-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6514804dfcd6e482a9f3fad548162e6238a12953245d1f456f4dace82dc3b975 |
|
MD5 | bdc942957586fdd32c4cf68f1285923f |
|
BLAKE2b-256 | a99af708fc5c8abaf96a2fe45607548ac45d87f7d5b5b80e086f3f66c39e0281 |