Skip to main content

ClickHouse SQLAlchemy Dialect with timezone support

Project description


add timezone support


The package is installable through PIP:

pip install sqlalchemy-clickhouse-timezone


setting the environ param to start timezone support

default is ‘0’ using pytz.utc

‘CLICKHOUSE_USE_TIMEZONE’: ‘0’ => using utc

‘CLICKHOUSE_USE_TIMEZONE’: ‘1’ => using system timezone

‘CLICKHOUSE_USE_TIMEZONE’: ‘Asia/Shanghai’ => using configed Asian/Shanghai


os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘0’)

os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘1’)

os.environ.setdefault(‘CLICKHOUSE_USE_TIMEZONE’, ‘Asia/Shanghai’)


original project usage…

ClickHouse dialect for SQLAlchemy.

The DSN format is similar to that of regular Postgres:

>>> import sqlalchemy as sa
>>> sa.create_engine('clickhouse://username:password@hostname:port/database')

It implements a dialect, so there’s no user-facing API.


The dialect can be registered on runtime if you don’t want to install it as:

from sqlalchemy.dialects import registry
registry.register("clickhouse", "base", "dialect")

Project details

Download files

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

Files for sqlalchemy-clickhouse-timezone, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size sqlalchemy_clickhouse_timezone-0.1.4.tar.gz (13.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page