Skip to content

Latest commit

 

History

History
100 lines (82 loc) · 1.98 KB

README.md

File metadata and controls

100 lines (82 loc) · 1.98 KB

py-xline

Apache 2.0 licensed codecov

py-xline is an official xline client sdk, written in Python.

Features

py-xline runs the CURP protocol on the client side for maximal performance.

Supported APIs

  • KV
    • Put
    • Range
    • Delete
    • Txn
    • Compact
  • Auth
    • AuthEnable
    • AuthDisable
    • AuthStatus
    • Authenticate
    • UserAdd
    • UserAddWithOptions
    • UserGet
    • UserList
    • UserDelete
    • UserChangePassword
    • UserGrantRole
    • UserRevokeRole
    • RoleAdd
    • RoleGet
    • RoleList
    • RoleGrantPermission
    • RoleRevokePermission
  • Lease
    • Grant
    • Revoke
    • KeepAlive
    • KeepAliveOnce
    • TimeToLive
    • Leases
  • Watch
    • Watch
  • Lock
    • Lock
    • Unlock
  • Cluster
    • MemberAdd
    • MemberAddAsLearner
    • MemberRemove
    • MemberUpdate
    • MemberList
    • MemberPromote
  • Maintenance
    • Alarm
    • Status
    • Defragment
    • Hash
    • Snapshot
    • MoveLeader

Installation

pip install py-xline

Quickstart

from py_xline 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.

py-xline Xline
v0.1.0 v0.6.1