Skip to main content

chDB is an in-process SQL OLAP Engine powered by ClickHouse

Project description

Build PyPI Monthly Downloads Discord Twitter

chDB

中文

chDB is an embedded SQL OLAP Engine powered by ClickHouse

Features

  • In-process SQL OLAP Engine, powered by ClickHouse
  • No need to install ClickHouse
  • Minimized data copy from C++ to Python with python memoryview
  • Input&Output support Parquet, CSV, JSON, Arrow, ORC and 60+more formats, samples
  • Support Python DB API 2.0, example

Arch

Installation

Currently, chDB only supports Python 3.7+ on macOS(x86_64 and ARM64) and Linux.

pip install chdb

Usage

Run in command line

python3 -m chdb SQL [OutputFormat]

python3 -m chdb "SELECT 1,'abc'" Pretty

Currently, chDB only supports query function, which is used to execute SQL and return desired format data.

import chdb
res = chdb.query('select version()', 'Pretty'); print(res.data())

Work with Parquet or CSV

# See more data type format in tests/format_output.py
res = chdb.query('select * from file("data.parquet", Parquet)', 'JSON'); print(res.data())
# With large data result, get_memview() is more quickly cos it does not do an extra data copy.
res = chdb.query('select * from file("data.csv", CSV)', 'CSV');  print(str(res.get_memview().tobytes()))

Pandas dataframe output

# See more in https://clickhouse.com/docs/en/interfaces/formats
chdb.query('select * from file("data.parquet", Parquet)', 'Dataframe')

Demos and Examples

Benchmark

Documentation

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. There are something you can help:

  • Help me with Windows support, I don't know much about Windows toolchain.
  • The Python Wrapper just have a query function. I want to add more functions to make it more convenient to use. like toPandas, toNumpy and so on.

License

AGPL-v3.0 or Commercial License, see LICENSE for more information.

Acknowledgments

chDB is mainly based on ClickHouse for trade mark and other reasons, I named it chDB.

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

chdb-0.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (109.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chdb-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (66.8 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

chdb-0.9.0-cp311-cp311-macosx_10_15_x86_64.whl (88.7 MB view hashes)

Uploaded CPython 3.11 macOS 10.15+ x86-64

chdb-0.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (109.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chdb-0.9.0-cp310-cp310-macosx_11_0_arm64.whl (66.8 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

chdb-0.9.0-cp310-cp310-macosx_10_15_x86_64.whl (88.7 MB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

chdb-0.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (109.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chdb-0.9.0-cp39-cp39-macosx_11_0_arm64.whl (66.8 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

chdb-0.9.0-cp39-cp39-macosx_10_15_x86_64.whl (88.7 MB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

chdb-0.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (109.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chdb-0.9.0-cp38-cp38-macosx_10_15_x86_64.whl (88.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

chdb-0.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (109.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chdb-0.9.0-cp37-cp37m-macosx_10_15_x86_64.whl (88.7 MB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page