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.13.0
. Comes with an interactive CLI for remote DB access.
Installation
Clone and install locally, or with pip install cottontaildb-client
.
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, Null, 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)],
[Literal(stringData='test_null'), Literal(nullData=Null())]
]
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.5.tar.gz
(27.3 kB
view hashes)
Built Distribution
Close
Hashes for cottontaildb-client-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3438a28bcf0fb578aabe376820850e2b6a438dd932b241a8dc9aeaed1fe6f0c7 |
|
MD5 | 2bd19ca68bd3594b799a73976de12e93 |
|
BLAKE2b-256 | ab5a9856a62b9587c6840963ba21d934f32b8b92927cf3278aac7b850486f2de |
Close
Hashes for cottontaildb_client-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 188b4cb39e9fd8bb378b899bcbd79bb207c6333eebb08bf8eac0c4217528ccde |
|
MD5 | c699da8998ea3e217e68bcb68b306e26 |
|
BLAKE2b-256 | 7169dec85d457273ecc89c9a79c7e5fc2eb2775c0edc1bcc091088f49b7e1cab |