From c681ec19efa502cb497a2c0fa8ec3fb6b1471d70 Mon Sep 17 00:00:00 2001 From: cpcchengt Date: Sun, 4 Aug 2024 20:29:51 +0800 Subject: [PATCH] docs: readme Signed-off-by: cpcchengt --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- README_CN.md | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 08094d3..12babe1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,40 @@ # 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: + +The example code use the dot import, but the user should choose the package import method according to their own needs + +```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) +``` diff --git a/README_CN.md b/README_CN.md index 18caf19..1bdfe90 100644 --- a/README_CN.md +++ b/README_CN.md @@ -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+ + +## 用法 + +引入客户端库: + +示例使用点引用法,用户可结合具体需要选择适合的引用方式。 + +```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) +```