Skip to main content

Python client for Consul (http://www.consul.io/)

Project description

Python client for Consul.io

Fork intent

The origin project https://github.com/cablehead/python-consul is not maintained since 2018. As we’re 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 https://pypi.org/project/py-consul/

Example

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

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.

Contributing

py-consul is currently maintained by Criteo folks.

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 we’re able.

When you create a PR please ensure:

  1. To add tests for your new features, if reasonable

  2. To add docstrings for new api features you may add

Change log

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-consul-1.3.0.tar.gz (31.0 kB view hashes)

Uploaded Source

Built Distribution

py_consul-1.3.0-py2.py3-none-any.whl (21.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page