Awesome ClickHousePython

Infinidat/infi.clickhouse_orm

⭐ 420 Python repository created 2016-06-26

The project "infi.clickhouse_orm" is a Python library designed to facilitate working with the ClickHouse database, a high-performance columnar database management system. This library acts as a simple Object-Relational Mapping (ORM) tool, allowing developers to define model classes that represent database tables. Instances of these model classes can be easily written to and read from the ClickHouse database, streamlining database interactions. The library provides an intuitive way to define models with fields corresponding to ClickHouse data types, such as DateTimeField, UInt16Field, and Float32Field. It supports defining the storage engine for tables, for example, the Memory engine. Users can create tables directly from model definitions and perform insert operations with ease. A practical example included in the project demonstrates monitoring CPU usage by defining a CPUStats model, connecting to a ClickHouse database, creating the corresponding table, and inserting CPU usage statistics collected in real-time. This example highlights the library's capability to handle time-series data efficiently. Querying data is made straightforward through a query builder interface or by executing raw SQL queries. The library supports filtering, counting, and aggregation operations, enabling users to perform complex queries such as calculating the percentage of time a CPU was busy or computing average CPU usage per CPU core. The project includes additional examples and comprehensive documentation to help users get started and leverage the full capabilities of the ORM. Overall, infi.clickhouse_orm simplifies the integration of Python applications with ClickHouse databases, making it easier to manage and analyze large volumes of data with minimal boilerplate code.

https://github.com/Infinidat/infi.clickhouse_orm

aggregationclickhousecpu-monitoringdata-analysisdata-insertiondatabasememory-enginemodel-classesormpython-libraryquery-builderqueryingraw-sqltime-series-data

Also in Python

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.

ClickHouse/clickhouse-connect

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.

xzkostyan/clickhouse-sqlalchemy

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.

cloudflare/sqlalchemy-clickhouse

sqlalchemy-clickhouse is a SQLAlchemy dialect that enables seamless integration with the ClickHouse database for efficient data querying and manipulation.

maximdanilchenko/aiochclient

aiochclient is a lightweight asynchronous HTTP client for Python that provides efficient and type-safe interaction with ClickHouse databases, supporting streaming, lazy decoding, and high performance through optional speedups.

long2ice/asynch

An asynchronous Python driver for ClickHouse with native TCP interface support, enabling efficient database interactions using asyncio.

kszucs/pandahouse

Pandahouse is a Python library providing a Pandas interface to interact with ClickHouse databases via HTTP API for efficient data reading and writing.

jayvynl/django-clickhouse-backend

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.