Registry / database / etcd-sdk-python

etcd-sdk-python

JSON →
library0.0.7pypypiunverified

etcd-sdk-python is a Python client for the etcd v3 API, supporting Python versions >= 3.8. It provides a simple interface for interacting with etcd, a distributed reliable key-value store. The library is actively maintained with minor releases focusing on enhancements and dependency updates.

pip install etcd-sdk-python
INSTALL
IMPORT
SIG · ETCD-SDK-PYTHON
E
etcd-sdk-python
databasepythonv0.0.7
Install
2.6s avg
Import
Disk
35MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 38.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 36MB
35MB installed
● package 35MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from pyetcd import Client
from pyetcd import Client

This quickstart demonstrates how to connect to an etcd server, and perform basic put, get, and delete operations. It includes error handling for connection issues.

from etcd_sdk import Client import os # Configure etcd connection (use environment variables for production) host = os.environ.get('ETCD_HOST', '127.0.0.1') port = int(os.environ.get('ETCD_PORT', 2379)) # Establish connection try: client = Client(host=host, port=port) print(f"Connected to etcd at {host}:{port}") # Put a key-value pair key = 'mykey' value = 'myvalue' client.put(key=key, value=value) print(f"Put '{key}': '{value}'") # Get a key-value pair retrieved_value, meta = client.get(key=key) print(f"Get '{key}': value='{retrieved_value}', revision={meta.revision}") # Delete a key client.delete(key=key) print(f"Deleted '{key}'") # Try to get after deletion deleted_value, deleted_meta = client.get(key=key) print(f"Get '{key}' after deletion: value='{deleted_value}', revision={deleted_meta.revision}") # Value will be empty/None except Exception as e: print(f"An error occurred: {e}") print("Please ensure an etcd server is running at the specified host and port.")
Debug
Known issues
gotchaThe import path for the library is `etcd_sdk` (with an underscore) despite the PyPI package name being `etcd-sdk-python` (with a hyphen). Using `from etcd_sdk_python import Client` will result in a `ModuleNotFoundError`.
fix
Always use `from etcd_sdk import Client` for importing the main client.
affects: All versions
breakingThis library is designed exclusively for the etcd v3 API. Attempting to connect to an etcd v2 server or use v2 API methods (e.g., `client.read()`, `client.write()`) will result in connection failures or `AttributeError`.
fix
Ensure your etcd server is running version 3.x. Refer to the etcd documentation for migration from v2 to v3 if necessary.
affects: All versions
gotchaPotential `grpcio` version conflicts. The library specifies a compatible `grpcio` version range, but conflicts can arise if other dependencies require a different, incompatible version.
fix
Use a virtual environment to manage dependencies. If conflicts occur, try upgrading or downgrading `grpcio` and `protobuf` to versions within the specified ranges, or using `pip install --no-deps etcd-sdk-python` and manually installing compatible `grpcio` and `protobuf`.
affects: All versions
gotchaFor robust applications, proper connection management and error handling are crucial. `etcd-sdk-python` uses gRPC, and network issues or server unavailability can lead to `_InactiveRpcError` or `grpc.RpcError`.
fix
Implement retry logic for transient errors and ensure your etcd server is accessible. Consider using `try-except` blocks around etcd operations, specifically catching `grpc.RpcError`.
affects: All versions
Upgrade
Version history
0.0.7latest on PyPI · released Aug 4, 2025
Audit
Dependencies
grpciorequiredCore dependency for gRPC communication with etcd server.
grpcio-toolsrequiredUsed for gRPC code generation, often installed with the client.
protobufrequiredProtocol Buffers are used for serializing structured data in gRPC.
Agent activity
22 hits · last 30 days
node
20
Resources
etcd-sdk-python — pip install etcd-sdk-python · libregistry