Skip to main content

Library for read and write clickhouse native format.

Project description

NativeLib

Library for working with Clickhouse Native Format

Description of the format on the official website:

The most efficient format. Data is written and read by blocks in binary format.
For each block, the number of rows, number of columns, column names and types,
and parts of columns in this block are recorded one after another. In other words,
this format is “columnar” – it does not convert columns to rows.
This is the format used in the native interface for interaction between servers,
for using the command-line client, and for C++ clients.

You can use this format to quickly generate dumps that can only be read by the ClickHouse DBMS.
It does not make sense to work with this format yourself.

This library allows for data exchange between Clickhouse Native Format and python/pandas.DataFrame/polars.DataFrame.

Unsupported data types (at the moment)

  • Tuple # Tuple(T1, T2, ...).
  • Map # Map(K, V).
  • Variant # Variant(T1, T2, ...).
  • AggregateFunction # (name, types_of_arguments...) — parametric data type.
  • SimpleAggregateFunction # (name, types_of_arguments...) data type stores current value (intermediate state) of the aggregate function.
  • Point # stored as a Tuple(Float64, Float64).
  • Ring # stored as an array of points: Array(Point).
  • LineString # stored as an array of points: Array(Point).
  • MultiLineString # is multiple lines stored as an array of LineString: Array(LineString).
  • Polygon # stored as an array of rings: Array(Ring).
  • MultiPolygon # stored as an array of polygons: Array(Polygon).
  • Expression # used for representing lambdas in high-order functions.
  • Set # Used for the right half of an IN expression.
  • Domains # You can use domains anywhere corresponding base type can be used.
  • Nested # Nested(name1 Type1, Name2 Type2, ...).
  • Dynamic # This type allows to store values of any type inside it without knowing all of them in advance.
  • JSON # Stores JavaScript Object Notation (JSON) documents in a single column.

Supported data types

Clickhouse data type Read Write Python data type (Read/Write)
UInt8 + + int
UInt16 + + int
UInt32 + + int
UInt64 + + int
UInt128 + + int
UInt256 + + int
Int8 + + int
Int16 + + int
Int32 + + int
Int64 + + int
Int128 + + int
Int256 + + int
Float32 + + float
Float64 + + float
BFloat16 + + float
Decimal(P, S) + + decimal.Decimal
String + + str
FixedString(N) + + str
Date + + datetime.date
Date32 + + datetime.date
DateTime + + datetime.datetime
DateTime64 + + datetime.datetime
Time + + datetime.timedelta
Time64 + + datetime.timedelta
Enum + + str/Union[int, enum.Enum, str]
Bool + + bool
UUID + + uuid.UUID
IPv4 + + ipaddress.IPv4Address
IPv6 + + ipaddress.IPv6Address
Array(T) + + list[T*]
LowCardinality(T) + + Union[str,datetime.date,datetime.datetime,int,float]
Nullable(T) + + Optional[T*]
Nothing + + None

*T - any simple data type from those listed in the table

Installation

From pip

pip install nativelib

From local directory

pip install .

From git

pip install git+https://github.com/0xMihalich/nativelib

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

nativelib-0.2.2.3-cp311-cp311-win_amd64.whl (411.2 kB view details)

Uploaded CPython 3.11Windows x86-64

nativelib-0.2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

nativelib-0.2.2.3-cp311-cp311-macosx_11_0_arm64.whl (451.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

nativelib-0.2.2.3-cp311-cp311-macosx_10_14_x86_64.whl (451.9 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

nativelib-0.2.2.3-cp310-cp310-win_amd64.whl (419.8 kB view details)

Uploaded CPython 3.10Windows x86-64

nativelib-0.2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

nativelib-0.2.2.3-cp310-cp310-macosx_11_0_arm64.whl (456.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

nativelib-0.2.2.3-cp310-cp310-macosx_10_14_x86_64.whl (453.9 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

Details for the file nativelib-0.2.2.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0cb1df9108757a678b75e51c11dac1caec174a9950ef4b8a28b4e6f24e1b927d
MD5 fced28488dd021df3c1aa4105f7a72a5
BLAKE2b-256 f5dca5ffe2b0084747817f62b2988c613d6c75da412f305e5199d61d112cc13b

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 044694e598428027aae38e12cfb0fdbd39e79081364a608b3807dbb43f7a6e93
MD5 bc0de9a76705234883b6becd8ba7000d
BLAKE2b-256 800c460064111e217c8793ff70b201b9ed2d5b7ae9341156cc3c2d9ad4879c6b

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dcc35f93870e7916776e4668ea3abbc9b02349594a7fb8dce0fdc4993cd954be
MD5 fd3ec5b05eb150f1f0cbf3361090eace
BLAKE2b-256 17c2688cdb4163587477566ccab3e5653d52c71f44e13c1d72b5e87b05855c4c

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 81a72ec326c2dfce59753c11843607c542ccea7c9352e562070e96c04dc0dba2
MD5 f24921648bc7cadc702b54707162134f
BLAKE2b-256 9eff75d3eac0f110bdf3cd24f9f76e4594a07fd347584abd6ea5b456d48b0981

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 88b98c04d7452038bfddc9d0179d269e7252597e2fe52f4ad6081281105ded6d
MD5 c742004295798c98ccc9803662fd99e4
BLAKE2b-256 f26176ebe1514f99d8b88f8200fdc572592932868075c1e0d6c34f7aacfe19fc

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 729ff72c81defaae128d80a45047ed522dd859a58167dc7bff601a42b7f0af4f
MD5 f08712ce3395b9ece6be4fd7bf90ec91
BLAKE2b-256 a16b1769ad1dd676af1c942d960f621f40d116c0dee66dd181736b51e8bebc9f

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de0990b3fc3a119222529975f5582e3db0f9e83dccd59a91d678a7ee16bddb7d
MD5 08ca60dc5a4f62af6ef3be1a1f4933d0
BLAKE2b-256 1255a7539a6971724f46e49f926ea1e3c79ba449637336a8ab805d738547b71d

See more details on using hashes here.

File details

Details for the file nativelib-0.2.2.3-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.2.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3a7c1f631b3a04b40d79cf8394f190d72ef8e28c83babe40044d0f06e5663347
MD5 31c6113c5430b5d3fe138ea42c8cd2ee
BLAKE2b-256 4ff9c7846b546e8c44a9e8d4c5383481cae4d9733732b70278d51c3391025be8

See more details on using hashes here.

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