Read ClickHouse Cluster Data To Pandas/Polars DataFrame
Project description
yck
请求 clickhouse集群,结果返回pandas.DataFrame/polars.DataFrame
安装
pip install -U clickhouse_df
示例
import clickhouse_df
# 集群配置
config = dict(
urls=["<host1>:<port>", "<host2>:<port>", ....],
user="<user_name>",
password="xxxxxx",
)
sql = "select * from <db_name>.<tb_name> where date='2024-10-23';"
# 例子1
with clickhouse_df.connect(**config):
# 请求 polars
df_pl = clickhouse_df.to_polars(sql)
# 请求 pandas
df_pd = clickhouse_df.to_pandas(sql)
# 例子2
conn = clickhouse_df.connect(**config)
df_pl = clickhouse_df.to_polars(sql, conn)
df_pd = clickhouse_df.to_pandas(sql, conn)
conn.disconnect()
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
clickhouse_df-0.0.0.tar.gz
(40.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clickhouse_df-0.0.0.tar.gz.
File metadata
- Download URL: clickhouse_df-0.0.0.tar.gz
- Upload date:
- Size: 40.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36e47950fb13ec90450012f3b9e9ec246e60845eed909adcadcf8f751be93f00
|
|
| MD5 |
8427439c5951e9ee11a4d019647ade9d
|
|
| BLAKE2b-256 |
21e9f834ff6b9d540c4c2d641a1836abad3abf3bf1287f2026add97e90efbb3a
|
File details
Details for the file clickhouse_df-0.0.0-py3-none-any.whl.
File metadata
- Download URL: clickhouse_df-0.0.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f61cfe635d68826fc7b0aa1b912d0362bf29c51722431a92dbd7c85a16475126
|
|
| MD5 |
eb5b3a47789585c4d58aa27e170954a4
|
|
| BLAKE2b-256 |
f83dc60a905a98c0a16353dbf8e7152b456583250255d85a5ae150f45548cbcf
|