A Cottontail DB gRPC client.
Project description
Cottontail DB gRPC Python Client
A Cottontail DB gRPC client for Python. Built with Cottontail DB Proto
version 0.12.2
. Comes with an interactive CLI for remote DB access.
Installation
Clone and install locally, or with pip install git+https://github.com/spiess/cottontaildb-python-client.git
.
Usage
Running the interactive CLI is as easy as cottontaildb-client [--port PORT] host
.
Example usage in scripts:
from cottontaildb_client import CottontailDBClient, Type, Literal, column_def
with CottontailDBClient('localhost', 1865) as client:
# Create schema
client.create_schema('example_schema')
# Define entity columns
columns = [
column_def('id', Type.STRING, nullable=False),
column_def('value', Type.INTEGER, nullable=True)
]
# Create entity
client.create_entity('example_schema', 'example_entity', columns)
# Insert entry
entry = {'id': Literal(stringData='test_1'), 'value': Literal(intData=1)}
client.insert('example_schema', 'example_entity', entry)
# Insert batch
columns = ['id', 'value']
values = [
[Literal(stringData='test_10'), Literal(intData=10)],
[Literal(stringData='test_20'), Literal(intData=20)]
]
client.insert_batch('example_schema', 'example_entity', columns, values)
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 Distribution
cottontaildb-client-0.0.2.tar.gz
(27.3 kB
view hashes)
Built Distribution
Close
Hashes for cottontaildb-client-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a9d163bd9a0899b50f285905483663d87054d2b90bbc92072d02f830b1ba54 |
|
MD5 | c9af362a6990621d540985eda1182420 |
|
BLAKE2b-256 | c666f09d568f10a3218d93797f0b3ef1bac5f10ae6efc479b6352f778d0115dc |
Close
Hashes for cottontaildb_client-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f32e9fbaf3e064fb663f1c81f3030e5c306df01d4711369a91ef3746d7cc0716 |
|
MD5 | f9ce76df78e0290faf1a3f423c8f0689 |
|
BLAKE2b-256 | c2fee4c0d19f8e31e775b795f117661cd5b0ed75395f4bb6ccc764823da4fe98 |