{"id":9726,"library":"etcd-sdk-python","title":"etcd-sdk-python Client","description":"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.","status":"active","version":"0.0.7","language":"python","source_language":"en","source_url":"https://github.com/XuanYang-cn/pyetcd","tags":["etcd","key-value store","distributed","grpc","client"],"install":[{"cmd":"pip install etcd-sdk-python","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for gRPC communication with etcd server.","package":"grpcio","optional":false},{"reason":"Used for gRPC code generation, often installed with the client.","package":"grpcio-tools","optional":false},{"reason":"Protocol Buffers are used for serializing structured data in gRPC.","package":"protobuf","optional":false}],"imports":[{"wrong":"from pyetcd import Client","symbol":"Client","correct":"from pyetcd import Client"}],"quickstart":{"code":"from etcd_sdk import Client\nimport os\n\n# Configure etcd connection (use environment variables for production)\nhost = os.environ.get('ETCD_HOST', '127.0.0.1')\nport = int(os.environ.get('ETCD_PORT', 2379))\n\n# Establish connection\ntry:\n    client = Client(host=host, port=port)\n    print(f\"Connected to etcd at {host}:{port}\")\n\n    # Put a key-value pair\n    key = 'mykey'\n    value = 'myvalue'\n    client.put(key=key, value=value)\n    print(f\"Put '{key}': '{value}'\")\n\n    # Get a key-value pair\n    retrieved_value, meta = client.get(key=key)\n    print(f\"Get '{key}': value='{retrieved_value}', revision={meta.revision}\")\n\n    # Delete a key\n    client.delete(key=key)\n    print(f\"Deleted '{key}'\")\n\n    # Try to get after deletion\n    deleted_value, deleted_meta = client.get(key=key)\n    print(f\"Get '{key}' after deletion: value='{deleted_value}', revision={deleted_meta.revision}\") # Value will be empty/None\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure an etcd server is running at the specified host and port.\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Always use `from etcd_sdk import Client` for importing the main client.","message":"The 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`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your etcd server is running version 3.x. Refer to the etcd documentation for migration from v2 to v3 if necessary.","message":"This 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`.","severity":"breaking","affected_versions":"All versions"},{"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`.","message":"Potential `grpcio` version conflicts. The library specifies a compatible `grpcio` version range, but conflicts can arise if other dependencies require a different, incompatible version.","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"For 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`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'3.8':22 'activ':42 'api':18 'client':5,13,60 'depend':51 'distribut':33,58 'enhanc':49 'etcd':2,7,16,31,53 'etcd-sdk-python':1,6 'focus':47 'grpc':59 'interact':29 'interfac':27 'key':36,55 'key-valu':35,54 'librari':40 'maintain':43 'minor':45 'provid':24 'python':4,9,12,20 'releas':46 'reliabl':34 'sdk':3,8 'simpl':26 'store':38,57 'support':19 'updat':52 'v3':17 'valu':37,56 'version':21","created_at":"2026-04-17T01:20:24.395827+00:00","updated_at":"2026-04-17T01:20:24.395827+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpfjmv_p93/venv/lib/python3.12/site-packages/pyetcd/__init__.py\", line 1, in <module>\n    from .client import (\n  File \"/tmp/tmpfjmv_p93/venv/lib/python3.12/site-packages/pyetcd/client.py\", line 11, in <module>\n "},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.0.7","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/XuanYang-cn/pyetcd","docs":null,"changelog":null,"pypi":"https://pypi.org/project/etcd-sdk-python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}