From 893659bcfb1c027e868d5de2944f7dcb1e49ead8 Mon Sep 17 00:00:00 2001 From: LingKa Date: Mon, 22 Jan 2024 16:01:08 +0800 Subject: [PATCH] doc: update README for release Signed-off-by: LingKa --- README.md | 102 +++++++++++++++++++++++++++++++++++++++++++- client/__about__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 102 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 84cb391..e0fff96 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,100 @@ -# py-xline -py-xline is an official xline client sdk, written in Python. +# pyxline + +[![Apache 2.0 licensed][apache-badge]][apache-url] +[![codecov][cov-badge]][cov-url] + +[apache-badge]: https://img.shields.io/badge/license-Apache--2.0-brightgreen +[apache-url]: https://github.com/datenlord/Xline/blob/master/LICENSE +[cov-badge]: https://codecov.io/gh/xline-kv/xline/branch/master/graph/badge.svg +[cov-url]: https://codecov.io/gh/xline-kv/go-xline + +pyxline is an official xline client sdk, written in Python. + +## Features + +`pyxline` runs the CURP protocol on the client side for maximal performance. + +## Supported APIs + +- KV + - [x] Put + - [x] Range + - [x] Delete + - [x] Txn + - [x] Compact +- Auth + - [x] AuthEnable + - [x] AuthDisable + - [x] AuthStatus + - [x] Authenticate + - [x] UserAdd + - [x] UserAddWithOptions + - [x] UserGet + - [x] UserList + - [x] UserDelete + - [x] UserChangePassword + - [x] UserGrantRole + - [x] UserRevokeRole + - [x] RoleAdd + - [x] RoleGet + - [x] RoleList + - [x] RoleGrantPermission + - [x] RoleRevokePermission +- Lease + - [x] Grant + - [x] Revoke + - [x] KeepAlive + - [x] KeepAliveOnce + - [x] TimeToLive + - [x] Leases +- Watch + - [x] Watch +- Lock + - [x] Lock + - [x] Unlock +- Cluster + - [ ] MemberAdd + - [ ] MemberAddAsLearner + - [ ] MemberRemove + - [ ] MemberUpdate + - [ ] MemberList + - [ ] MemberPromote +- Maintenance + - [ ] Alarm + - [ ] Status + - [ ] Defragment + - [ ] Hash + - [x] Snapshot + - [ ] MoveLeader + +## Installation + +``` bash +pip install pyxline +``` + +## Quickstart + +``` python +from pyxline import client + +async def main(): + curp_members = ["172.20.0.3:2379", "172.20.0.4:2379", "172.20.0.5:2379"] + cli = await client.Client.connect(curp_members) + kv_client = cli.kv_client + + await kv_client.put(b"key", b"value") + + res = await kv_client.range(b"key") + + kv = res.kvs[0] + print(kv.key.decode(), kv.value.decode()) +``` + +## Compatibility + +We aim to maintain compatibility with each corresponding Xline version, and update this library with each new Xline release. + +| go-xline | Xline | +| --- | --- | +| v0.1.0 | v0.6.1 | diff --git a/client/__about__.py b/client/__about__.py index b950b91..7ecc095 100644 --- a/client/__about__.py +++ b/client/__about__.py @@ -4,4 +4,4 @@ """Xline clients""" -__version__ = "0.0.1" +__version__ = "0.1.0" diff --git a/pyproject.toml b/pyproject.toml index 8fbe928..da9a74b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "py-xline" +name = "pyxline" dynamic = ["version"] description = 'py-xline is an official xline client sdk, written in Python.' readme = "README.md"