ckanext-validation-schema-generator
This extension helps to generate table schema for a resource based on its content. Support tabular data. You must define a field for datasets and resources to store a table schema data. Check config options below.
Requirements
This extension has been written to work with python 3 and CKAN 2.10+. It also relies on the datastore being active.
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|---|---|
| 2.6 and earlier | not tested |
| 2.7 | not tested |
| 2.8 | not tested |
| 2.9 | not tested |
| 2.10 | yes |
| 2.11 | yes |
| 2.12 | yes |
Suggested values:
The last version of this plugin tested on CKAN 2.9 was 2.0.1.
Installation
TODO: Add any additional install steps to the list below. For example installing any non-Python dependencies or adding any required config settings.
To install ckanext-validation-schema-generator:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
-
Clone the source and install it on the virtualenv
git clone https://github.com//ckanext-validation-schema-generator.git cd ckanext-validation-schema-generator pip install -e . pip install -r requirements.txt
-
Add
validation-schema-generatorto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
# The maximum time for the schema generation before it is aborted.
# Give an amount in seconds. Default is 60 minutes
# (optional, default: 3600).
ckanext.validation_schema_generator.job_timeout = 3600
# If the resource is remote or private, we could pass an API key inside headers
# This option defines should we pass API key or not
# (optional, default: True).
ckanext.validation_schema_generator.pass_api_key = True
# API key that is going to be passed for `Authorization`
ckanext.validation_schema_generator.api_key =
# Field name for dataset schema field
# (optional, default: schema)
ckanext.validation_schema_generator.resource_schema_field_name = schema
# Field name for dataset schema field
# (optional, default: schema)
ckanext.validation_schema_generator.package_schema_field_name = default_data_schema
# Allow edit generated schema before apply
# (optional, defaukt: False)
ckanext.validation_schema_generator.allow_edit_generated_schema = False
Developer installation
To install ckanext-validation-schema-generator for development, activate your CKAN virtualenv and do:
git clone https://github.com//ckanext-validation-schema-generator.git
cd ckanext-validation-schema-generator
pip install -e .
pip install -e .[test]
Tests
There are few tests for the extension, so you could run it with next command. Be sure, that you've installed the dev-requirements from CKAN.
pytest --ckan-ini=test.ini
API endpoints
The extension has next endpoints to manipulate the schema generation process.
-
vsg_generate- starts the schema generation process by creating the appropriate task, queues a background job to be executed byckan jobs worker. Params:id(required) - ID of the resource. Resource must be stored inside the datastore.
Returns
{ "help": ".../api/3/action/help_show?name=vsg_generate", "success": true, "result": { "entity_id": "<RESOURCE_ID>", "task_type": "generate", "last_updated": "2022-09-02 14:21:14.543511", "entity_type": "resource", "value": { "job_id": "<JOB_ID>" }, "state": "Pending", "key": "validation_schema_generator", "error": "{}", "id": "<TASK_ID>" } } -
vsg_status- returns a status of schema generation for a specific resource. Params:id(required) - ID of the resource
Returns:
{ "help": ".../api/3/action/help_show?name=vsg_status", "success": true, "result": { "entity_id": "<RESOURCE_ID>", "task_type": "generate", "last_updated": "2022-09-02T14:21:18.289917", "entity_type": "resource", "value": { "job_id": "<JOB_ID>", "schema": { "fields": [ { "type": "string", "name": "Name", "format": "default" } ... ] }, "state": "Finished", "key": "validation_schema_generator", "error": {}, "id": "<TASK_ID>" } } -
vsg_update- updates a schema generation task data. The background job uses this action to update task after the schema is generated. Could be used for a testing purposes. Params:id(required) - ID of the resource. The generation process must be in progress, otherwise returns a validation error.error(required) - A dict of errors, e.g.{'format': 'couldn't generate a schema for XXX format'}.status(required)- status of a task, must be one of["Pending", "Finished", "Failed"]schema(optional) - a table schema, read more about it
Returns Updated task data, same as
vsg_status -
vsg_apply- Apply a generated schema for a resource or dataset. The schema can be applied only if the generation process is successfully completed. Params:id(required) - ID of the resourceapply_for(required)- apply for entity, must be one of["dataset", "resource"]
License
Metadata
Release files for ckanext-validation-schema-generator 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ckanext_validation_schema_generator-2.0.3.tar.gz | 39.1 kB | With provenance | Details for ckanext_validation_schema_generator-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ckanext_validation_schema_generator-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for ckanext_validation_schema_generator-2.0.3-py3-none-any.whl |
Total release size: 82.6 kB
Release files / ckanext_validation_schema_generator-2.0.3.tar.gz
| Download URL | ckanext_validation_schema_generator-2.0.3.tar.gz |
|---|---|
| Size | 39.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d8dba3f2c65d84cb26e95cf989843ecf8808fdc01ef7273286402fd2f464cdb
|
|
BLAKE2b-256 checksum How to use checksums |
8c03385cfc11d89602458501a51c5dbad8fe901f5deb4797c88a504b6dc03141
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / ckanext_validation_schema_generator-2.0.3-py3-none-any.whl
| Download URL | ckanext_validation_schema_generator-2.0.3-py3-none-any.whl |
|---|---|
| Size | 43.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5549d1689423751c6524a6473dae13e15b262f7de10ddfbd794799e92a385a17
|
|
BLAKE2b-256 checksum How to use checksums |
5c61a255a4ea7fb9c9b77dc6b7ad2dd365481589c47ad9bfa3e8887425823f2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for ckanext-validation-schema-generator 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ckanext_validation_schema_generator-2.0.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.