Code Monkey home page Code Monkey logo

chdb's Introduction

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

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

chdb's People

Contributors

4ertus2 avatar abyss7 avatar akuzm avatar al13n321 avatar alesapin avatar alexey-milovidov avatar amosbird avatar antonio2368 avatar avogar avatar azat avatar bayonet avatar blinkov avatar curtizj avatar diehertz avatar evillique avatar excitoon avatar felixoid avatar ka1bi4 avatar kitaisreal avatar kochetovnicolai avatar kssenii avatar ludv1x avatar mergify[bot] avatar nikitamikhaylov avatar proller avatar qoega avatar rschu1ze avatar sevirov avatar tavplubix avatar vdimir avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.