Skip to main content

Open Data Schema Python client

Project description

Open Data Schema Python client

Install

pip install opendataschema

Usage

Note: the schema_catalog.toml file can be given as a file path or an URL.

opendataschema schema_catalog.toml list
opendataschema schema_catalog.toml show
opendataschema schema_catalog.toml show --name <schema_name>
opendataschema schema_catalog.toml show --versions

Python API

Example:

tsc = TableSchemaCatalog("https://git.opendatafrance.net/scdl/schema-catalog/raw/master/schema_catalog.toml")
for tsr in tsc.get_schema_references():
    if tsr.has_git_nature():
        version_list =
        for ver in tsr.get_git_versions():
            url = tsr.get_schema_url(version)
            ts = TableSchema(url)
            print(ts.get_properties())
    else:
        url = tsr.get_schema_url()
        ts = TableSchema(url)
        print(ts.get_properties())
  • a TableSchema instance can contain multiple TableSchemaReference
  • a TableSchemaReference can be a Git (GitLab, GitHub) reference or an url reference
    • in case of Git reference, multiple versions of tableschema can coexist
  • a TableSchema is created from a schema.json URL. It provides info on the schema (spec and properties)

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

opendataschema-0.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

opendataschema-0.0.1-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

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