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()

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

Uploaded Source

Built Distribution

async_etcd3gw-0.7-py2.py3-none-any.whl (19.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: async_etcd3gw-0.7.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.30.0 setuptools/67.7.2 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.9.16

File hashes

Hashes for async_etcd3gw-0.7.tar.gz
Algorithm Hash digest
SHA256 27602d149464519bc79e28a2af2b1be491d297e05e6f87bcab6c53e1b13509a5
MD5 2e962fefaf32835fc79d30fc13fee609
BLAKE2b-256 524a17dc510a757e0587b6e902f2e3951cb407bcba3c13e46ac12123a05dddf6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for async_etcd3gw-0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c189a18272248a06d461522876822500d71f1a30b6e8b08dbad521da9137c8a
MD5 70efebc01d8385456457f23f03111bf8
BLAKE2b-256 7b725fdedc1942e508d6eda31b094a23ce6d49702fab02b30f71c755572f7c03

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