PyVidarDB
A simple python wrapper for VidarDB.
Use PyVidarDB
PyVidarDB guarantees to support Python >= 3.5.
There is no need to have VidarDB installed in advance, PyVidarDB will install it automatically for you.
Dependencies
For Linux users (Ubuntu as an example):
sudo apt-get update
sudo apt-get install git python3-pip build-essential cmake
For MacOS users (Please install Homebrew at first):
sudo brew install git python3 cmake
For Windows users:
The compiler should support C++11 (at least Visual Studio 2015 update 3).
PyVidarDB Installation
From PyPI:
pip3 install PyVidarDB
From Github:
git clone --recursive https://github.com/vidardb/PyVidarDB.git
pip3 install ./PyVidarDB
Basic Usage
Here is the basic usage for PyVidarDB:
import pyvidardb
db = pyvidardb.DB()
# Open the database, will create one if not exist.
db.open("./hello_world")
# Put a map from 'key1' to 'value1' into the database.
db.put(b"key1", b"value1")
# Get the value(s) of the provided key, will return None
# if there is no such key in the database.
value = db.get(b"key1")
assert value == [b"value1"]
# 'key2' does not exist in the database. So we will get None here.
value = db.get(b"key2")
assert value is None
# Remove 'key1' from the database.
db.delete(b"key1")
# Put a map from 'key2' to multiple values into the database.
db.put(b"key2", [b"value1", b"value2", b"value3"])
# Get the value(s) of the provided key.
value = db.get(b"key2")
assert value == [b"value1", b"value2", b"value3"]
# Remove 'key2' from the database.
db.delete(b"key2")
# Close the database.
db.close()
PyVidarDB supports storing one key with multiple values. For example,
db.put(b"key", [b"value1", b"value2", b"value3"]) will put a map
from key to [b"value1", b"value2", b"value3"] into the database.
To store one key with one value, simply call db.put(b"key", b"value")
or db.put(b"key", [b"value"]). For db.put(), the passed key's type
must be bytes, while the values' type can be bytes or a list of bytes.
For db.get(key: bytes) and db.delete(key: bytes), the passed arguments'
types must be bytes. The return type of db.get(key: bytes) is a list of
bytes which contains all the values of that key. If the provided key does
not exist in the database, None will be returned.
More examples can be found at here: https://github.com/vidardb/PyVidarDB/tree/master/examples
See our wiki page for more information.
Metadata
Release files for PyVidarDB 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyVidarDB-0.1.0.tar.gz | 2.4 MB | Without provenance | Details for PyVidarDB-0.1.0.tar.gz |
Release files / PyVidarDB-0.1.0.tar.gz
| Download URL | PyVidarDB-0.1.0.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5559178fc0266077fac84933df71702c25de458f1881b1a9147e6c93a1734bac
|
|
BLAKE2b-256 checksum How to use checksums |
83300f4c415cc190f17d5d9ea3a197758c678027d3cf73c04f1f495ebe8bc284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9
|
Security for PyVidarDB 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.