python-etcd3
Python client for the etcd API v3, supported under python 2.7, 3.4 and 3.5.
Warning: the API is mostly stable, but may change in the future
If you’re interested in using this library, please get involved.
Free software: Apache Software License 2.0
Documentation: https://python-etcd3.readthedocs.io.
Basic usage:
import etcd3
etcd = etcd3.client()
etcd.get('foo')
etcd.put('bar', 'doot')
etcd.delete('bar')
# locks
lock = etcd.lock('thing')
lock.acquire()
# do something
lock.release()
with etcd.lock('doot-machine') as lock:
# do something
# transactions
etcd.transaction(
compare=[
etcd.transactions.value('/doot/testing') == 'doot',
etcd.transactions.version('/doot/testing') > 0,
],
success=[
etcd.transactions.put('/doot/testing', 'success'),
],
failure=[
etcd.transactions.put('/doot/testing', 'failure'),
]
)
# watch key
watch_count = 0
events_iterator, cancel = etcd.watch("/doot/watch")
for event in events_iterator:
print(event)
watch_count += 1
if watch_count > 10:
cancel()
# watch prefix
watch_count = 0
events_iterator, cancel = etcd.watch_prefix("/doot/watch/prefix/")
for event in events_iterator:
print(event)
watch_count += 1
if watch_count > 10:
cancel()
# recieve watch events via callback function
def watch_callback(event):
print(event)
watch_id = etcd.add_watch_callback("/anotherkey", watch_callback)
# cancel watch
etcd.cancel_watch(watch_id)
# recieve watch events for a prefix via callback function
def watch_callback(event):
print(event)
watch_id = etcd.add_watch_prefix_callback("/doot/watch/prefix/", watch_callback)
# cancel watch
etcd.cancel_watch(watch_id)
History
0.1.0 (2016-09-30)
First release on PyPI.
Release files for etcd3-rs 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| etcd3-rs-0.13.0.tar.gz | 67.9 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| etcd3_rs-0.13.0-py3.10.egg | Legacy Egg format | - | - | Details |
| etcd3_rs-0.13.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 207.6 kB
Release files / etcd3-rs-0.13.0.tar.gz
| Download URL | etcd3-rs-0.13.0.tar.gz |
|---|---|
| Size | 67.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
530a995cd79ad1de452bbc5eb740cebf90c193c2b3d8e5dd4de528c977b0b62a
|
|
BLAKE2b-256 checksum How to use checksums |
152791b830d32a3f07e4f6bc798c0cec45637a7d8c23f9bb90eaf2f784b5d5da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / etcd3_rs-0.13.0-py3.10.egg
| Download URL | etcd3_rs-0.13.0-py3.10.egg |
|---|---|
| Size | 94.6 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
a1238f3fa0df192c76cf2db168c31beb32d53d536d727f3f079e24374da14048
|
|
BLAKE2b-256 checksum How to use checksums |
6dfd6a6d9122e412516c7cab2f4221b66d4fdcf2dca86fd1598508ae02973047
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / etcd3_rs-0.13.0-py2.py3-none-any.whl
| Download URL | etcd3_rs-0.13.0-py2.py3-none-any.whl |
|---|---|
| Size | 45.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ebf2a78c2f295a4b6d874e9695fdedeef12bbb0bda80bfd1c6dafd552aeba1eb
|
|
BLAKE2b-256 checksum How to use checksums |
54aa593c704508e40ddbaf383f6e997ef5e4e614b4df82b68d6bae23fc1bb66c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|