etcd-sdk-python


Nameetcd-sdk-python JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryPython client for the etcd v3 API for python >= 3.7
upload_time2023-09-14 03:22:14
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyetcd

[![version](https://img.shields.io/pypi/v/etcd-sdk-python.svg?color=blue)](https://pypi.org/project/etcd-sdk-python/)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/etcd-sdk-python?logo=python&logoColor=blue)](https://pypi.org/project/etcd-sdk-python/)
[![Downloads](https://pepy.tech/badge/etcd-sdk-python)](https://pepy.tech/project/etcd-sdk-python)
[![Downloads](https://pepy.tech/badge/etcd-sdk-python/month)](https://pepy.tech/project/etcd-sdk-python/month)
[![license](https://img.shields.io/hexpm/l/plug.svg?color=green)](https://github.com/xuanyang-cn/pyetcd/blob/main/LICENSE)

Python client for the etcd API v3, supported python >= 3.7, under active maintenance

## Install
```shell
pip install etcd-sdk-python
```
## Road maps and TODOs

### Road maps
|version|release date|target|status|
|:-----:|:----------:|------|:----:|
|0.0.1  |Apr 10,2023 |enable >= python3.7|DONE  |
|0.0.2  |Jun 6,2023 ||DONE|
|0.0.3  |ND |set up github actions, run pass unittests, set up merging rules, ensure quality|WIP|


### TODOs for v0.0.2
|functions|version|status|
|---------|:-----:|:----:|
|make ut work|0.0.2|BACKLOG|
|make tox.ini work|0.0.2|BACKLOG|
|enable running ut for pull requests|0.0.2|BACKLOG|
|enable running lint for pull requests|0.0.2|BACKLOG|
|enable publishing dev packages for merge|0.0.2|BACKLOG|
|Add mergify to help merging PRs|0.0.2|BACKLOG|


## Basic usage:

```python
import pyetcd

etcd = pyetcd.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)
```

## Credits

Many thx to  [python-etcd3](https://github.com/kragniz/python-etcd3)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "etcd-sdk-python",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "XuanYang-cn <jumpthepig@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d5/0b/debbbe2408798e73ef34c8ecbd5de595032b7c9a551b52fd5d1b8a5f8d06/etcd-sdk-python-0.0.4.tar.gz",
    "platform": null,
    "description": "# pyetcd\n\n[![version](https://img.shields.io/pypi/v/etcd-sdk-python.svg?color=blue)](https://pypi.org/project/etcd-sdk-python/)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/etcd-sdk-python?logo=python&logoColor=blue)](https://pypi.org/project/etcd-sdk-python/)\n[![Downloads](https://pepy.tech/badge/etcd-sdk-python)](https://pepy.tech/project/etcd-sdk-python)\n[![Downloads](https://pepy.tech/badge/etcd-sdk-python/month)](https://pepy.tech/project/etcd-sdk-python/month)\n[![license](https://img.shields.io/hexpm/l/plug.svg?color=green)](https://github.com/xuanyang-cn/pyetcd/blob/main/LICENSE)\n\nPython client for the etcd API v3, supported python >= 3.7, under active maintenance\n\n## Install\n```shell\npip install etcd-sdk-python\n```\n## Road maps and TODOs\n\n### Road maps\n|version|release date|target|status|\n|:-----:|:----------:|------|:----:|\n|0.0.1  |Apr 10,2023 |enable >= python3.7|DONE  |\n|0.0.2  |Jun 6,2023 ||DONE|\n|0.0.3  |ND |set up github actions, run pass unittests, set up merging rules, ensure quality|WIP|\n\n\n### TODOs for v0.0.2\n|functions|version|status|\n|---------|:-----:|:----:|\n|make ut work|0.0.2|BACKLOG|\n|make tox.ini work|0.0.2|BACKLOG|\n|enable running ut for pull requests|0.0.2|BACKLOG|\n|enable running lint for pull requests|0.0.2|BACKLOG|\n|enable publishing dev packages for merge|0.0.2|BACKLOG|\n|Add mergify to help merging PRs|0.0.2|BACKLOG|\n\n\n## Basic usage:\n\n```python\nimport pyetcd\n\netcd = pyetcd.client()\n\netcd.get('foo')\netcd.put('bar', 'doot')\netcd.delete('bar')\n\n# locks\nlock = etcd.lock('thing')\nlock.acquire()\n# do something\nlock.release()\n\nwith etcd.lock('doot-machine') as lock:\n    # do something\n\n# transactions\netcd.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\nwatch_count = 0\nevents_iterator, cancel = etcd.watch(\"/doot/watch\")\nfor event in events_iterator:\n    print(event)\n    watch_count += 1\n    if watch_count > 10:\n        cancel()\n\n# watch prefix\nwatch_count = 0\nevents_iterator, cancel = etcd.watch_prefix(\"/doot/watch/prefix/\")\nfor 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\ndef watch_callback(event):\n    print(event)\n\nwatch_id = etcd.add_watch_callback(\"/anotherkey\", watch_callback)\n\n# cancel watch\netcd.cancel_watch(watch_id)\n\n# recieve watch events for a prefix via callback function\ndef watch_callback(event):\n    print(event)\n\nwatch_id = etcd.add_watch_prefix_callback(\"/doot/watch/prefix/\", watch_callback)\n\n# cancel watch\netcd.cancel_watch(watch_id)\n```\n\n## Credits\n\nMany thx to  [python-etcd3](https://github.com/kragniz/python-etcd3)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python client for the etcd v3 API for python >= 3.7",
    "version": "0.0.4",
    "project_urls": {
        "Docs: User Guide": "https://pyetcd-docs.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/XuanYang-cn/pyetcd",
        "Source Code": "https://github.com/XuanYang-cn/pyetcd"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "538f7cce8c9bff1c4859576da312b94be505aaed04bf70982b9670b0be1f2933",
                "md5": "28b84883e7577a6d42c002eb03b59f70",
                "sha256": "e0ddd1fa1b5dffd07b6f73b37abc52ba721a8b497e7f183c7b2cac5bfce0670a"
            },
            "downloads": -1,
            "filename": "etcd_sdk_python-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28b84883e7577a6d42c002eb03b59f70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 52029,
            "upload_time": "2023-09-14T03:22:12",
            "upload_time_iso_8601": "2023-09-14T03:22:12.370155Z",
            "url": "https://files.pythonhosted.org/packages/53/8f/7cce8c9bff1c4859576da312b94be505aaed04bf70982b9670b0be1f2933/etcd_sdk_python-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d50bdebbbe2408798e73ef34c8ecbd5de595032b7c9a551b52fd5d1b8a5f8d06",
                "md5": "ef966115eac12f0105a3563958a43cfc",
                "sha256": "b79963513816cb31df30b3a531b65bdf622ec5c715f42cb6efa3f5e503c66c95"
            },
            "downloads": -1,
            "filename": "etcd-sdk-python-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ef966115eac12f0105a3563958a43cfc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 69117,
            "upload_time": "2023-09-14T03:22:14",
            "upload_time_iso_8601": "2023-09-14T03:22:14.501929Z",
            "url": "https://files.pythonhosted.org/packages/d5/0b/debbbe2408798e73ef34c8ecbd5de595032b7c9a551b52fd5d1b8a5f8d06/etcd-sdk-python-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-14 03:22:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "XuanYang-cn",
    "github_project": "pyetcd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "etcd-sdk-python"
}
        
Elapsed time: 0.12372s