clickhouse-connect

ClickHouse's official high-performance Python driver, with native Pandas, NumPy, PyArrow, and Superset support

SDK
PyPI
v1.9.0
522 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 100
Maintenance 100
Community 84
Maturity 56
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 84
Code Quality 86
Innovation 78
Learning Curve 74

clickhouse-connect is ClickHouse’s official core database driver for Python, built for high-throughput analytical workloads. It connects over ClickHouse’s HTTP interface for maximum compatibility and returns query results directly as Pandas DataFrames (numpy- or arrow-backed), NumPy arrays, PyArrow Tables, or Polars DataFrames, avoiding an extra conversion step for data-science and BI workflows.

Beyond the raw client, the package ships a lightweight SQLAlchemy Core dialect (with Alembic migration support) and is the connector Apache Superset uses out of the box for ClickHouse data sources, making it the standard bridge between ClickHouse and the Python data ecosystem.

What You Get

  • A core HTTP-based ClickHouse client for executing queries and inserts from Python
  • Native result conversion to Pandas DataFrames (NumPy- or Arrow-backed), NumPy arrays, PyArrow Tables, and Polars DataFrames
  • A SQLAlchemy Core dialect supporting SELECT/JOIN, ARRAY JOIN, FINAL, SAMPLE, VALUES, and lightweight DELETE, compatible with both SQLAlchemy 1.4 and 2.x
  • Alembic migration support with ClickHouse-specific table engines (MergeTree, ReplacingMergeTree) and column-placement/settings features
  • The official connector used by Apache Superset for ClickHouse data sources

Common Use Cases

  • Running analytical queries from a Python data pipeline and loading results directly into a Pandas or Polars DataFrame for analysis
  • Connecting Apache Superset dashboards to a ClickHouse data source
  • Managing ClickHouse schema changes through SQLAlchemy Core + Alembic migrations in a Python-managed data warehouse
  • Bulk-inserting NumPy arrays or PyArrow Tables into ClickHouse tables for ETL workloads

Under The Hood

Architecture: The clickhouse_connect/driver/ package implements the HTTP-based client (connection pooling, query execution, streaming result parsing), datatypes/ handles ClickHouse’s rich column type system and its mapping to Python/NumPy/Arrow types, cc_sqlalchemy/ implements the SQLAlchemy Core dialect (compiler, type mapping, Alembic integration), and driverc/ contains Cython-accelerated modules (excluded from the ruff/ type-checking config) for performance-critical row/column parsing paths. Tech Stack: Python 3.10+, built with setuptools plus cython (3.1.x) for the compiled acceleration modules, packaged as prebuilt wheels per-platform via cibuildwheel; optional dependencies bring in pandas 2.0+, PyArrow, Polars, and SQLAlchemy 1.4/2.x depending on which integrations a consumer needs. Code Quality: Enforces ruff linting (line-length 140, targeting py310) and mypy type checking (with the Cython-compiled driver modules explicitly excluded from mypy since they lack stubs), plus a substantial tests/ suite and a documented MIGRATION.md for the 1.0 breaking-change upgrade path — signals of a maturing, actively-governed driver. API Design: The core query API returns typed results matching the requested output format (DataFrame, NumPy, Arrow, Polars) directly, minimizing manual conversion code, while the SQLAlchemy dialect is explicitly scoped to Core usage rather than full ORM support (no UPDATE compilation, foreign-key reflection, or cascades) — a deliberate tradeoff favoring Superset/Core compatibility over full ORM parity.

Used by 13 apps in this directory

Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 4 days ago
Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 89%
Updated 4 days ago
C++
68%
Apache 2.0

ClickHouse

Analytics · Data Engineering · Databases

50,116

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
64
Dependency
Built with
C++ 68%
Python 14%
Updated 4 days ago
TypeScript
50%
Other

Dify

AI Development · Design Tools · Developer Tools

157,364

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript 50%
Python 47%
Updated 4 days ago
TypeScript
97%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,446

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 97%
Updated 4 days ago
TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,378

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
67
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 1 months ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 4 days ago
TypeScript
55%
Other

OpenReplay

Analytics

12,911

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
90
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 55%
Go 13%
Updated 1 weeks ago
Python
65%
Apache 2.0

Polar

Developer Tools · Ecommerce · Invoicing Finance

10,293

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
66
Dependency
Built with
Python 65%
TypeScript 28%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers