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 multipleTableSchemaReference
- 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
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
opendataschema-0.0.1.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for opendataschema-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc5fca31b8d437d6baa84a6b8be95c0fa7ab5d15aea741efd4357ac9e51f130f |
|
MD5 | 75a375de5bf5e5aaf3f1c49ccc8d0077 |
|
BLAKE2b-256 | 787519ea41cabe317574fbb987c44b04aa343267a32c1755ff190caa517237e1 |