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

Uploaded Source

Built Distribution

async_etcd3gw-0.3-py2.py3-none-any.whl (18.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: async_etcd3gw-0.3.tar.gz
  • Upload date:
  • Size: 17.1 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.3.tar.gz
Algorithm Hash digest
SHA256 83473da2535fe5a745839d09b9c52c659a8a257033ab9b1441a82b4bf0c8ad08
MD5 b1268b5750a1764fe20483188cba213a
BLAKE2b-256 e4cfbd4775e9ca6405fc774941be0bc2befac65c501b2aa8cf3fdec4ad86786d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: async_etcd3gw-0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.6 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.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7d192d26f88c732c1f8f772e25adea4b369b31719fed3794f108549648c4e3ad
MD5 ab88bc6ed9ed9e649201020986be60ab
BLAKE2b-256 7c56ef614e4af14ac016e66f0c5e3c897aca0c5bf119e6a50d33c00cf9d09bbe

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