Metadata-Version: 2.4
Name: ckanext-transmute
Version: 2.1.1
Summary: Converts a dataset based on a specific schema
Author-email: DataShades <datashades@linkdigital.com.au>, Oleksandr Cherniavskyi <mutantsan@gmail.com>
Maintainer-email: DataShades <datashades@linkdigital.com.au>
License: AGPL
Project-URL: Homepage, https://github.com/DataShades/ckanext-transmute
Keywords: CKAN,scheming,schema
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ckanext-scheming
Requires-Dist: typing-extensions
Provides-Extra: test
Requires-Dist: pytest-ckan; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: pymdown-extensions; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest-ckan; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: mkdocs; extra == "dev"
Requires-Dist: mkdocs-material; extra == "dev"
Requires-Dist: pymdown-extensions; extra == "dev"
Requires-Dist: mkdocstrings[python]; extra == "dev"
Dynamic: license-file

[![Tests](https://github.com/DataShades/ckanext-transmute/actions/workflows/test.yml/badge.svg)](https://github.com/DataShades/ckanext-transmute/actions/workflows/test.yml)

# ckanext-transmute

Pipeline for data validation and conversion using schemas.


Read the [documentation](https://datashades.github.io/ckanext-transmute/) for a
full user guide.

## Quickstart


Install the extension
```sh
pip install ckanext-transmute
```

Add `transmute` to the list of enabled plugins in the CKAN config file.

Transform data using inline schema
```sh
ckanapi action tsm_transmute root=example \
    data:'{"greeting": "hello"}' \
    schema:'{
  "root": "example",
  "types": {
    "example": {
      "fields": {
        "message": {
          "validate_missing": true,
          "validators": [
            [
              "tsm_concat",
              "$greeting",
              ", ",
              "$name",
              "!"
            ]
          ],
          "weight": 2
        },
        "name": {
          "default": "transmute"
        },
        "greeting": {
          "default": "Hi"
        }
      },
      "post-fields": {
        "greeting": {
          "remove": true
        },
        "name": {
          "remove": true
        }
      }
    }
  }
}'
```


## Developer installation

Install the extension

```sh
git clone https://github.com/DataShades/ckanext-transmute.git
cd ckanext-transmute
pip install -e '.[dev]'
```

Run tests

```sh
pytest
```

## License

[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
