mymarilyn/clickhouse-driver
A Python driver providing native TCP interface support for efficient and secure interaction with ClickHouse databases, featuring extensive data type support and compliance with Python DB API 2.0.
aiochclient is a lightweight asynchronous HTTP(S) client designed specifically for interacting with ClickHouse databases using Python 3.6 and above. It supports type conversion in both directions between ClickHouse and Python, enabling seamless data handling. The client supports streaming, lazy decoding for select queries, and provides a fully typed interface for ease of use and better code clarity. It can be used with either aiohttp or httpx HTTP connectors, with optional speedup packages that include libraries like cChardet, aiodns, and ciso8601 for enhanced performance. The client also attempts to use Cython for an additional speed boost, improving efficiency by roughly 30%. Users can connect to ClickHouse by providing an aiohttp.ClientSession or httpx.AsyncClient instance. The client supports executing queries, including creating tables, inserting data, and fetching results. It offers multiple methods for fetching data: fetch (all rows), fetchrow (first row), fetchval (first value of the first row), and iterate (async iteration over query results). Query results are returned as lightweight, memory-efficient objects that support access by both field names and indexes. The client automatically converts ClickHouse data types to corresponding Python types, covering a wide range of types including integers, floats, strings, dates, decimals, IP addresses, UUIDs, and complex types like tuples, arrays, nullable types, maps, and nested structures. Connection pooling is managed via aiohttp's TCPConnector with a default pool limit of 100 open connections. For optimal speed, it is recommended to use uvloop and install aiochclient with speedups. Benchmarks indicate high performance with 180k-220k rows per second on SELECT queries and 50k-80k rows per second on INSERT queries, though actual performance may vary depending on the system. Comprehensive documentation is available online, and the project includes tests and code style checks to ensure quality.
https://github.com/maximdanilchenko/aiochclient
A Python driver providing native TCP interface support for efficient and secure interaction with ClickHouse databases, featuring extensive data type support and compliance with Python DB API 2.0.
ClickHouse Connect is a high-performance Python driver that enables seamless integration of ClickHouse with Python data tools like Pandas, SQLAlchemy, and Apache Superset for efficient data access and visualization.
Clickhouse-sqlalchemy is a SQLAlchemy dialect that enables seamless interaction with ClickHouse databases, supporting multiple connection interfaces and providing ORM capabilities for efficient data analytics.
infi.clickhouse_orm is a Python ORM library that simplifies working with the ClickHouse database by enabling easy model definition, data insertion, and querying.
sqlalchemy-clickhouse is a SQLAlchemy dialect that enables seamless integration with the ClickHouse database for efficient data querying and manipulation.
An asynchronous Python driver for ClickHouse with native TCP interface support, enabling efficient database interactions using asyncio.
Pandahouse is a Python library providing a Pandas interface to interact with ClickHouse databases via HTTP API for efficient data reading and writing.
Django-clickhouse-backend is a Django database backend that enables seamless interaction with ClickHouse using Django ORM, supporting ClickHouse-specific features and efficient connection pooling.