Converting ClickHouse types into other schemas' types
Project description
ClickHouse-Types
Converting ClickHouse types into other schemas' types
Installation
pip install clickhouse-types
Usage
PyArrow
from clickhouse_types.pyarrow import dtype_from_string
dtype_from_string('Array(DateTime64(9, Asia/Shanghai))')
>>> list<item: timestamp[ns, tz=Asia/Shanghai]>
from clickhouse_types.pyarrow import field_from_string
field_from_string('HelloWorld Map(UInt128, DateTime64(9, Asia/Shanghai))')
>>> pyarrow.Field<HelloWorld: map<fixed_size_binary[16], timestamp[ns, tz=Asia/Shanghai]>>
from clickhouse_types.pyarrow import schema_from_string
schema_from_string('Hello FixedString(6), World Tuple(Int8, Int8)')
>>> Hello: fixed_size_binary[6]
>>> World: struct<f1: int8, f2: int8>
>>> child 0, f1: int8
>>> child 1, f2: int8
SQLAlchemy & ClickHouse-SQLAlchemy
from clickhouse_types.sqlalchemy import type_from_string
type_from_string('DateTime64(9,Asia/Shanghai)')
>>> DateTime64(9, 'Asia/Shanghai')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clickhouse_types-0.1.1.tar.gz
.
File metadata
- Download URL: clickhouse_types-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.8.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84a6ec279905512fa967ee7b6ef9f74b5852e37443b07062473ffd5e78882bc |
|
MD5 | 825b12fc57a9aa6021ed96bfef8a1a74 |
|
BLAKE2b-256 | 7a17a027226be8c05834e0dbaa7928321e4141ba82204cab9dbef2dc837317dd |
File details
Details for the file clickhouse_types-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: clickhouse_types-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.8.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8eb97c156394cb643529781aeddb812b4758b457b6173b0293a0ca2b00f046d |
|
MD5 | ad290f385c91584831cab1a35b0bdb85 |
|
BLAKE2b-256 | 45caa482386cde1ea1defe4251bbedba096d1e50fe181119bbc3425e6569437e |