Python client for Consul.io
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')pip install python-consul
There's a few API endpoints still to go to expose all features available in Consul v0.6.0. If you need an endpoint that's not in the documentation, just open an issue and I'll try and add it straight away.
python-consul is currently maintained by @abn and @cablehead. 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.
Pull requests are very much appreciated! When you create a PR please ensure:
- All current tests pass, including flake8
- To add tests for your new features, if reasonable
- To add docstrings for new api features you add and if needed link to these docstrings from the sphinx documentation
# release the current version, eg: 0.6.1-dev -> 0.6.1
bumpversion release
# prepare the next patch (z-stream) version, eg: 0.6.1 -> 0.6.2-dev
bumpversion --no-tag patch
# else, prepare the next minor (y-stream) version, eg: 0.6.1 -> 0.7.0-dev
bumpversion --no-tag minor