-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: cpcchengt <[email protected]>
- Loading branch information
Showing
2 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,39 @@ | ||
# opengemini-client-python | ||
|
||
opengemini-client-python is a Python client for OpenGemini. | ||
![License](https://img.shields.io/badge/license-Apache2.0-green) ![Language](https://img.shields.io/badge/Language-Python-blue.svg) [![version](https://img.shields.io/github/v/tag/opengemini/opengemini-client-python?label=release&color=blue)](https://github.com/opengemini/opengemini-client-python/releases) | ||
|
||
Find OpenGemini Client design doc at https://github.com/openGemini/openGemini.github.io/blob/main/src/guide/develop/client_design.md | ||
English | [简体中文](README_CN.md) | ||
|
||
English | [简体中文](README_CN.md) | ||
`opengemini-client-python` is a Python client for OpenGemini | ||
|
||
## Design Doc | ||
|
||
[OpenGemini Client Design Doc](https://github.com/openGemini/openGemini.github.io/blob/main/src/guide/develop/client_design.md) | ||
|
||
## About OpenGemini | ||
|
||
OpenGemini is a cloud-native distributed time series database, find more information [here](https://github.com/openGemini/openGemini) | ||
|
||
## Requirements | ||
|
||
- Python 3.9+ | ||
|
||
## Usage | ||
|
||
Create a Client: | ||
|
||
<i><font color=gray>The example code use the dot import, but the user should choose the package import method according to their own needs</font></i> | ||
|
||
```python | ||
from opengemini_client import Client, Address ,Config, BatchConfig | ||
import datetime | ||
|
||
cfg = Config(address=[Address(host='127.0.0.1', port=8086)], | ||
batch_config=BatchConfig(batch_size=10, batch_interval=10), | ||
timeout=datetime.timedelta(seconds=30), connection_timeout=datetime.timedelta(seconds=10), | ||
gzip_enabled=False, tls_enabled=False | ||
) | ||
|
||
cli = Client(cfg) | ||
cli.ping(0) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,39 @@ | ||
# opengemini-client-python | ||
|
||
opengemini-client-python 是一个用 python 编写的 OpenGemini 客户端。 | ||
![License](https://img.shields.io/badge/开源许可证-Apache2.0-green) ![language](https://img.shields.io/badge/语言-Python-blue.svg) [![release](https://img.shields.io/github/v/tag/opengemini/opengemini-client-python?label=发行版本&color=blue)](https://github.com/opengemini/opengemini-client-python/releases) | ||
|
||
查看OpenGemini客户端设计文档,可点击 https://github.com/openGemini/openGemini.github.io/blob/main/src/zh/guide/develop/client_design.md | ||
[English](README.md) | 简体中文 | ||
|
||
简体中文 | [English](README.md) | ||
`opengemini-client-python` 是一个用 Python 语言编写的 OpenGemini 客户端 | ||
|
||
## 设计文档 | ||
|
||
[OpenGemini Client 设计文档](https://github.com/openGemini/openGemini.github.io/blob/main/src/zh/guide/develop/client_design.md) | ||
|
||
## 关于 OpenGemini | ||
|
||
OpenGemini 是一款云原生分布式时序数据库。获取更多信息,请点击[这里](https://github.com/openGemini/openGemini) | ||
|
||
## 要求 | ||
|
||
- Python 3.9+ | ||
|
||
## 用法 | ||
|
||
引入客户端库: | ||
|
||
<i><font color=gray>示例使用点引用法,用户可结合具体需要选择适合的引用方式。</font></i> | ||
|
||
```python | ||
from opengemini_client import Client, Address ,Config, BatchConfig | ||
import datetime | ||
|
||
cfg = Config(address=[Address(host='127.0.0.1', port=8086)], | ||
batch_config=BatchConfig(batch_size=10, batch_interval=10), | ||
timeout=datetime.timedelta(seconds=30), connection_timeout=datetime.timedelta(seconds=10), | ||
gzip_enabled=False, tls_enabled=False | ||
) | ||
|
||
cli = Client(cfg) | ||
cli.ping(0) | ||
``` |