{"id":13695802,"url":"https://github.com/xzkostyan/clickhouse-sqlalchemy","last_synced_at":"2025-10-20T16:10:54.821Z","repository":{"id":37733319,"uuid":"86639356","full_name":"xzkostyan/clickhouse-sqlalchemy","owner":"xzkostyan","description":"ClickHouse dialect for SQLAlchemy","archived":false,"fork":false,"pushed_at":"2024-05-16T08:29:04.000Z","size":580,"stargazers_count":398,"open_issues_count":72,"forks_count":116,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-05-17T09:01:57.054Z","etag":null,"topics":["clickhouse","database","dialect","sqlalchemy","yandex"],"latest_commit_sha":null,"homepage":"https://clickhouse-sqlalchemy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xzkostyan.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"xzkostyan"}},"created_at":"2017-03-29T23:45:58.000Z","updated_at":"2024-06-10T09:25:55.280Z","dependencies_parsed_at":"2023-09-28T21:46:21.164Z","dependency_job_id":"b1117022-3dda-4924-be54-e141428391e7","html_url":"https://github.com/xzkostyan/clickhouse-sqlalchemy","commit_stats":{"total_commits":302,"total_committers":53,"mean_commits":5.69811320754717,"dds":"0.32450331125827814","last_synced_commit":"0417590bfb0e014deb73dc45e9780ff222f4c82d"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xzkostyan%2Fclickhouse-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xzkostyan%2Fclickhouse-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xzkostyan%2Fclickhouse-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xzkostyan%2Fclickhouse-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xzkostyan","download_url":"https://codeload.github.com/xzkostyan/clickhouse-sqlalchemy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223910048,"owners_count":17223591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clickhouse","database","dialect","sqlalchemy","yandex"],"created_at":"2024-08-02T18:00:33.645Z","updated_at":"2025-10-20T16:10:49.770Z","avatar_url":"https://github.com/xzkostyan.png","language":"Python","funding_links":["https://patreon.com/xzkostyan"],"categories":["Language bindings"],"sub_categories":["Python"],"readme":"ClickHouse SQLAlchemy\n=====================\n\nClickHouse dialect for SQLAlchemy to `ClickHouse database \u003chttps://clickhouse.yandex/\u003e`_.\n\n\n.. image:: https://img.shields.io/pypi/v/clickhouse-sqlalchemy.svg\n    :target: https://pypi.org/project/clickhouse-sqlalchemy\n\n.. image:: https://coveralls.io/repos/github/xzkostyan/clickhouse-sqlalchemy/badge.svg?branch=master\n    :target: https://coveralls.io/github/xzkostyan/clickhouse-sqlalchemy?branch=master\n\n.. image:: https://img.shields.io/pypi/l/clickhouse-sqlalchemy.svg\n    :target: https://pypi.org/project/clickhouse-sqlalchemy\n\n.. image:: https://img.shields.io/pypi/pyversions/clickhouse-sqlalchemy.svg\n    :target: https://pypi.org/project/clickhouse-sqlalchemy\n\n.. image:: https://img.shields.io/pypi/dm/clickhouse-sqlalchemy.svg\n    :target: https://pypi.org/project/clickhouse-sqlalchemy\n\n.. image:: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml/badge.svg\n   :target: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml\n\n\nDocumentation\n=============\n\nDocumentation is available at https://clickhouse-sqlalchemy.readthedocs.io.\n\n\nUsage\n=====\n\nSupported interfaces:\n\n- **native** [recommended] (TCP) via `clickhouse-driver \u003chttps://github.com/mymarilyn/clickhouse-driver\u003e`\n- **async native** (TCP) via `asynch \u003chttps://github.com/long2ice/asynch\u003e`\n- **http** via requests\n\nDefine table\n\n    .. code-block:: python\n\n        from sqlalchemy import create_engine, Column, MetaData\n\n        from clickhouse_sqlalchemy import (\n            Table, make_session, get_declarative_base, types, engines\n        )\n\n        uri = 'clickhouse+native://localhost/default'\n\n        engine = create_engine(uri)\n        session = make_session(engine)\n        metadata = MetaData(bind=engine)\n\n        Base = get_declarative_base(metadata=metadata)\n\n        class Rate(Base):\n            day = Column(types.Date, primary_key=True)\n            value = Column(types.Int32)\n\n            __table_args__ = (\n                engines.Memory(),\n            )\n\n        Rate.__table__.create()\n\n\nInsert some data\n\n    .. code-block:: python\n\n        from datetime import date, timedelta\n\n        from sqlalchemy import func\n\n        today = date.today()\n        rates = [\n            {'day': today - timedelta(i), 'value': 200 - i}\n            for i in range(100)\n        ]\n\n\nAnd query inserted data\n\n    .. code-block:: python\n\n        session.execute(Rate.__table__.insert(), rates)\n\n        session.query(func.count(Rate.day)) \\\n            .filter(Rate.day \u003e today - timedelta(20)) \\\n            .scalar()\n\n\nLicense\n=======\n\nClickHouse SQLAlchemy is distributed under the `MIT license\n\u003chttp://www.opensource.org/licenses/mit-license.php\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxzkostyan%2Fclickhouse-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxzkostyan%2Fclickhouse-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxzkostyan%2Fclickhouse-sqlalchemy/lists"}