ClickHouse Pool for Python
A thread-safe connection pool for ClickHouse. Inspired by psycopg2 and using
clickhouse-driver for
connections.
Installation
pip install clickhouse-pool
Quick Start
from clickhouse_pool import ChPool
# find available settings at https://clickhouse-driver.readthedocs.io/en/latest/api.html#clickhouse_driver.Client
pool = ChPool(host="localhost")
with pool.get_client() as client:
# execute sql and print the result
result = client.execute("SELECT * FROM system.numbers LIMIT 5")
print(result)
# always close all connections in the pool once you're done with it
pool.cleanup()
Connection Pool Size
To change the connection pool size,
pool = ChPool(connections_min=20, connections_max=40)
with pool.get_client() as client:
result = client.execute("SELECT * FROM system.numbers LIMIT 5")
print(result)
# always close all connections in the pool once you're done with it
pool.cleanup()
Testing Locally
To run tests locally ensure you have an instance of clickhouse-server running on localhost. The easiest way is to use docker:
docker run -d -p 9000:9000 yandex/clickhouse-server
poetry run pytest
Building Docs
poetry run sphinx-build -M html docs/source docs/_build
Metadata
Release files for clickhouse-pool 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clickhouse_pool-0.6.1.tar.gz | 3.9 kB | Without provenance | Details for clickhouse_pool-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clickhouse_pool-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for clickhouse_pool-0.6.1-py3-none-any.whl |
Total release size: 8.6 kB
Release files / clickhouse_pool-0.6.1.tar.gz
| Download URL | clickhouse_pool-0.6.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a888d90c8661eb0cf3c459791d800a21a226c960a6872c95561ec5fab5a2ebf
|
|
BLAKE2b-256 checksum How to use checksums |
3357de9a73299f21cfa09a086a984147f52b7ede3efcd5e07968e84c4d098a9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|
Release files / clickhouse_pool-0.6.1-py3-none-any.whl
| Download URL | clickhouse_pool-0.6.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bacf3fb138a45d29b4300e1646b425b4c5bd28ec953b24840ba5d64203eb6b2a
|
|
BLAKE2b-256 checksum How to use checksums |
c4873bfd9e3d775b7ac1e4792c3d2ffb4a17eda1665be1ff2a813a7e4b5ef56a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|
Security for clickhouse-pool 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.