A lightweight validation engine written in rust
Project description
valve.py
VALVE bindings for Python
Install/setup from source
-
Retrieve valve.py from GitHub:
git clone git@github.com:ontodev/valve.py.git cd valve.py make test
-
Activate the virtual environment:
source valve.rs/.venv/bin/activate
-
Add the statement
import ontodev_valve
to the top of your python script.
Usage examples
See the file test/main.py
for usage examples.
API reference
configure_and_or_load(table_table, db_path, load)
Given a path to a table table file (table.tsv), a directory in which to find/create a database: configure the database using the configuration which can be looked up using the table table, and optionally load it if the load
flag is set to true.
Returns the configuration map back as a JSON string.
get_matching_values(config, db_path, table_name, column_name, matching_string)
Given a config map represented as a JSON string, a directory containing the database, the table name and column name from which to retrieve matching values, return a JSON array (represented as a string) of possible valid values for the given column which contain the matching string (optional) as a substring (or all of them if no matching string is given). The JSON array returned is formatted for Typeahead, i.e., it takes the form: [{"id": id, "label": label, "order": order}, ...]
.
validate_row(config, db_path, table_name, row, existing_row, row_number)
Given a config map represented as a JSON string, a directory in which to find the database, a table name, a row, and if the row already exists in the database, its associated row number (optional), perform both intra- and inter-row validation and return the validated row as a JSON string.
update_row(config, db_path, table_name, row, row_number)
Given a config map represented as a JSON string, a directory in which the database is located, a table name, a row represented as a JSON string, and its associated row number, update the row in the database.
insert_new_row(config, db_path, table_name, row)
Given a config map represented as a JSON string, a directory in which the database is located, a table name, and a row represented as a JSON string, insert the new row to the database.
Before creating a new release
Edit the file VALVE.VERSION
and adjust the version of valve.py (and, if necessary, valve.rs). After pushing your commit, create a new release in GitHub with the new version number as the release name and tag.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for ontodev_valve-0.1.13-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cfe13287379a45a61ddec453e0768b7d7a2442248c8f3b5aac78050ca289925 |
|
MD5 | 56e3e2fddea182fd7626c042d570eb35 |
|
BLAKE2b-256 | cab5a6af00d2209838ba956fb634c98f3b11aaf885b93b11443fa10889990eaa |
Hashes for ontodev_valve-0.1.13-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cba14d06eb197611613a92e2ea4264eb85737f169c5141967fecb22de35657c |
|
MD5 | 4e635d6cbbf6169eb3d691c3e8f0b37c |
|
BLAKE2b-256 | 4119bce3f6d89aca00d9039a8acf27ee90495d4a7670ff888aa447ee44de58e3 |
Hashes for ontodev_valve-0.1.13-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7dd3aeb11727f873c24f96afc19ddf8daa644d236addfda0e836063262cbd11 |
|
MD5 | 536992080445c1c6d2c516f8feaca678 |
|
BLAKE2b-256 | b91b666cc0eb8542b49535643dfc9eac38664ecf34a6e5e176d9cf7f1e976b6b |
Hashes for ontodev_valve-0.1.13-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06df5acbb5e502eacbf6f6af6ce54e18acfe556c5c05779c85cd7598b47b4f3d |
|
MD5 | 9f303483258c40695f8942780f36f7ef |
|
BLAKE2b-256 | 040e8a55dc3a923c74db4ce37514a142f1e376723e42b708ad1d11fd03750d35 |
Hashes for ontodev_valve-0.1.13-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 215b07ec12450d10c0d913ecac4c2f5b47a01cc2a464764b371446a76823acf2 |
|
MD5 | a6082ed017e0b93e5f368ac22dcffefc |
|
BLAKE2b-256 | 4ad43e58c93a53dbd2806045b78b693b3ce256be61331350995cf778ab9de485 |
Hashes for ontodev_valve-0.1.13-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a137b5d394d3373fb508d79fa12d9f018e192648b3242c3db39620c239287b93 |
|
MD5 | a1c07cc3c485769b0ae95ed41757b17c |
|
BLAKE2b-256 | ab144a5bf5a3182c4b24fa70ae5be69c593cc993a0c9ba94bcaa3d2f4dcc69a7 |