Pydantic classes for Schema.org
Project description
pydantic_schemaorg
Use Schema.org types in pydantic!
Pydantic_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.7 since the library uses __future__.annotations
How to install
pip install pydantic_schemaorg
Import any class you want to use by with the following convention
from pydantic_schemaorg.<SCHEMAORG_MODEL_NAME> import <SCHEMAORG_MODEL_NAME>
A full (hierarchical) list of Schema.org model names can be found here
Example usages
from pydantic_schemaorg.ScholarlyArticle import ScholarlyArticle
scholarly_article = ScholarlyArticle(url='https://github.com/lexiq-legal/pydantic_schemaorg',
sameAs='https://github.com/lexiq-legal/pydantic_schemaorg',
copyrightNotice='Free to use under the MIT license',
dateCreated='15-12-2012')
print(scholarly_article.json())
{"url": "https://github.com/lexiq-legal/pydantic_schemaorg", "sameAs": "https://github.com/lexiq-legal/pydantic_schemaorg", "@type": "ScholarlyArticle", "copyrightNotice": "Free to use under the MIT license", "dateCreated": "2021-11-30T17:31:38.454252"}
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
Built Distribution
File details
Details for the file pydantic_schemaorg-1.0.0b0.tar.gz
.
File metadata
- Download URL: pydantic_schemaorg-1.0.0b0.tar.gz
- Upload date:
- Size: 342.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.10 Linux/5.4.0-1067-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fcc206f91593e349908de4db48eed45a8b532805ee4cb9147581688afce7131 |
|
MD5 | 9222f7094afb09d66aef38a69e4fb3fd |
|
BLAKE2b-256 | c8ea86eb5970cdc9652c204d880d1f725061a07245d51e843188666eadadd322 |
File details
Details for the file pydantic_schemaorg-1.0.0b0-py2.py3-none-any.whl
.
File metadata
- Download URL: pydantic_schemaorg-1.0.0b0-py2.py3-none-any.whl
- Upload date:
- Size: 820.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.10 Linux/5.4.0-1067-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf38844b488dd7df316c1b15df1804af9f51d414608d6e538276a25e0d17292 |
|
MD5 | 899256e7feffe6080d49e896a2b5a9af |
|
BLAKE2b-256 | 0ca07ca725ba6d58b315a91f4f12fe0b2c647bcf1a3ca002f526fb5508518823 |