Skip to content

Commit 8e8e727

Browse files
authored
Chinese readme (#29)
* Add chinese readme * Add link
1 parent d36b5db commit 8e8e727

File tree

2 files changed

+109
-11
lines changed

2 files changed

+109
-11
lines changed

README-zh.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<div align="center">
2+
<img src="docs/_static/snake-chdb.png" height="100">
3+
</div>
4+
5+
[![构建状态](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml/badge.svg?branch=pybind)](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml)
6+
[![PyPI](https://img.shields.io/pypi/v/chdb.svg)](https://pypi.org/project/chdb/)
7+
[![月度下载量](https://pepy.tech/badge/chdb/month)](https://pepy.tech/project/chdb)
8+
[![Discord](https://img.shields.io/discord/1098133460310294528?logo=Discord)](https://discord.gg/Njw5YXSPPc)
9+
[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Twitter)](https://twitter.com/auxten)
10+
11+
# chDB
12+
13+
[English](README.md)
14+
15+
> chDB 是一个由 ClickHouse 驱动的嵌入式 SQL OLAP 引擎
16+
17+
18+
## 特点
19+
20+
* 嵌入在 Python 中的 SQL OLAP 引擎,由 ClickHouse 驱动
21+
* 不需要安装 ClickHouse
22+
* 支持 Parquet、CSV、JSON、Arrow、ORC 和其他 60 多种格式的[输入输出](https://clickhouse.com/docs/en/interfaces/formats)[示例](tests/format_output.py)
23+
24+
## 架构
25+
<div align="center">
26+
<img src="docs/_static/arch-chdb.png" width="700">
27+
</div>
28+
29+
## 安装方式
30+
目前,chDB 只支持在 macOS(x86_64 和 ARM64)和 Linux 上的 Python 3.7+。
31+
```bash
32+
pip install chdb
33+
```
34+
35+
## 用法
36+
37+
### 在命令行中运行
38+
> `python3 -m chdb SQL [OutputFormat]`
39+
```bash
40+
python3 -m chdb "SELECT 1,'abc'" Pretty
41+
```
42+
43+
目前,chDB 仅支持 `query` 函数,用于执行 SQL 并返回所需格式的数据。
44+
45+
```python
46+
import chdb
47+
res = chdb.query('select version()', 'Pretty'); print(res.data())
48+
```
49+
50+
### 使用 Parquet 或 CSV
51+
```python
52+
# 查看更多数据类型格式,请参见 tests/format_output.py
53+
res = chdb.query('select * from file("data.parquet", Parquet)', 'JSON'); print(res.data())
54+
# 对于大型数据结果,get_memview() 更快,因为它不需要额外的数据复制。
55+
res = chdb.query('select * from file("data.csv", CSV)', 'CSV'); print(str(res.get_memview().tobytes()))
56+
```
57+
58+
### Pandas DataFrame 输出
59+
```python
60+
# 更多内容请参见 https://clickhouse.com/docs/en/interfaces/formats
61+
chdb.query('select * from file("data.parquet", Parquet)', 'Dataframe')
62+
```
63+
64+
## 演示和示例
65+
66+
- [示例目录](examples)
67+
- [Server Less查询演示](https://chdb.fly.dev/?user=default#Ly8gaHR0cHM6Ly9naXRodWIuY29tL21ldHJpY28vY2hkYi1zZXJ2ZXIKU0VMRUNUCiAgICB0b3duLAogICAgZGlzdHJpY3QsCiAgICBjb3VudCgpIEFTIGMsCiAgICByb3VuZChhdmcocHJpY2UpKSBBUyBwcmljZQpGUk9NIHVybCgnaHR0cHM6Ly9kYXRhc2V0cy1kb2N1bWVudGF0aW9uLnMzLmV1LXdlc3QtMy5hbWF6b25hd3MuY29tL2hvdXNlX3BhcnF1ZXQvaG91c2VfMC5wYXJxdWV0JykKR1JPVVAgQlkKICAgIHRvd24sCiAgICBkaXN0cmljdApMSU1JVCAxMA==)
68+
69+
## 基准测试
70+
71+
- [嵌入式引擎的 ClickBench](https://benchmark.clickhouse.com/#eyJzeXN0ZW0iOnsiQXRoZW5hIChwYXJ0aXRpb25lZCkiOnRydWUsIkF0aGVuYSAoc2luZ2xlKSI6dHJ1ZSwiQXVyb3JhIGZvciBNeVNRTCI6dHJ1ZSwiQXVyb3JhIGZvciBQb3N0Z3JlU1FMIjp0cnVlLCJCeXRlSG91c2UiOnRydWUsImNoREIiOnRydWUsIkNpdHVzIjp0cnVlLCJjbGlja2hvdXNlLWxvY2FsIChwYXJ0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wiOnRydWUsIjNYTCI6dHJ1ZSwiNFhMIjp0cnVlLCJYTCI6dHJ1ZX0sImNsdXN0ZXJfc2l6ZSI6eyIxIjp0cnVlLCIyIjp0cnVlLCI0Ijp0cnVlLCI4Ijp0cnVlLCIxNiI6dHJ1ZSwiMzIiOnRydWUsIjY0Ijp0cnVlLCIxMjgiOnRydWUsInNlcnZlcmxlc3MiOnRydWUsInVuZGVmaW5lZCI6dHJ1ZX0sIm1ldHJpYyI6ImhvdCIsInF1ZXJpZXMiOlt0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlLHRydWUsdHJ1ZSx0cnVlXX0=)
72+
73+
## 文档
74+
- 关于 SQL 语法,请参考 [ClickHouse SQL 参考](https://clickhouse.com/docs/en/sql-reference/syntax)
75+
76+
## 贡献
77+
贡献是使开源社区成为一个学习、激励和创造的绝佳场所的原因。您做出的任何贡献都将受到**高度赞赏**
78+
以下是您可以提供帮助的事项:
79+
- [ ] 帮助我支持 Windows 平台,我不太了解 Windows 工具链。
80+
- [x] Python 包装器目前只有一个 `query` 函数。我想添加更多函数,以使其使用更加方便,比如 `toPandas``toNumpy` 等等。
81+
82+
## 版权信息
83+
AGPL-v3.0 或商业许可证,请查看 [LICENSE](LICENSE.txt) 获取更多信息。
84+
85+
## 鸣谢
86+
chDB 主要基于 [ClickHouse](https://github.com/ClickHouse/ClickHouse)。由于商标和其他原因,我将其命名为 chDB。
87+
88+
## 联系方式
89+
- 知乎: [@auxten](https://www.zhihu.com/people/auxten)
90+
- Discord:https://discord.gg/nqSkfJRR
91+
- 电子邮件:[email protected]
92+
- Twitter:[@auxten](https://twitter.com/auxten)

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
<img src="docs/_static/snake-chdb.png" height="100">
44
</div>
55

6-
[![Build](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml)
6+
[![Build](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml/badge.svg?branch=pybind)](https://github.com/auxten/chdb/actions/workflows/build_wheels.yml)
77
[![PyPI](https://img.shields.io/pypi/v/chdb.svg)](https://pypi.org/project/chdb/)
88
[![Monthly Downloads](https://pepy.tech/badge/chdb/month)](https://pepy.tech/project/chdb)
9+
[![Discord](https://img.shields.io/discord/1098133460310294528?logo=Discord)](https://discord.gg/Njw5YXSPPc)
910
[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Twitter)](https://twitter.com/auxten)
1011

1112
# chDB
1213

13-
> chDB is an in-process SQL OLAP Engine powered by ClickHouse
14+
[中文](README-zh.md)
15+
16+
> chDB is an embedded SQL OLAP Engine powered by ClickHouse
1417
1518

1619
## Features
1720
1821
* In-process SQL OLAP Engine, powered by ClickHouse
1922
* No need to install ClickHouse
2023
* Minimized data copy from C++ to Python with [python memoryview](https://docs.python.org/3/c-api/memoryview.html)
21-
* Input&Output support Parquet, CSV, JSON, Arrow, ORC and [more](https://clickhouse.com/docs/en/interfaces/formats)
24+
* Input&Output support Parquet, CSV, JSON, Arrow, ORC and 60+[more](https://clickhouse.com/docs/en/interfaces/formats) formats, [samples](tests/format_output.py)
2225

2326
## Arch
2427
<div align="center">
@@ -33,32 +36,36 @@ pip install chdb
3336

3437
## Usage
3538

39+
### Run in command line
40+
> `python3 -m chdb SQL [OutputFormat]`
41+
```bash
42+
python3 -m chdb "SELECT 1,'abc'" Pretty
43+
```
44+
3645
Currently, chDB only supports `query` function, which is used to execute SQL and return desired format data.
3746

3847
```python
3948
import chdb
4049
res = chdb.query('select version()', 'Pretty'); print(res.data())
4150
```
4251

43-
### work with Parquet or CSV
52+
### Work with Parquet or CSV
4453
```python
4554
# See more data type format in tests/format_output.py
46-
res = chdb.query('select * from file("data.parquet", Parquet)', 'JSON'); print(res.get_memview().tobytes().decode("utf-8"))
55+
res = chdb.query('select * from file("data.parquet", Parquet)', 'JSON'); print(res.data())
4756
# With large data result, get_memview() is more quickly cos it does not do an extra data copy.
4857
res = chdb.query('select * from file("data.csv", CSV)', 'CSV'); print(str(res.get_memview().tobytes()))
4958
```
5059

51-
### pandas dataframe output
60+
### Pandas dataframe output
5261
```python
53-
# Input type and output type support may different.
5462
# See more in https://clickhouse.com/docs/en/interfaces/formats
5563
chdb.query('select * from file("data.parquet", Parquet)', 'Dataframe')
5664
```
5765

58-
more examples, please refer to [examples](examples)
59-
60-
## Demos
66+
## Demos and Examples
6167

68+
- [Examples](examples)
6269
- [Serverless Query Demo](https://chdb.fly.dev/?user=default#Ly8gaHR0cHM6Ly9naXRodWIuY29tL21ldHJpY28vY2hkYi1zZXJ2ZXIKU0VMRUNUCiAgICB0b3duLAogICAgZGlzdHJpY3QsCiAgICBjb3VudCgpIEFTIGMsCiAgICByb3VuZChhdmcocHJpY2UpKSBBUyBwcmljZQpGUk9NIHVybCgnaHR0cHM6Ly9kYXRhc2V0cy1kb2N1bWVudGF0aW9uLnMzLmV1LXdlc3QtMy5hbWF6b25hd3MuY29tL2hvdXNlX3BhcnF1ZXQvaG91c2VfMC5wYXJxdWV0JykKR1JPVVAgQlkKICAgIHRvd24sCiAgICBkaXN0cmljdApMSU1JVCAxMA==)
6370

6471
## Benchmark
@@ -71,7 +78,6 @@ more examples, please refer to [examples](examples)
7178
## Contributing
7279
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
7380
There are something you can help:
74-
- Report bugs on [GitHub Issues](https://github.com/auxten/chdb/issues).
7581
- [ ] Help me with Windows support, I don't know much about Windows toolchain.
7682
- [x] The Python Wrapper just have a `query` function. I want to add more functions to make it more convenient to use. like `toPandas`, `toNumpy` and so on.
7783

0 commit comments

Comments
 (0)