Skip to main content

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.

Build Status PyPI version PyPI License: Apache 2 Code style: black

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.2.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

async_etcd3gw-0.2-py2.py3-none-any.whl (17.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file async_etcd3gw-0.2.tar.gz.

File metadata

  • Download URL: async_etcd3gw-0.2.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.9.6 requests/2.28.2 setuptools/67.6.1 requests-toolbelt/0.10.1 tqdm/4.65.0 CPython/3.9.16

File hashes

Hashes for async_etcd3gw-0.2.tar.gz
Algorithm Hash digest
SHA256 1bb2ed8ba9459192b1fe53bcd433f5e03bb2b1d80d80492212a5c883c75d6d5d
MD5 bf477ca9fc77c4dd4d884645ae6e757e
BLAKE2b-256 eee975ce78038c4d941a91994490528517fd4c9fbf0cdfaa749d6856061e01c7

See more details on using hashes here.

File details

Details for the file async_etcd3gw-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: async_etcd3gw-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.9.6 requests/2.28.2 setuptools/67.6.1 requests-toolbelt/0.10.1 tqdm/4.65.0 CPython/3.9.16

File hashes

Hashes for async_etcd3gw-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2c2e66179626aface8c17535ffbef5dfc2472c6bb7077dfc88370f02ad299ac8
MD5 80a9d5aa34d73d36b4b0a6c76c2c1ab7
BLAKE2b-256 00134f130ad27e463d82fc2d3d87183e27ac2882b552a3c5413e63c52c216a0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page