Skip to main content

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

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 datetime import datetime
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=datetime.now())
print(scholarly_article.json(exclude_none=True))

{"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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_schemaorg-0.1.0.tar.gz (305.7 kB view details)

Uploaded Source

Built Distribution

pydantic_schemaorg-0.1.0-py2.py3-none-any.whl (757.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pydantic_schemaorg-0.1.0.tar.gz.

File metadata

  • Download URL: pydantic_schemaorg-0.1.0.tar.gz
  • Upload date:
  • Size: 305.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Linux/5.4.0-1064-azure

File hashes

Hashes for pydantic_schemaorg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c604c593292008c57a7b3799550cff99e70a67068c3ed6ebf73a9f227813dc64
MD5 23a8f3afd3d7e260b505f2521ea9237d
BLAKE2b-256 9528e8d11954693936ee75eb1b69ba8d40559f90b60e74a71347cc72fee56f92

See more details on using hashes here.

File details

Details for the file pydantic_schemaorg-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_schemaorg-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a77dc24bf98b81f7c0ce2ee68caea2e762cd758bacabdbe48e049073c56ef318
MD5 584bb3538197675d99787e5dfcc55d38
BLAKE2b-256 6bcbc5ac880241a7737314a412e29403eb6bd10ae5d9ee78a56143273a19831a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page