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_valveto the top of your python script.
Usage examples
See the file test/main.py for usage examples.
API reference
valve(table_table, db_path, command, verbose, config_table="table")
Given a path to a configuration table (either a table.tsv file or a database containing a
table named "table"), and 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 create and/or load it according to the value of command
(see Valve Command). If the verbose flag is set to true, output status
messages while loading. If config_table (which defaults to "table") is given and
table_table indicates a database, query the table called config_table for the
table table information. Returns the configuration map as a 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.
ValveCommand
The following commands may be used with the valve() function.
ValveCommand.Config
Configure but do not create or load.
ValveCommand.Create
Configure and create but do not load.
ValveCommand.Load
Configure, create, and load.
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.
Metadata
Release files for ontodev-valve 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 60.4 MB
Release files / ontodev_valve-0.2.1-cp310-none-win_amd64.whl
| Download URL | ontodev_valve-0.2.1-cp310-none-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
32ad85d1735abfa81334a3af54fba6a7513aaa16c59d7196da3baaf72b921644
|
|
BLAKE2b-256 checksum How to use checksums |
e630ed7057a543d44d3489d8f10de0869912b6211635d757e4a96d576f660ce5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / ontodev_valve-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
cfa0198fef13afac55cea4d254d8d02c90dae97444e3af87eddf4b2e7d4e3c04
|
|
BLAKE2b-256 checksum How to use checksums |
d4b4b4887c7cb43fd9dbd4ace69be76fe2189266cfd0e01a554f8b13f9e36b49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp310-cp310-manylinux_2_31_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp310-cp310-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.10 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
e7c856e13230ba87007ff41c61e79a59514e41ee0ba7bd149a9ea1ff4628223b
|
|
BLAKE2b-256 checksum How to use checksums |
6058673c24aea8a3b218f442a5f122211903c7a4c3c388ef8dd30f0d2e94a240
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | ontodev_valve-0.2.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
82fa083654c6c613761dcbc59f966fa07c7ccdba303caa03bf5e9d33d757f213
|
|
BLAKE2b-256 checksum How to use checksums |
5e517e9a182a5f15415d477ca21b850cfc0ebb459e052fbff01a2b0eb6783fc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / ontodev_valve-0.2.1-cp310-cp310-macosx_10_7_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp310-cp310-macosx_10_7_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.10 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
9cf2d5f29ea74e4307f858cca783ab3f872fbd646898e144646ef66b49953987
|
|
BLAKE2b-256 checksum How to use checksums |
6b0319744f03311f1840948ca36d50914a0333e2fe0b2395c2d5b932366d4dd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / ontodev_valve-0.2.1-cp39-none-win_amd64.whl
| Download URL | ontodev_valve-0.2.1-cp39-none-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5fe9e3e28ee20cff141b1746d771eee2466b1ca4486960e2c950262829cd209e
|
|
BLAKE2b-256 checksum How to use checksums |
92bb933031960bb468e4914f594da700f68c67c7afd2d6910001c3f7b662c627
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / ontodev_valve-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
6e9d31b1bb74379fdf013c41ab4e858f380125843cd4f5ebdf00e17f9e412aa2
|
|
BLAKE2b-256 checksum How to use checksums |
94000352c7f73ed89f83ae677e052685b87cafddc10a3efceacded86d4dec5de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp39-cp39-manylinux_2_31_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp39-cp39-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.9 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
e95fd92f25aa05d3484c3bf3b8ca18b0190fb8e27bf18fc1b507fb297c51ae80
|
|
BLAKE2b-256 checksum How to use checksums |
6bd0c76d38bba5bac5306a6f686aeca68e97e52ee888d9e89d59b228efa3763c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | ontodev_valve-0.2.1-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
954d7abb7607574d8e1dc69974483c3e20df7fc889468efe02ed65824c1edc0e
|
|
BLAKE2b-256 checksum How to use checksums |
8d40be0076b617acb00e280b0b519ba5048ecd62764dd793ab22f9106dbda934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / ontodev_valve-0.2.1-cp39-cp39-macosx_10_7_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp39-cp39-macosx_10_7_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.9 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
6ccf9b30b258e14a666fb8109f1ea814ae70e9e1664b2079c813078d51704ab9
|
|
BLAKE2b-256 checksum How to use checksums |
b805b18c6bed1e36c36688ac85ab49cec31a375dd72a8caaef296bf3b28fb4bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / ontodev_valve-0.2.1-cp38-none-win_amd64.whl
| Download URL | ontodev_valve-0.2.1-cp38-none-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
abb979873160dd753f99281229b32d8efb24b8ea45c84cab39f86805c9077763
|
|
BLAKE2b-256 checksum How to use checksums |
11b452b90ed854c61f96b5d58303584298e83ea2121b205de2e14fe31cbbf561
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / ontodev_valve-0.2.1-cp38-cp38-musllinux_1_2_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp38-cp38-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
64bd189b2df889cea367066daa03963699acac970436e0daf92b5d0ed700c60f
|
|
BLAKE2b-256 checksum How to use checksums |
572856fd5b4ad4c0fdd08b2189822d775f7ee1d4cf82713b01be865c4503e5d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp38-cp38-manylinux_2_31_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp38-cp38-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.8 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
8470dde9b43e29a3f02ab017e674426ae9097e49508e5496a68405d9d928ae5e
|
|
BLAKE2b-256 checksum How to use checksums |
4a32789adfb11ab2ac397ad26980fc9fce45452782fc3f1d3607e8ac882c04ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ontodev_valve-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
| Download URL | ontodev_valve-0.2.1-cp38-cp38-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.8 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
62d02aec8e6f991e27355195a7057e3fb0c7881c6ceba180c1c08c647762b993
|
|
BLAKE2b-256 checksum How to use checksums |
6e7808a27135aa67c8744b92762a3d8ff172fd2f3441021611d3d368aa0c8a46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / ontodev_valve-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl
| Download URL | ontodev_valve-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.8 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
12803ac35cbc9090388cd90cf2bc7b11a3cb3f988971d847f2852156e570d127
|
|
BLAKE2b-256 checksum How to use checksums |
f1d7bc228a4633b979b565da07661cf9d1caad6140cfb2fbfef6001337da400b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|