{"id":19331992,"url":"https://github.com/tikv/client-py","last_synced_at":"2026-02-25T20:33:41.378Z","repository":{"id":37422034,"uuid":"311682575","full_name":"tikv/client-py","owner":"tikv","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-03T13:47:22.000Z","size":113,"stargazers_count":29,"open_issues_count":5,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-10-08T02:59:58.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-10T14:24:10.000Z","updated_at":"2025-07-29T23:10:53.000Z","dependencies_parsed_at":"2025-06-23T10:44:17.422Z","dependency_job_id":null,"html_url":"https://github.com/tikv/client-py","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tikv/client-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fclient-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fclient-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fclient-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fclient-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikv","download_url":"https://codeload.github.com/tikv/client-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fclient-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29838125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T19:08:47.527Z","status":"ssl_error","status_checked_at":"2026-02-25T18:59:04.705Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:43:23.357Z","updated_at":"2026-02-25T20:33:41.362Z","avatar_url":"https://github.com/tikv.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TiKV Client (Python)\n\n![Publish](https://github.com/tikv/client-py/workflows/Publish/badge.svg)\n\nThis library is a TiKV client in Python; it supports both synchronous and asynchronous API.\n\nIt's built on top of\n[TiKV Client in Rust](https://github.com/tikv/client-rust) via\nCFFI and [PyO3 Python binding](https://github.com/PyO3/pyo3).\n\nThis client is still in the stage of prove-of-concept and under heavy development.\n\n## Install\n\nThis package requires Python 3.6+ and pip 19+. Currently only supports MacOS (x86_64 and aarch64) and Linux in x86_64 with GLibc \u003e= 2.12.\n\n```\npip3 install tikv-client\n```\n\n## Install (Development)\n\n```\n\u003e pip3 install maturin\n\n\u003e maturin build\n🍹 Building a mixed python/rust project\n🔗 Found pyo3 bindings\n🐍 Found CPython 3.8 at python3.8\n📦 Built source distribution to /home/andy/Code/client-py/target/wheels/tikv_client-0.1.0.tar.gz\n    Blocking waiting for file lock on build directory\n   Compiling pyo3 v0.12.3\n   Compiling tikv-client v0.1.0 (/home/andy/Code/client-py)\n    Finished dev [unoptimized + debuginfo] target(s) in 17.62s\n📦 Built wheel for CPython 3.8 to /home/andy/Code/client-py/target/wheels/tikv_client-0.1.0-cp38-cp38-manylinux1_x86_64.whl\n\n\u003e pip3 install target/wheels/tikv_client-0.1.0-cp38-cp38-manylinux1_x86_64.whl\nInstalling collected packages: tikv-client\nSuccessfully installed tikv-client-0.1.0\n```\n\n## Example\n\nPython TiKV client is synchronous by defult:\n\n```python\nfrom tikv_client import TransactionClient\n\nclient = TransactionClient.connect(\"127.0.0.1:2379\")\n\ntxn = client.begin(pessimistic=True)\ntxn.put(b\"k1\", b\"v1\")\ntxn.put(b\"k2\", b\"v2\")\ntxn.put(b\"k3\", b\"v3\")\ntxn.put(b\"k4\", b\"v4\")\ntxn.put(b\"k5\", b\"v5\")\ntxn.commit()\n\nsnapshot = client.snapshot(client.current_timestamp())\nprint(snapshot.get(b\"k3\"))\nprint(snapshot.batch_get([b\"k1\", b\"k4\"]))\n\nfor k, v in snapshot.scan(b\"k1\", end=None, limit=10, include_start=False):\n    print(k, v)\n```\n\nAsynchronous client is available in `tikv_client.asynchronous` module. Modules and classes under this modules is similar to the synchronous ones.\n\n```python\nimport asyncio\nfrom tikv_client.asynchronous import TransactionClient\n\nasync def main():\n    client = await TransactionClient.connect(\"127.0.0.1:2379\")\n\n    txn = await client.begin(pessimistic=True)\n    await txn.put(b\"k1\", b\"v1\")\n    await txn.put(b\"k2\", b\"v2\")\n    await txn.put(b\"k3\", b\"v3\")\n    await txn.put(b\"k4\", b\"v4\")\n    await txn.put(b\"k5\", b\"v5\")\n    await txn.commit()\n\n    snapshot = client.snapshot(await client.current_timestamp())\n    print(await snapshot.get(b\"k3\"))\n    print(await snapshot.batch_get([b\"k1\", b\"k4\"]))\n\n    for k, v in await snapshot.scan(b\"k1\", end=None, limit=10, include_start=False):\n        print(k, v)\n\nevent_loop = asyncio.get_event_loop()\nasyncio.get_event_loop().run_until_complete(main())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fclient-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikv%2Fclient-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fclient-py/lists"}