# py-consul [![PyPi version](https://img.shields.io/pypi/v/py-consul.svg)](https://pypi.python.org/pypi/py-consul/) [![Python version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/) ![Status](https://img.shields.io/badge/status-maintained-green.svg)
Status
-----------
This project is maintained and actively developed by Criteo.
We aim at converging towards a full compatibility with the official Consul API.
We're currently supporting consul 1.13 up to 1.17. Due to quite a few changes
since our development started (see section "A bit of history"), some endpoints are
still partially handled.
Therefore, we are open to contributions and suggestions.
Example
-------
```python
import consul
c = consul.Consul()
# poll a key for updates
index = None
while True:
index, data = c.kv.get('foo', index=index)
print data['Value']
# in another process
c.kv.put('foo', 'bar')
```
Installation
------------
```bash
pip install py-consul
```
**Note:** When using py-consul library in environment with proxy server,
setting of ``http_proxy``, ``https_proxy`` and ``no_proxy`` environment variables
can be required for proper functionality.
A bit of history
-----------
The origin project [python-consul](https://github.com/cablehead/python-consul) is not maintained
since 2018. As we were not able to get in touch with the maintainer (cablehead)
to merge and release our PRs, we've forked the project in order to continue the
maintenance of the project. We also renamed the project to be able to upload
on pypi; see [PyPI](https://pypi.org/project/py-consul/)
Following some major changes, we decided to detach this fork from the original project
and move from [criteo fork space](https://github.com/criteo-forks/)
to [criteo space](https://github.com/criteo/).
Contributing
------------
Please reach out if you're interested in being a maintainer as well. Otherwise,
open a PR or Issue we'll try and respond as quickly as possible.
When you create a PR please ensure:
- To add tests for your new features, if applicable
- To add docstrings for new API features you may add
# Change log
## 1.5.3
- **feature:** add replace_existing_checks option to agent.service.register()
- **revert:** add replace_existing_checks option to Catalog.register()
## 1.5.2
- **feature:** add replace_existing_checks option to Catalog.register()
## 1.5.1
- **feature:** Implement creation of policies.
- **feature:** Integrate policy addition during token creation.
## 1.5.0
- **[Breaking]** ACL endpoint change, consul.acl is now consul.acl.token
- **feature:** add consul.acl.policy.list and acl.policy.read
## 1.4.1
- **ci:** fix package publishing and update GH actions versions
## 1.4.0 (unreleased)
- **[Breaking]** due to the re-implementation of the ACL endpoint and the drop of the support of OSX and consul 1.1.0.
- **feature:** re-implement some basic ACL endpoint
- **feature:** drop support of OSX and consul 1.1.0
- **feature:** support multi-check service registration (through extra_checks parameter)
- **env:** support python 3.12
- **tests:** multi consul version test (1.13.8, 1.15.4, 1.16.1, 1.17.3)
- **tests:** add test utils for cleaner API output expected assertion
- **code-style:** use ruff linter and formatter
- **code-style:** split files following the consul API logic
- **ci:** speedup ci with uv/tox-uv
## 1.3.0
- **feature:** drop tornado and twisted support
- **env:** support python 3.10 and 3.11
- **env:** drop support of EOL python versions 3.5, 3.6, and 3.7
- **code-style:** syntax modernization
- **code-style:** formatter and linter use
- **ci:** multiple python version test and linter enforcement
## 1.2.4
- **feature:** aio: allow setting timeout by request
## 1.2.3
- **feature:** base: ensure return format of json callback is more consistent
## 1.2.2
- **bugfix:** connect: fix wrong endpoints callbacks
## 1.2.1
- **feature:** Add support for context-managers
- **feature:** Add support for /agent/service/:service_id API
- **bugfix:** rename internal connect method
## 1.2.0
- **feature:** Support deregister field in Check.script
- **feature:** Introduce Consul Connect-related API wrappers
- **feature:** Add token support missing in multiple methods
- **bugfix:** aio: fix timeout type
- **feature:** allow multiple tags in service health query
## 1.1.5
- Dummy release to overcome a pypi release issue
## 1.1.4
- **bugfix:** fixed connection_timeout usage for aiohttp
## 1.1.3
- **bugfix:** fixed connection_limit usage for aiohttp
## 1.1.2
- add support for connection_limit and connection_timeout in aiohttp
- fix asyncio session close
## 1.1.1
- Add support for python 3.7 and 3.8
- Fix asyncio compatibility to support latest python version
- Remove six dependency
- Use new style of class declaration
- Get rid of py3.4 old compat
- Drop support of deprecated python2
- **base:** allow weights parameter in service register
# Base fork
Criteo starts forking this library from [https://github.com/cablehead/python-consul](https://github.com/cablehead/python-consul)
Raw data
{
"_id": null,
"home_page": "https://github.com/criteo-forks/py-consul",
"name": "py-consul",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Criteo",
"author_email": "github@criteo.com",
"download_url": "https://files.pythonhosted.org/packages/29/37/990af3ac56e70705578808f6e4109226127379cccd4557ec6c7ae4b9824f/py_consul-1.5.3.tar.gz",
"platform": null,
"description": "# py-consul [![PyPi version](https://img.shields.io/pypi/v/py-consul.svg)](https://pypi.python.org/pypi/py-consul/) [![Python version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/) ![Status](https://img.shields.io/badge/status-maintained-green.svg)\n\nStatus\n-----------\nThis project is maintained and actively developed by Criteo.\nWe aim at converging towards a full compatibility with the official Consul API.\n\nWe're currently supporting consul 1.13 up to 1.17. Due to quite a few changes \nsince our development started (see section \"A bit of history\"), some endpoints are \nstill partially handled.\n\nTherefore, we are open to contributions and suggestions.\n\nExample\n-------\n\n```python\n import consul\n\n c = consul.Consul()\n\n # poll a key for updates\n index = None\n while True:\n index, data = c.kv.get('foo', index=index)\n print data['Value']\n\n # in another process\n c.kv.put('foo', 'bar')\n```\n\nInstallation\n------------\n```bash\n pip install py-consul\n```\n\n**Note:** When using py-consul library in environment with proxy server, \nsetting of ``http_proxy``, ``https_proxy`` and ``no_proxy`` environment variables \ncan be required for proper functionality.\n\nA bit of history\n-----------\n\nThe origin project [python-consul](https://github.com/cablehead/python-consul) is not maintained\nsince 2018. As we were not able to get in touch with the maintainer (cablehead)\nto merge and release our PRs, we've forked the project in order to continue the\nmaintenance of the project. We also renamed the project to be able to upload\non pypi; see [PyPI](https://pypi.org/project/py-consul/)\n\nFollowing some major changes, we decided to detach this fork from the original project\nand move from [criteo fork space](https://github.com/criteo-forks/) \nto [criteo space](https://github.com/criteo/).\n\nContributing\n------------\n\nPlease reach out if you're interested in being a maintainer as well. Otherwise,\nopen a PR or Issue we'll try and respond as quickly as possible.\n\nWhen you create a PR please ensure:\n\n- To add tests for your new features, if applicable\n- To add docstrings for new API features you may add\n\n\n# Change log\n\n## 1.5.3\n\n- **feature:** add replace_existing_checks option to agent.service.register()\n- **revert:** add replace_existing_checks option to Catalog.register()\n\n## 1.5.2\n\n- **feature:** add replace_existing_checks option to Catalog.register()\n\n## 1.5.1\n\n- **feature:** Implement creation of policies.\n- **feature:** Integrate policy addition during token creation.\n\n## 1.5.0\n\n- **[Breaking]** ACL endpoint change, consul.acl is now consul.acl.token\n- **feature:** add consul.acl.policy.list and acl.policy.read\n\n## 1.4.1\n\n- **ci:** fix package publishing and update GH actions versions\n\n## 1.4.0 (unreleased)\n\n- **[Breaking]** due to the re-implementation of the ACL endpoint and the drop of the support of OSX and consul 1.1.0.\n - **feature:** re-implement some basic ACL endpoint\n - **feature:** drop support of OSX and consul 1.1.0\n - **feature:** support multi-check service registration (through extra_checks parameter)\n - **env:** support python 3.12\n - **tests:** multi consul version test (1.13.8, 1.15.4, 1.16.1, 1.17.3)\n - **tests:** add test utils for cleaner API output expected assertion\n - **code-style:** use ruff linter and formatter\n - **code-style:** split files following the consul API logic\n - **ci:** speedup ci with uv/tox-uv\n\n## 1.3.0\n\n- **feature:** drop tornado and twisted support\n- **env:** support python 3.10 and 3.11\n- **env:** drop support of EOL python versions 3.5, 3.6, and 3.7\n- **code-style:** syntax modernization\n- **code-style:** formatter and linter use\n- **ci:** multiple python version test and linter enforcement\n\n## 1.2.4\n\n- **feature:** aio: allow setting timeout by request\n\n## 1.2.3\n\n- **feature:** base: ensure return format of json callback is more consistent\n\n## 1.2.2\n\n- **bugfix:** connect: fix wrong endpoints callbacks\n\n## 1.2.1\n\n- **feature:** Add support for context-managers\n- **feature:** Add support for /agent/service/:service_id API\n- **bugfix:** rename internal connect method\n\n## 1.2.0\n\n- **feature:** Support deregister field in Check.script\n- **feature:** Introduce Consul Connect-related API wrappers\n- **feature:** Add token support missing in multiple methods\n- **bugfix:** aio: fix timeout type\n- **feature:** allow multiple tags in service health query\n\n## 1.1.5\n\n- Dummy release to overcome a pypi release issue\n\n## 1.1.4\n\n- **bugfix:** fixed connection_timeout usage for aiohttp\n\n## 1.1.3\n\n- **bugfix:** fixed connection_limit usage for aiohttp\n\n## 1.1.2\n\n- add support for connection_limit and connection_timeout in aiohttp\n- fix asyncio session close\n\n## 1.1.1\n\n- Add support for python 3.7 and 3.8\n- Fix asyncio compatibility to support latest python version\n- Remove six dependency\n- Use new style of class declaration\n- Get rid of py3.4 old compat\n- Drop support of deprecated python2\n- **base:** allow weights parameter in service register\n\n# Base fork\n\nCriteo starts forking this library from [https://github.com/cablehead/python-consul](https://github.com/cablehead/python-consul)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python client for Consul (http://www.consul.io/)",
"version": "1.5.3",
"project_urls": {
"Homepage": "https://github.com/criteo-forks/py-consul"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "430ad2ab888381ba5e27d4cd50f774e783c7203bcd2454385a280fa0ef187ca8",
"md5": "7b9202652b784a6c694cc0fd0cc978d8",
"sha256": "d1270ec7b253c6af1dfa4a368e3c46f7abed0546feceebe5166999ab20850207"
},
"downloads": -1,
"filename": "py_consul-1.5.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "7b9202652b784a6c694cc0fd0cc978d8",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 35698,
"upload_time": "2024-10-01T14:58:41",
"upload_time_iso_8601": "2024-10-01T14:58:41.626836Z",
"url": "https://files.pythonhosted.org/packages/43/0a/d2ab888381ba5e27d4cd50f774e783c7203bcd2454385a280fa0ef187ca8/py_consul-1.5.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2937990af3ac56e70705578808f6e4109226127379cccd4557ec6c7ae4b9824f",
"md5": "2cfe19e5f2aefcf53c8246e5a65b74d1",
"sha256": "05bc4e9e0fea17a2156659ed7f93025b2665859787ff8d0aa9c476829ddf3fdd"
},
"downloads": -1,
"filename": "py_consul-1.5.3.tar.gz",
"has_sig": false,
"md5_digest": "2cfe19e5f2aefcf53c8246e5a65b74d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33491,
"upload_time": "2024-10-01T14:58:43",
"upload_time_iso_8601": "2024-10-01T14:58:43.177743Z",
"url": "https://files.pythonhosted.org/packages/29/37/990af3ac56e70705578808f6e4109226127379cccd4557ec6c7ae4b9824f/py_consul-1.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-01 14:58:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "criteo-forks",
"github_project": "py-consul",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "py-consul"
}