All Projects → mymarilyn → Clickhouse Driver

mymarilyn / Clickhouse Driver

Licence: other
ClickHouse Python Driver with native interface support

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Clickhouse Driver

aioch
aioch - is a library for accessing a ClickHouse database over native interface from the asyncio
Stars: ✭ 145 (-74.2%)
Mutual labels:  yandex, native, clickhouse, driver
Clickhouse Sqlalchemy
ClickHouse dialect for SQLAlchemy
Stars: ✭ 166 (-70.46%)
Mutual labels:  yandex, database, clickhouse
Clickhouse Net
Yandex ClickHouse fully managed .NET client
Stars: ✭ 142 (-74.73%)
Mutual labels:  yandex, database, clickhouse
Clickhouse Native Jdbc
ClickHouse Native Protocol JDBC implementation
Stars: ✭ 310 (-44.84%)
Mutual labels:  database, clickhouse
React Native Mmkv Storage
An Efficient(0.0002s read/write), small & encrypted mobile key-value storage framework for React Native
Stars: ✭ 273 (-51.42%)
Mutual labels:  database, native
Psycopg3
New generation PostgreSQL database adapter for the Python programming language
Stars: ✭ 278 (-50.53%)
Mutual labels:  database, driver
Rdbc
Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Stars: ✭ 328 (-41.64%)
Mutual labels:  database, driver
Cdrs
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Stars: ✭ 314 (-44.13%)
Mutual labels:  database, driver
Firebase Instagram
📸 Instagram clone with Firebase Cloud Firestore, Expo, and React Native 😁😍
Stars: ✭ 389 (-30.78%)
Mutual labels:  database, native
Rust Mysql Simple
Mysql client library implemented in rust.
Stars: ✭ 415 (-26.16%)
Mutual labels:  database, driver
Hasql
Performant PostgreSQL driver with a flexible mapping API
Stars: ✭ 415 (-26.16%)
Mutual labels:  database, driver
Qmgo
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.
Stars: ✭ 444 (-21%)
Mutual labels:  database, driver
appmetrica-logsapi-loader
A tool for automatic data loading from AppMetrica LogsAPI into (local) ClickHouse
Stars: ✭ 18 (-96.8%)
Mutual labels:  yandex, clickhouse
sqlite3
The fastest and correct module for SQLite3 in Deno.
Stars: ✭ 143 (-74.56%)
Mutual labels:  native, driver
Vertica Python
Official native Python client for the Vertica Analytics Database.
Stars: ✭ 301 (-46.44%)
Mutual labels:  database, driver
Datafuse
Datafuse is a free Cloud-Native Analytics DBMS(Inspired by ClickHouse) implemented in Rust
Stars: ✭ 327 (-41.81%)
Mutual labels:  database, clickhouse
Go Clickhouse
Golang SQL database driver for Yandex ClickHouse
Stars: ✭ 240 (-57.3%)
Mutual labels:  database, clickhouse
Faunadb Js
Javascript driver for FaunaDB
Stars: ✭ 498 (-11.39%)
Mutual labels:  database, driver
Sqlhooks
Attach hooks to any database/sql driver
Stars: ✭ 397 (-29.36%)
Mutual labels:  database, driver
Csharp Driver
DataStax C# Driver for Apache Cassandra
Stars: ✭ 477 (-15.12%)
Mutual labels:  database, driver

ClickHouse Python Driver

.. image:: https://img.shields.io/pypi/v/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver

.. image:: https://coveralls.io/repos/github/mymarilyn/clickhouse-driver/badge.svg?branch=master :target: https://coveralls.io/github/mymarilyn/clickhouse-driver?branch=master

.. image:: https://img.shields.io/pypi/l/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver

.. image:: https://img.shields.io/pypi/pyversions/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver

.. image:: https://img.shields.io/pypi/dm/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver

.. image:: https://travis-ci.org/mymarilyn/clickhouse-driver.svg?branch=master :target: https://travis-ci.org/mymarilyn/clickhouse-driver

ClickHouse Python Driver with native (TCP) interface support.

Asynchronous wrapper is available here: https://github.com/mymarilyn/aioch

Features

  • External data for query processing.

  • Query settings.

  • Compression support.

  • TLS support (since server version 1.1.54304).

  • Types support:

    • Float32/64
    • [U]Int8/16/32/64
    • Date/DateTime('timezone')/DateTime64('timezone')
    • String/FixedString(N)
    • Enum8/16
    • Array(T)
    • Nullable(T)
    • UUID
    • Decimal
    • IPv4/IPv6
    • LowCardinality(T)
    • SimpleAggregateFunction(F, T)
    • Tuple(T1, T2, ...)
    • Nested
  • Query progress information.

  • Block by block results streaming.

  • Reading query profile info.

  • Receiving server logs.

  • Multiple hosts support.

  • Python DB API 2.0 specification support.

  • Optional NumPy arrays support.

Documentation

Documentation is available at https://clickhouse-driver.readthedocs.io.

Usage

There are two ways to communicate with server:

  • using pure Client;
  • using DB API.

Pure Client example:

.. code-block:: python

    >>> from clickhouse_driver import Client
    >>>
    >>> client = Client('localhost')
    >>>
    >>> client.execute('SHOW TABLES')
    [('test',)]
    >>> client.execute('DROP TABLE IF EXISTS test')
    []
    >>> client.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
    []
    >>> client.execute(
    ...     'INSERT INTO test (x) VALUES',
    ...     [{'x': 100}]
    ... )
    1
    >>> client.execute('INSERT INTO test (x) VALUES', [[200]])
    1
    >>> client.execute(
    ...     'INSERT INTO test (x) '
    ...     'SELECT * FROM system.numbers LIMIT %(limit)s',
    ...     {'limit': 3}
    ... )
    []
    >>> client.execute('SELECT sum(x) FROM test')
    [(303,)]

DB API example:

.. code-block:: python

    >>> from clickhouse_driver import connect
    >>>
    >>> conn = connect('clickhouse://localhost')
    >>> cursor = conn.cursor()
    >>>
    >>> cursor.execute('SHOW TABLES')
    >>> cursor.fetchall()
    [('test',)]
    >>> cursor.execute('DROP TABLE IF EXISTS test')
    >>> cursor.fetchall()
    []
    >>> cursor.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
    >>> cursor.fetchall()
    []
    >>> cursor.executemany(
    ...     'INSERT INTO test (x) VALUES',
    ...     [{'x': 100}]
    ... )
    >>> cursor.rowcount
    1
    >>> cursor.executemany('INSERT INTO test (x) VALUES', [[200]])
    >>> cursor.rowcount
    1
    >>> cursor.execute(
    ...     'INSERT INTO test (x) '
    ...     'SELECT * FROM system.numbers LIMIT %(limit)s',
    ...     {'limit': 3}
    ... )
    >>> cursor.rowcount
    0
    >>> cursor.execute('SELECT sum(x) FROM test')
    >>> cursor.fetchall()
    [(303,)]

License

ClickHouse Python Driver is distributed under the MIT license <http://www.opensource.org/licenses/mit-license.php>_.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].