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()
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.4.tar.gz
(17.1 kB
view hashes)
Built Distribution
Close
Hashes for async_etcd3gw-0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52c4b2b5ee1f7685df8a7c5ef9499d5774de8acf9ce4c63c0401e1b79ee8145 |
|
MD5 | cfe5f64b0e089d902c5d0681df650033 |
|
BLAKE2b-256 | f1e9c9da16244a04b74836cf9ffa4841c33dd6e6ada82d78b3d3478f965e5e7b |