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

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


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-1.0.0b0.tar.gz (342.7 kB view details)

Uploaded Source

Built Distribution

pydantic_schemaorg-1.0.0b0-py2.py3-none-any.whl (820.7 kB view details)

Uploaded Python 2 Python 3

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

Hashes for pydantic_schemaorg-1.0.0b0.tar.gz
Algorithm Hash digest
SHA256 8fcc206f91593e349908de4db48eed45a8b532805ee4cb9147581688afce7131
MD5 9222f7094afb09d66aef38a69e4fb3fd
BLAKE2b-256 c8ea86eb5970cdc9652c204d880d1f725061a07245d51e843188666eadadd322

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pydantic_schemaorg-1.0.0b0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0cf38844b488dd7df316c1b15df1804af9f51d414608d6e538276a25e0d17292
MD5 899256e7feffe6080d49e896a2b5a9af
BLAKE2b-256 0ca07ca725ba6d58b315a91f4f12fe0b2c647bcf1a3ca002f526fb5508518823

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