No project description provided
Project description
pych-client
Installation
# Default Python JSON parser:
pip install pych-client
# Faster orjson parser:
pip install pych-client[orjson]
Usage
from pych_client import ClickHouseClient
params = {"table": "test_pych"}
with ClickHouseClient() as client:
client.text('''
CREATE TABLE {table:Identifier} (a Int64, b Int64)
ENGINE MergeTree() ORDER BY (a, b)
''', params)
client.text("INSERT INTO {table:Identifier} VALUES", params, "(1, 2), (3, 4)")
client.text("INSERT INTO {table:Identifier} VALUES", params, [b"(5, 6)", b"(7, 8)"])
client.json("SELECT * FROM {table:Identifier} ORDER BY a", params)
# [{'a': '1', 'b': '2'}, {'a': '3', 'b': '4'}, {'a': '5', 'b': '6'}, {'a': '7', 'b': '8'}]
Command-line interface
pipx install pych-client
pych-client --help
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
pych-client-0.1.5.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for pych_client-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b18a465ef12f9d7528ddbc10f1d620f65f5231623dd53a8c6ae2b3ddf0578f6e |
|
MD5 | 9b69f953ce8b5667cd7c37a8a1b50c1f |
|
BLAKE2b-256 | 7f0c702ef90d485a8e672df6189eedc70e3e299c12d644a4351dbbe1cfb92e6a |