An async Python client for etcd3 grpc-gateway v3 API
Project description
async-etcd3gw
An async etcd3 grpc-gateway v3 API Python client, derived from etcd3gw.
Library Installation
$ pip install async-etcd3gw
Usage
You can find examples in examples folder.
Basic usage example:
import asyncio
from async_etcd3gw import AsyncEtcd3Client
async def main():
client = AsyncEtcd3Client(host="etcd", port=2379)
# Put key
await client.put(key="foo", value="bar")
# Get key
print("get key foo", await client.get(key="foo"))
# Get all keys
print("get all keys", await client.get_all())
# Create lease and use it
lease = await client.lease(ttl=100)
await client.put(key="foo", value="bar", lease=lease)
# Get lease keys
print("get lease keys", await lease.keys())
# Refresh lease
await lease.refresh()
# Release all acquired resources
await client.close()
if __name__ == "__main__":
asyncio.run(main())
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async_etcd3gw-0.6.tar.gz
(17.6 kB
view details)
Built Distribution
File details
Details for the file async_etcd3gw-0.6.tar.gz
.
File metadata
- Download URL: async_etcd3gw-0.6.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.9.6 requests/2.29.0 setuptools/67.7.2 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc4f8d9227e4ec3f749c5b16da74137e3e5e4c05b549715e91fb812148f458c |
|
MD5 | 2ef7c61d02f778d965ae51e0859b1985 |
|
BLAKE2b-256 | d077e5b15e3f0abf88bd9757a3649399051034ff865f6adc45fb61b5b3fbfe98 |
File details
Details for the file async_etcd3gw-0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: async_etcd3gw-0.6-py2.py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.9.6 requests/2.29.0 setuptools/67.7.2 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e817f4860119301cb38f641007da5256bfe98801fd8b14caabf967954ad78e48 |
|
MD5 | fa72aa32738a5f371749c0ea3d752ba7 |
|
BLAKE2b-256 | a7a06ba7929a8daf2e93366ee87fdd1def98144b88e5633aed8c11e3f677b171 |