All Projects → mymarilyn → aioch

mymarilyn / aioch

Licence: other
aioch - is a library for accessing a ClickHouse database over native interface from the asyncio

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aioch

Clickhouse Driver
ClickHouse Python Driver with native interface support
Stars: ✭ 562 (+287.59%)
Mutual labels:  yandex, native, clickhouse, driver
sqlite3
The fastest and correct module for SQLite3 in Deno.
Stars: ✭ 143 (-1.38%)
Mutual labels:  native, driver
Clickhouse Net
Yandex ClickHouse fully managed .NET client
Stars: ✭ 142 (-2.07%)
Mutual labels:  yandex, clickhouse
appmetrica-logsapi-loader
A tool for automatic data loading from AppMetrica LogsAPI into (local) ClickHouse
Stars: ✭ 18 (-87.59%)
Mutual labels:  yandex, clickhouse
Clickhouse Sqlalchemy
ClickHouse dialect for SQLAlchemy
Stars: ✭ 166 (+14.48%)
Mutual labels:  yandex, clickhouse
ryzen smu
A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors. Read only mirror of https://gitlab.com/leogx9r/ryzen_smu
Stars: ✭ 57 (-60.69%)
Mutual labels:  driver
graphql-backend-template-dgraph
Dgraph GraphQL Editor template for backend using very fast dgraph golang database server under the hood
Stars: ✭ 45 (-68.97%)
Mutual labels:  native
phpRebloom
🎛️ Use RedisBloom in PHP!
Stars: ✭ 20 (-86.21%)
Mutual labels:  driver
f1-telemetry-client
A Node UDP client and telemetry parser for Codemaster's Formula 1 series of games
Stars: ✭ 128 (-11.72%)
Mutual labels:  driver
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (-66.21%)
Mutual labels:  yandex
neft
Universal Platform
Stars: ✭ 34 (-76.55%)
Mutual labels:  native
NatsuLang
No description or website provided.
Stars: ✭ 96 (-33.79%)
Mutual labels:  native
tasit-apps
Native mobile Ethereum dapps for mainstream users
Stars: ✭ 35 (-75.86%)
Mutual labels:  native
yadisk
Download file from Yandex.Disk through share link
Stars: ✭ 33 (-77.24%)
Mutual labels:  yandex
OneSTools.EventLog
Библиотеки и готовые инструменты для чтения и экспорта журнала регистрации 1С в ClickHouse и ElasticSearch
Stars: ✭ 96 (-33.79%)
Mutual labels:  clickhouse
mapkit-android-demo
MapKit Android demo
Stars: ✭ 92 (-36.55%)
Mutual labels:  yandex
django-yaturbo
Reusable Django app to enable Yandex Turbo Pages for your site
Stars: ✭ 13 (-91.03%)
Mutual labels:  yandex
one-ck
php tcp client for clickhouse
Stars: ✭ 61 (-57.93%)
Mutual labels:  clickhouse
Android-WebView-in-Kotlin
Native Android WebView Example in Kotlin. Website to android app github open source template.
Stars: ✭ 87 (-40%)
Mutual labels:  native
dynamico
Dynamico allows a remote (web-like) code push work-flow for continuous delivery of specific features native or web.
Stars: ✭ 96 (-33.79%)
Mutual labels:  native

aioch

aioch is a library for accessing a ClickHouse database over native interface from the asyncio. It wraps features of clickhouse-driver for asynchronous usage.

Coverage Status Build Status

Installation

The package can be installed using pip:

pip install aioch

To install from source:

git clone https://github.com/mymarilyn/aioch
cd aioch
python setup.py install

Usage

from datetime import datetime

import asyncio
from aioch import Client


async def exec_progress():
    client = Client('localhost')

    progress = await client.execute_with_progress('LONG AND COMPLICATED QUERY')
    timeout = 20
    started_at = datetime.now()

    async for num_rows, total_rows in progress:
        done = num_rows / total_rows if total_rows else total_rows
        now = datetime.now()
        # Cancel query if it takes more than 20 seconds to process 50% of rows.
        if (now - started_at).total_seconds() > timeout and done < 0.5:
            await client.cancel()
            break
    else:
        rv = await progress.get_result()
        print(rv)


async def exec_no_progress():
    client = Client('localhost')
    rv = await client.execute('LONG AND COMPLICATED QUERY')
    print(rv)


loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait([exec_progress(), exec_no_progress()]))

For more information see clickhouse-driver usage examples.

Parameters

  • executor - instance of custom Executor, if not supplied default executor will be used
  • loop - asyncio compatible event loop

Other parameters are passing to wrapped clickhouse-driver's Client.

License

aioch is distributed under the MIT license.

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].