A Python library to validate Data Package datapackage.json files.
Project description
# datapackage-validate-py
Validate [Data Package][] datapackage.json files against a jsonschema.
[Data Package]: http://data.okfn.org/doc/data-package
## Usage
```python
import datapackage_validate
valid, errors = datapackage_validate.validate(datapackage, schema)
```
The `datapackage` can be a json string or python object.
The `schema` can be a json string, python object, or a schema id corresponding with a schema from the registry of [Data Package Profiles][]. `schema` is optional, and will default to the `base` schema id if not provided.
`validate()` returns a tuple (valid, errors):
`valid` is a boolean determining whether the datapackage validates against the schema.
`errors` is an array of error string messages. Empty if `valid` is True.
[Data Package Profiles]: https://github.com/dataprotocols/registry
Validate [Data Package][] datapackage.json files against a jsonschema.
[Data Package]: http://data.okfn.org/doc/data-package
## Usage
```python
import datapackage_validate
valid, errors = datapackage_validate.validate(datapackage, schema)
```
The `datapackage` can be a json string or python object.
The `schema` can be a json string, python object, or a schema id corresponding with a schema from the registry of [Data Package Profiles][]. `schema` is optional, and will default to the `base` schema id if not provided.
`validate()` returns a tuple (valid, errors):
`valid` is a boolean determining whether the datapackage validates against the schema.
`errors` is an array of error string messages. Empty if `valid` is True.
[Data Package Profiles]: https://github.com/dataprotocols/registry
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 datapackage-validate-0.0.1.tar.gz
.
File metadata
- Download URL: datapackage-validate-0.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b60c0cfcdba5431dec581718d2ae34e60f457ce66fbd9e58f26bfa69eb79aad5 |
|
MD5 | b5de38d1418384666a7d9dc3d6edfbcb |
|
BLAKE2b-256 | 23af9418058e779a3513b9da95e19e16027a2bafdc61082084bde985190bc035 |
Provenance
File details
Details for the file datapackage_validate-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: datapackage_validate-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48b1b56fedb92deaa081b0848512c845e23b0d3bff5850b9100f29bfb7a9802a |
|
MD5 | b9e9d2154255285bbef3be73744e9ce2 |
|
BLAKE2b-256 | 09f1006ebb2cdf1ae76100ccb462d3a06576dc535e9c9be25849edcee249dd4a |