VALVE bindings for Python
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
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.
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
File details
Details for the file ontodev_valve-0.2.1-cp310-none-win_amd64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp310-none-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ad85d1735abfa81334a3af54fba6a7513aaa16c59d7196da3baaf72b921644 |
|
MD5 | 4795ea250bc6510046510309b5990de9 |
|
BLAKE2b-256 | e630ed7057a543d44d3489d8f10de0869912b6211635d757e4a96d576f660ce5 |
File details
Details for the file ontodev_valve-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.10, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa0198fef13afac55cea4d254d8d02c90dae97444e3af87eddf4b2e7d4e3c04 |
|
MD5 | 1d5d8ec45faf4e3347b28270124ea502 |
|
BLAKE2b-256 | d4b4b4887c7cb43fd9dbd4ace69be76fe2189266cfd0e01a554f8b13f9e36b49 |
File details
Details for the file ontodev_valve-0.2.1-cp310-cp310-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp310-cp310-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c856e13230ba87007ff41c61e79a59514e41ee0ba7bd149a9ea1ff4628223b |
|
MD5 | afbd71d9f4c4ec7fff854d5f9baae7e6 |
|
BLAKE2b-256 | 6058673c24aea8a3b218f442a5f122211903c7a4c3c388ef8dd30f0d2e94a240 |
File details
Details for the file ontodev_valve-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82fa083654c6c613761dcbc59f966fa07c7ccdba303caa03bf5e9d33d757f213 |
|
MD5 | 949acde7ec3716d2e7f25a601b84e4a6 |
|
BLAKE2b-256 | 5e517e9a182a5f15415d477ca21b850cfc0ebb459e052fbff01a2b0eb6783fc1 |
File details
Details for the file ontodev_valve-0.2.1-cp310-cp310-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp310-cp310-macosx_10_7_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.10, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cf2d5f29ea74e4307f858cca783ab3f872fbd646898e144646ef66b49953987 |
|
MD5 | 623387c914fd1f0cc7655815b1b857a1 |
|
BLAKE2b-256 | 6b0319744f03311f1840948ca36d50914a0333e2fe0b2395c2d5b932366d4dd0 |
File details
Details for the file ontodev_valve-0.2.1-cp39-none-win_amd64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp39-none-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe9e3e28ee20cff141b1746d771eee2466b1ca4486960e2c950262829cd209e |
|
MD5 | 0b0e5fd092ee5a46de6ff522748cb3f5 |
|
BLAKE2b-256 | 92bb933031960bb468e4914f594da700f68c67c7afd2d6910001c3f7b662c627 |
File details
Details for the file ontodev_valve-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.9, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e9d31b1bb74379fdf013c41ab4e858f380125843cd4f5ebdf00e17f9e412aa2 |
|
MD5 | 09fd3b21fe8325057066f455689658fd |
|
BLAKE2b-256 | 94000352c7f73ed89f83ae677e052685b87cafddc10a3efceacded86d4dec5de |
File details
Details for the file ontodev_valve-0.2.1-cp39-cp39-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp39-cp39-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e95fd92f25aa05d3484c3bf3b8ca18b0190fb8e27bf18fc1b507fb297c51ae80 |
|
MD5 | 6ed2cd391194cd03259d7b68e9ef1744 |
|
BLAKE2b-256 | 6bd0c76d38bba5bac5306a6f686aeca68e97e52ee888d9e89d59b228efa3763c |
File details
Details for the file ontodev_valve-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 954d7abb7607574d8e1dc69974483c3e20df7fc889468efe02ed65824c1edc0e |
|
MD5 | 82315b40dbf850c5f909750a02de2abf |
|
BLAKE2b-256 | 8d40be0076b617acb00e280b0b519ba5048ecd62764dd793ab22f9106dbda934 |
File details
Details for the file ontodev_valve-0.2.1-cp39-cp39-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp39-cp39-macosx_10_7_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.9, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ccf9b30b258e14a666fb8109f1ea814ae70e9e1664b2079c813078d51704ab9 |
|
MD5 | a20029a8c62c830356ae643e8eb0ba1a |
|
BLAKE2b-256 | b805b18c6bed1e36c36688ac85ab49cec31a375dd72a8caaef296bf3b28fb4bf |
File details
Details for the file ontodev_valve-0.2.1-cp38-none-win_amd64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp38-none-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb979873160dd753f99281229b32d8efb24b8ea45c84cab39f86805c9077763 |
|
MD5 | cce7ff9fdb5adb71484fbfd755a8f25c |
|
BLAKE2b-256 | 11b452b90ed854c61f96b5d58303584298e83ea2121b205de2e14fe31cbbf561 |
File details
Details for the file ontodev_valve-0.2.1-cp38-cp38-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp38-cp38-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.8, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64bd189b2df889cea367066daa03963699acac970436e0daf92b5d0ed700c60f |
|
MD5 | 867dc59aeb0a18e63e5d7d401d60249b |
|
BLAKE2b-256 | 572856fd5b4ad4c0fdd08b2189822d775f7ee1d4cf82713b01be865c4503e5d6 |
File details
Details for the file ontodev_valve-0.2.1-cp38-cp38-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp38-cp38-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8470dde9b43e29a3f02ab017e674426ae9097e49508e5496a68405d9d928ae5e |
|
MD5 | 8fbfd0f063ab7514371ab2fdcc258875 |
|
BLAKE2b-256 | 4a32789adfb11ab2ac397ad26980fc9fce45452782fc3f1d3607e8ac882c04ea |
File details
Details for the file ontodev_valve-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d02aec8e6f991e27355195a7057e3fb0c7881c6ceba180c1c08c647762b993 |
|
MD5 | 8050bf60aaff0d0a33a85064df1987a8 |
|
BLAKE2b-256 | 6e7808a27135aa67c8744b92762a3d8ff172fd2f3441021611d3d368aa0c8a46 |
File details
Details for the file ontodev_valve-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: ontodev_valve-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12803ac35cbc9090388cd90cf2bc7b11a3cb3f988971d847f2852156e570d127 |
|
MD5 | 6c2fce90321526a82f627968bb7c0760 |
|
BLAKE2b-256 | f1d7bc228a4633b979b565da07661cf9d1caad6140cfb2fbfef6001337da400b |