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 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, 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.4.tar.gz
(27.7 kB
view hashes)
Built Distribution
Close
Hashes for cottontaildb-client-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | daf4da99ff27b5cfdf7a28c98f384208b94ff9c2fc77233d2a02f27ed27d6076 |
|
MD5 | 8cf3290dca28aa076c9980d8e1f21390 |
|
BLAKE2b-256 | 8a1439084a4fb55e487094eb4be60b496d4eb2cef7b3577f7a4a523a9c5ea40c |
Close
Hashes for cottontaildb_client-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10204877fa7f36fec17226fe545c73372cc6db2857e677fe1161a810e74f13f3 |
|
MD5 | 4e169e806dd33af4627fb88ce9bb5bc3 |
|
BLAKE2b-256 | 7851d4561608e88f99fb41a29486b3d2463c7ea5cd9fd174c98faf1b68c0b2cb |