etcd3-fc


Nameetcd3-fc JSON
Version 0.12.0 PyPI version JSON
download
home_pagehttps://github.com/kragniz/python-etcd3
SummaryPython client for the etcd3 API - this includes a newest release of etcd3
upload_time2023-06-18 13:22:20
maintainer
docs_urlNone
authorLouis Taylor
requires_python
licenseApache Software License 2.0
keywords etcd3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ============
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-fc",
    "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/2c/77/9b77e1c3694dc06c16516697a952719cc4a1d29fa39103683d2975b7dd6d/etcd3-fc-0.12.0.tar.gz",
    "platform": null,
    "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.\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Python client for the etcd3 API - this includes a newest release of etcd3",
    "version": "0.12.0",
    "project_urls": {
        "Homepage": "https://github.com/kragniz/python-etcd3"
    },
    "split_keywords": [
        "etcd3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c779b77e1c3694dc06c16516697a952719cc4a1d29fa39103683d2975b7dd6d",
                "md5": "edca9a4667b5afaf9b7813082a85ed67",
                "sha256": "e3afe729f6145158d72fdeecbbd7e790354a137d615e3322012a35220fb0ca5f"
            },
            "downloads": -1,
            "filename": "etcd3-fc-0.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "edca9a4667b5afaf9b7813082a85ed67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 63344,
            "upload_time": "2023-06-18T13:22:20",
            "upload_time_iso_8601": "2023-06-18T13:22:20.581949Z",
            "url": "https://files.pythonhosted.org/packages/2c/77/9b77e1c3694dc06c16516697a952719cc4a1d29fa39103683d2975b7dd6d/etcd3-fc-0.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-18 13:22:20",
    "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-fc"
}
        
Elapsed time: 0.07831s