mymarilyn/clickhouse-driver
mymarilyn/clickhouse-driver has 1,307 GitHub stars and 248 forks. GitHot measured 0 in 7 days. Last checked 2026-11-10 20:13 UTC. Last push 2026-07-22.
ClickHouse Python Driver with native interface support
What you can do
- External data for query processing.
- Query settings.
- Compression support.
- Date/Date32/DateTime('timezone')/DateTime64('timezone')
Measured star growth
- in 24h
- Update delayed
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalClickHouse Python Driver
.. image:: https://img.shields.io/pypi/v/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://coveralls.io/repos/github/mymarilyn/clickhouse-driver/badge.svg?branch=master :target: https://coveralls.io/github/mymarilyn/clickhouse-driver?branch=master
.. image:: https://img.shields.io/pypi/l/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://img.shields.io/pypi/pyversions/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://img.shields.io/pypi/dm/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://github.com/mymarilyn/clickhouse-driver/actions/workflows/actions.yml/badge.svg :target: https://github.com/mymarilyn/clickhouse-driver/actions/workflows/actions.yml
ClickHouse Python Driver with native (TCP) interface support.
Asynchronous wrapper is available here: https://github.com/mymarilyn/aioch
Features
External data for query processing.
Query settings.
Compression support.
TLS support.
Types support:
- Float32/64
- [U]Int8/16/32/64/128/256
- Date/Date32/DateTime('timezone')/DateTime64('timezone')
- String/FixedString(N)
- Enum8/16
- Array(T)
- Nullable(T)
- Bool
- UUID
- Decimal
- IPv4/IPv6
- LowCardinality(T)
- SimpleAggregateFunction(F, T)
- Tuple(T1, T2, ...)
- Nested
- Map(key, value)
- JSON
Query progress information.
Block by block results streaming.
Reading query profile info.
Receiving server logs.
Multiple hosts support.
Python DB API 2.0 specification support.
Optional NumPy arrays support.
Documentation
Documentation is available at https://clickhouse-driver.readthedocs.io.
Usage
There are two ways to communicate with server:
- using pure Client;
- using DB API.
Pure Client example:
.. code-block:: python
>>> from clickhouse_driver import Client
>>>
>>> client = Client('localhost')
>>>
>>> client.execute('SHOW TABLES')
[('test',)]
>>> client.execute('DROP TABLE IF EXISTS test')
[]
>>> client.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
[]
>>> client.execute(
... 'INSERT INTO test (x) VALUES',
... [{'x': 100}]
... )
1
>>> client.execute('INSERT INTO test (x) VALUES', [[200]])
1
>>> client.execute(
... 'INSERT INTO test (x) '
... 'SELECT * FROM system.numbers LIMIT %(limit)s',
... {'limit': 3}
... )
[]
>>> client.execute('SELECT sum(x) FROM test')
[(303,)]
DB API example:
.. code-block:: python
>>> from clickhouse_driver import connect
>>>
>>> conn = connect('clickhouse://localhost')
>>> cursor = conn.cursor()
>>>
>>> cursor.execute('SHOW TABLES')
>>> cursor.fetchall()
[('test',)]
>>> cursor.execute('DROP TABLE IF EXISTS test')
>>> cursor.fetchall()
[]
>>> cursor.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
>>> cursor.fetchall()
[]
>>> cursor.executemany(
... 'INSERT INTO test (x) VALUES',
... [{'x': 100}]
... )
>>> cursor.rowcount
1
>>> cursor.executemany('INSERT INTO test (x) VALUES', [[200]])
>>> cursor.rowcount
1
>>> cursor.execute(
... 'INSERT INTO test (x) '
... 'SELECT * FROM system.numbers LIMIT %(limit)s',
... {'limit': 3}
... )
>>> cursor.rowcount
0
>>> cursor.execute('SELECT sum(x) FROM test')
>>> cursor.fetchall()
[(303,)]
License
ClickHouse Python Driver is distributed under the MIT license <http://www.opensource.org/licenses/mit-license.php>_.
Explore related projects
Asabeneh/30-Days-Of-Python
The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,486 starsgrafana/grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
77,790 starsredis/redis
For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.
77,332 starsapache/superset
Apache Superset is a Data Visualization and Data Exploration Platform
75,455 stars