chDB-core: In-process OLAP SQL Engine

26.1.0 · active · verified Thu Apr 16

chDB-core is an in-process OLAP SQL Engine, embedding the powerful analytical capabilities of ClickHouse directly within Python applications. It allows users to execute high-performance SQL queries without the need for a separate ClickHouse server installation or network communication. The library maintains an active development and release cadence, with version 26.1.0 being the current stable release.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to perform a basic SQL query using the `chdb.query` function and how to get results in different formats, including a Pandas DataFrame. The `chdb-core` package exposes its primary functionalities via the `chdb` module.

import chdb

# Execute a simple SQL query
result = chdb.query("SELECT 'Hello, chDB-core!' as message, version() as chdb_version", "Pretty")
print(result)

# Example with DataFrame output (requires pandas to be installed)
try:
    import pandas as pd
    df = chdb.query("SELECT number, number * 2 AS double FROM numbers(5)", "DataFrame")
    print(df)
    print(type(df))
except ImportError:
    print("Pandas not installed. Skipping DataFrame example.")

view raw JSON →