============
python-etcd3
============
.. image:: https://img.shields.io/pypi/v/etcd3.svg
:target: https://pypi.python.org/pypi/etcd3
.. image:: https://img.shields.io/travis/kragniz/python-etcd3.svg
:target: https://travis-ci.org/kragniz/python-etcd3
.. image:: https://readthedocs.org/projects/python-etcd3/badge/?version=latest
:target: https://python-etcd3.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/kragniz/python-etcd3/shield.svg
:target: https://pyup.io/repos/github/kragniz/python-etcd3/
:alt: Updates
.. image:: https://codecov.io/github/kragniz/python-etcd3/coverage.svg?branch=master
:target: https://codecov.io/github/kragniz/python-etcd3?branch=master
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:
.. code-block:: python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/kragniz/python-etcd3",
"name": "etcd3",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "etcd3",
"author": "Louis Taylor",
"author_email": "louis@kragniz.eu",
"download_url": "https://files.pythonhosted.org/packages/9c/eb/6d1ef4d6a3e8b74e45c502cbd3ea6c5c6c786d003829db9369c2530f5e3f/etcd3-0.12.0.tar.gz",
"platform": "",
"description": "============\npython-etcd3\n============\n\n\n.. image:: https://img.shields.io/pypi/v/etcd3.svg\n :target: https://pypi.python.org/pypi/etcd3\n\n.. image:: https://img.shields.io/travis/kragniz/python-etcd3.svg\n :target: https://travis-ci.org/kragniz/python-etcd3\n\n.. image:: https://readthedocs.org/projects/python-etcd3/badge/?version=latest\n :target: https://python-etcd3.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/kragniz/python-etcd3/shield.svg\n :target: https://pyup.io/repos/github/kragniz/python-etcd3/\n :alt: Updates\n\n.. image:: https://codecov.io/github/kragniz/python-etcd3/coverage.svg?branch=master\n :target: https://codecov.io/github/kragniz/python-etcd3?branch=master\n\n\nPython client for the etcd API v3, supported under python 2.7, 3.4 and 3.5.\n\n**Warning: the API is mostly stable, but may change in the future**\n\nIf you're interested in using this library, please get involved.\n\n* Free software: Apache Software License 2.0\n* Documentation: https://python-etcd3.readthedocs.io.\n\nBasic usage:\n\n.. code-block:: python\n\n import etcd3\n\n etcd = etcd3.client()\n\n etcd.get('foo')\n etcd.put('bar', 'doot')\n etcd.delete('bar')\n\n # locks\n lock = etcd.lock('thing')\n lock.acquire()\n # do something\n lock.release()\n\n with etcd.lock('doot-machine') as lock:\n # do something\n\n # transactions\n etcd.transaction(\n compare=[\n etcd.transactions.value('/doot/testing') == 'doot',\n etcd.transactions.version('/doot/testing') > 0,\n ],\n success=[\n etcd.transactions.put('/doot/testing', 'success'),\n ],\n failure=[\n etcd.transactions.put('/doot/testing', 'failure'),\n ]\n )\n\n # watch key\n watch_count = 0\n events_iterator, cancel = etcd.watch(\"/doot/watch\")\n for event in events_iterator:\n print(event)\n watch_count += 1\n if watch_count > 10:\n cancel()\n\n # watch prefix\n watch_count = 0\n events_iterator, cancel = etcd.watch_prefix(\"/doot/watch/prefix/\")\n for event in events_iterator:\n print(event)\n watch_count += 1\n if watch_count > 10:\n cancel()\n\n # recieve watch events via callback function\n def watch_callback(event):\n print(event)\n\n watch_id = etcd.add_watch_callback(\"/anotherkey\", watch_callback)\n\n # cancel watch\n etcd.cancel_watch(watch_id)\n\n # recieve watch events for a prefix via callback function\n def watch_callback(event):\n print(event)\n\n watch_id = etcd.add_watch_prefix_callback(\"/doot/watch/prefix/\", watch_callback)\n\n # cancel watch\n etcd.cancel_watch(watch_id)\n\n\n=======\nHistory\n=======\n\n0.1.0 (2016-09-30)\n------------------\n\n* First release on PyPI.",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Python client for the etcd3 API",
"version": "0.12.0",
"project_urls": {
"Homepage": "https://github.com/kragniz/python-etcd3"
},
"split_keywords": [
"etcd3"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ceb6d1ef4d6a3e8b74e45c502cbd3ea6c5c6c786d003829db9369c2530f5e3f",
"md5": "f40a94e5e93194a9591a20bd600f4c84",
"sha256": "89a704cb389bf0a010a1fa050ce19342d23bf6371ebda1c21cfe8ff3ed488726"
},
"downloads": -1,
"filename": "etcd3-0.12.0.tar.gz",
"has_sig": false,
"md5_digest": "f40a94e5e93194a9591a20bd600f4c84",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 63926,
"upload_time": "2020-03-31T17:12:28",
"upload_time_iso_8601": "2020-03-31T17:12:28.503401Z",
"url": "https://files.pythonhosted.org/packages/9c/eb/6d1ef4d6a3e8b74e45c502cbd3ea6c5c6c786d003829db9369c2530f5e3f/etcd3-0.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-03-31 17:12:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kragniz",
"github_project": "python-etcd3",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "etcd3"
}