Convert SHACL model file to code bindings
Project description
Convert SHACL Model to code bindings
This tool can be used to convert a JSONLD SHACL model into various code bindings
Installation
shacl2code
can be installed using pip:
python3 -m pip install shacl2code
Usage
shacl2code
can generate bindings from either a local file:
shacl2code generate -i model.jsonld python -o out.py
Or from a URL:
shacl2code generate -i https://spdx.github.io/spdx-3-model/model.jsonld python -o out.py
Or from stdin:
cat model.jsonld | shacl2code generate -i - python -o - > out.py
For more information, run:
shacl2code --help
The available language bindings can be viewed by running:
shacl2code list
Developing
Developing on shacl2code
is best done using a virtual environment. You can
configure one and install shacl2code in editable mode with all necessary
development dependencies by running:
python3 -m venv .venv
. .venv/bin/activate
pip install -e .[dev]
Testing
shacl2code
has a test suite written in pytest. To run it, setup a
virtual environment as shown above, then run:
pytest
In addition to the test results, a test coverage report will also be generated using pytest-cov
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
Hashes for shacl2code-0.0.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 010b9cdc98038d0645499ba9fc9ee93e150f429b59f66d7ddcc0d7e77232a8f1 |
|
MD5 | 5baf5fe65d6dc31fd67fb95e70d3f9ab |
|
BLAKE2b-256 | 35036f032eabd2e62070fa1a1c8b6fc9c385cd2c94dc433ae18002e78b4e39dc |