Python client for ValtheraDB Conduit.
Project description
wxn0brp-db-conduit
Python bridge for ValtheraDB Conduit.
Install the package:
pip install wxn0brp-db-conduit
Import the package from the wxn0brp.db namespace:
from wxn0brp.db import conduit
Quick Start
Create a controller, initialize a DB, then work with collections:
from wxn0brp.db import conduit
controller = conduit.ValtheraConduit("./vendor/vdb", auto_download=True)
db = controller.data.init("./data")
users = db.c("users")
users.add({"name": "Ada"})
print(users.find({"name": "Ada"}))
controller.shutdown()
Use a context manager when you want the conduit process to shut down automatically:
from wxn0brp.db import conduit
with conduit.ValtheraConduit("./vendor/vdb", auto_download=True) as controller:
db = controller.data.init("./data")
users = db.c("users")
users.add({"name": "Ada"})
print(users.find({"name": "Ada"}))
Controller and DB Initialization
ValtheraConduit controls the conduit binary process. A DB must be initialized before it can execute operations.
Attribute style:
db = controller.data.init("./data", opts={"numberId": False})
Explicit style:
db = controller.init("data", "./data", opts={"numberId": False})
API Shape
Attribute-style DB initialization names the DB from the attribute:
db = controller.data.init("./data")
The explicit equivalent is:
db = controller.init("data", "./data")
opts is optional and defaults to {}:
db = controller.data.init("./data", opts={"numberId": False})
Collections are available through db.c(name), db.collection(name), or attribute access:
users = db.c("users")
users = db.collection("users")
users = db.users
Both Pythonic snake_case and Valthera-style camelCase aliases are available for methods such as find_one/findOne, update_one/updateOne, and update_one_or_add/updateOneOrAdd.
For explicit binary installation, run:
python -m wxn0brp.db.conduit.install --install-dir ./vendor/vdb
License
MIT
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wxn0brp_db_conduit-0.0.2-py3-none-any.whl.
File metadata
- Download URL: wxn0brp_db_conduit-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e32619da8559b645b59631c6b13db5cf4e773eef0ddce2f1eb861b4bcddde6e9
|
|
| MD5 |
8fae290d3a0a83c521537f8414d26c7e
|
|
| BLAKE2b-256 |
825a697fcf66b5c9578b2a1cca4b2590ea5b75f2e6101df4ad0526b90b18e22a
|
Provenance
The following attestation bundles were made for wxn0brp_db_conduit-0.0.2-py3-none-any.whl:
Publisher:
python-bridge.yml on wxn0brP/ValtheraDB-conduit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wxn0brp_db_conduit-0.0.2-py3-none-any.whl -
Subject digest:
e32619da8559b645b59631c6b13db5cf4e773eef0ddce2f1eb861b4bcddde6e9 - Sigstore transparency entry: 1810351745
- Sigstore integration time:
-
Permalink:
wxn0brP/ValtheraDB-conduit@c73624f84bbc7dd234ef952f3bc0ce106bbc19ac -
Branch / Tag:
refs/heads/master - Owner: https://github.com/wxn0brP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-bridge.yml@c73624f84bbc7dd234ef952f3bc0ce106bbc19ac -
Trigger Event:
push
-
Statement type: