Skip to main content

A Python framework that translates Python code into ClickHouse operations for big data computing

Project description

aaiclick

A Python framework that translates Python code into ClickHouse operations for big data computing.

Overview

aaiclick provides a Python API for big data computing backed by ClickHouse. Data lives in ClickHouse as columnar tables; Python code orchestrates operations — arithmetic, filtering, aggregation, joins — that execute as ClickHouse queries. An orchestration layer (Airflow-inspired) manages task dependencies and scheduling, while the Object API (Pandas/SQLAlchemy-inspired) keeps the interface familiar. Runs locally with embedded chdb + SQLite, or scales out with remote ClickHouse + PostgreSQL.

Installation

The base install includes embedded chdb and SQLite — no external servers needed:

pip install aaiclick
python -m aaiclick setup

For a distributed deployment (remote ClickHouse server + PostgreSQL):

pip install "aaiclick[distributed]"

For AI features (lineage tracing, debug agents):

pip install "aaiclick[ai]"
# or all extras:
pip install "aaiclick[all]"

Orchestration

Define tasks and jobs with decorators — all data operations execute as ClickHouse queries:

from aaiclick import create_object_from_value
from aaiclick.orchestration import job, task

@task
async def load_sales():
    return await create_object_from_value({
        "region": ["US", "EU", "US", "EU", "US"],
        "amount": [500, 300, 150, 200, 80],
    })

@task
async def analyze(sales):
    # GROUP BY + SUM — runs as a single ClickHouse query
    by_region = await sales.group_by("region").sum("amount")
    print(await by_region.data())  # → {'region': ['EU', 'US'], 'amount': [500, 730]}

    # append rows without leaving ClickHouse
    await sales.insert({"region": ["JP"], "amount": [400]})

@job("sales_pipeline")
def sales_pipeline():
    sales = load_sales()
    # dependencies resolved from arguments
    result = analyze(sales=sales)
    return result

if __name__ == "__main__":
    from aaiclick.orchestration import job_test
    job_test(sales_pipeline)  # runs all tasks locally for debugging
python sales_pipeline.py

Data Operation Only Mode

Use data_context() directly for interactive work without orchestration:

import asyncio
from aaiclick import create_object_from_value
from aaiclick.data.data_context import data_context

async def main():
    async with data_context():
        prices = await create_object_from_value([10.0, 20.0, 30.0])

        total = await (prices + prices * 0.1)  # scalars broadcast automatically
        print(await total.data())  # → [11.0, 22.0, 33.0]
        print(await (await total.mean()).data())  # → 22.0

asyncio.run(main())

Documentation

aaiclick.readthedocs.io

License

MIT License - see LICENSE for details.

Project details


Download files

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

Source Distribution

aaiclick-0.0.9.tar.gz (580.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aaiclick-0.0.9-py3-none-any.whl (338.8 kB view details)

Uploaded Python 3

File details

Details for the file aaiclick-0.0.9.tar.gz.

File metadata

  • Download URL: aaiclick-0.0.9.tar.gz
  • Upload date:
  • Size: 580.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aaiclick-0.0.9.tar.gz
Algorithm Hash digest
SHA256 91b6f0c5da777ae7e4f0aa5efee873225bf50f33832f5b1248592dc601528e53
MD5 7c33c6c598b11861df828ee060646928
BLAKE2b-256 049b0a12fd2d3e36054b25221fcb229867f142cb6b3691197b09dbbb0cf77e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for aaiclick-0.0.9.tar.gz:

Publisher: publish.yaml on kolodkin/aaiclick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aaiclick-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: aaiclick-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 338.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aaiclick-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d912481cef48dff03041f12ec87282b770111a5daca4d14d9506fbfc51417521
MD5 7b1adb4d6a07b6c7fa52713cdac25502
BLAKE2b-256 2bba0f54602c27416899cbde1e3800cd3f2e50d50d9961084af2d0597741aa7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aaiclick-0.0.9-py3-none-any.whl:

Publisher: publish.yaml on kolodkin/aaiclick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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