Package: consul-reborn
It's a fork of another forkhttps://github.com/nzlosh/python-consul.The very first origin ishttps://github.com/cablehead/python-consul.Python client forHashiCorp ConsulCreatorsOriginal code belongs toAndy Gayton.
And fork with community patches belongs toCarlos.DocumentationOriginal Library DocumentationStatusI'm using some of its function in production, so it's not a complete junk.Exampleimport 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')Alternatively you can create a client from the sameenvironment
variablesthat the consul command line client uses. e.g.
CONSUL_HTTP_ADDR, CONSUL_HTTP_TOKEN.import consul

c = consul.Consul.from_env()

c.agent.self()Installationpip3 install consul-rebornChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelogand this project adheres toSemantic Versioning.[1.4.0] - 2020-06-17Removedconsul.baseChecks.compatas it was marked as deprecated.Addedconsul.basetokenargument forAgent.leave,Agent.force_leaveandEvent.list.Fixedconsul.basesome lint work.[1.3.0] - 2019-06-27ChangedPackage nameconsul=>consul-reborn. Because nameConsulis occupied at PyPi.[1.2.5] - 2019-06-27Removedtox.iniflake8 and Python2..travis.ymlflake8 and Python2.[1.2.4] - 2019-06-27Fixedsetup.py.[1.2.3] - 2019-06-27Fixedsetup.py.[1.2.2] - 2019-06-27FixedREADME.md.setup.py.Changed.travis.ymlremove sonar and deploy stages.Removed.bumpversion.cfg.sonar-project.properties.Support of Python2.[1.2.1] - 2019-06-26FixedREADME.md.[1.2.0] - 2019-06-26Fixedconsul.baseAll methods ofSessionclass use agent token if exists.consul.baseMinor linting.ChangedREADME.md,CHANGELOGConverted to markdown.setup.pyAdjust.Old Versions1.1.0add support for nodemeta to catalog and health end points
(thanks @ibrahimmenem)update Check.script to use args, as Consul 1.1 has dropped the
script parameter1.0.1Support for Python 3.4 dropped (sorry)Add support for Consul 1.0.0 (thanks @matusvalo!)Expose all 400 errors and add tests for common callback handler
(thanks @bagerard)0.7.2Add header parameter to http check (thanks @matusvalo)Add basic Transaction HTTP API support (thanks @iandyh)Fix invalid url error when specifying credentials via host (Issue
#167)0.7.1Add a common base client for shared functionality between different
HTTP clients (thanks @abn!)Fix request quoting issue (thanks @abn)Fix installation issue due to aiohttp only being available for
Python>=3.4.2 (thanks @abn)Added support for current release of aiohttp (thanks @eaterek)Improved Tornado example (thanks @chriswue)Add and use ACL token in Event.fire (thanks @illenseer)Add client side cert support (thanks @brocade-craig)Add token params to catalog register (thanks @gregdurham)Add support for DeregisterCriticalServiceAfter (thanks @daroot)Improve reliability of test suite (thanks @daroot!)Update CI: Add py35 and py36 to tests (thanks @Poogles)0.7.0FeaturesAdd Operator endpoint (thanks @bantonj!)0.6.2Bug FixTornado backend encoding bug related to None values
(thanks @plredmond)python-consul doesn't support python 2.6 (thanks @lowzj)Maintenanceupdate max ttl to 86400 to conform to consul (thanks @philloooo)Correct error message in ACL create/update (thanks @Crypto89)FeaturesCatalog API should support tokens (thanks @racktear!)Allow enable tag override (thanks @shalev67!)0.6.1FeaturesAdd the coordinate endpoint and near support on Catalog and Health
Checks (thanks @shalev67!)Rework all endpoints to use a common callback handler to help ensure
consistent handling of responses (thanks @shalev67)Add Query api support (thanks @shalev67)Add token support for the Health endpoints (thanks @morpheu!)Force to use UTF-8 encoding for the response with the request's
client (thanks @maxnasonov)MaintenanceMigrate readthedocs links from .org to .io (thanks @adamchainz)0.6.0FeaturesAdd support for the new TCP and Docker health checks (thanks @abn)Add support for join and force-leave (thanks @abn)Use standard consul environment variables to override configuration
(thanks @amayausky)MaintenanceTest binaries updated to Consul 0.6.4Tweaks to fix small updates to Consul's API0.4.7FeaturesAdd ACL token support to agent.service.register and
agent.check.register0.4.6FeaturesAdd health.checks endpoint, update health TODOs (thanks @cruatta!)Improve error when a HTTP 503 status code is returned (thanks
@raboof!)Added index and wait parameter to event.list (thanks @max0d41!)0.4.5FeaturesAllow SSL certificate verification to be disabled (thanks
@jgadling!)Use requests.session for performance (thanks @msabramo!)Support 'wait' param for all blocking queries (thanks @rmt!)deduplicate query string when doing deletes with the std (requests)
library (thanks @sduthil!)0.4.4FeaturesSupport creation of ALCs with explicit ID. (thanks @KyleJamesWalker)0.4.3FeaturesSupport 'dc' argument to health endpoints (thanks @etuttle!)0.4.2FeaturesAdd status endpoints (thanks @cruatta!)0.4.1FeaturesAdd health.node (thanks @davidbirdsong!)0.4.0API changes (backwards incompatible)Deprecated old health.check.ttl_pass call has been removedDeprecate loose parametersscript,interval,ttl,httpandtimeout, to configure checks via agent.service.register and
agent.check.register. Both methods now take a single argument to
specify checks. A convenience consul.Check has been added to create
checks.0.3.20FeaturesAdd Node and Service Maintenance (thanks @cruatta!)Bug FixUnclosed connector Exception in consul.aio (thanks @jettify!)0.3.19Bug FixFix six dependency (thanks @pawlowskimichal!)0.3.18FeaturesAdding ability to register checks with services (thanks @cruatta!)Bug FixFix distribution for consul.aio for python3 (thanks @mbachry!)0.3.17FeaturesAdd address param to agent.service.register0.3.16FeaturesAdd cas param for kv.delete (thanks @qix)0.3.15FeaturesAdd tag parameter to health.service() (thanks @reversefold)0.3.14Featuresadd the keys and separator params to kv.get (thanks @Heuriskein)add support for the events api (thanks @Heuriskein!)0.3.13Featuresadd HTTP check support (thanks @JoeHazzers)raise ConsulException on kv.get 500 response code (thanks @jjpersch)add the wait argument to kv.get0.3.12Featuresadd behavior and ttl to session.createadd session.renew0.3.11Featuresadd the health.state endpoint (thanks @pete0emerson!)bump test binaries to 0.5.00.3.9Bug FixExclude consul.aio if asyncio isn't available, avoids an error
message on install, trying to byte compile that module0.3.8API changes (backwards incompatible)Reorder named arguments to be more consistent. index is always the
first named argument, if available, and dc is now always the last
named argument.0.3.7FeaturesAdd dc support for kv calls; add ability to set the default dc for
an entire client session (thanks @angad)Add asyncio client (thanks @jettify)0.3.6FeaturesAdd https support (thanks @pete0emerson)Add wan param to agent.members (thanks @sgargan)0.3.5Bug FixFix typo setting notes on a check (thanks @ShaheedHaque!)0.3.4FeaturesAdd support for the Agent.Check (thanks @sgargan and @ShaheedHaque)Deprecatedhealth.check.ttl_pass has been moved to agent.check.ttl_pass0.3.3FeaturesAdd support for the Session API (Consul.Session)Bug FixesFix a bug retrieving folder nodes from the KV storehttps://github.com/cablehead/python-consul/pull/6#issue-48589128Thanks @zacman850.3.2FeaturesAdd support for Python 3.40.3.1FeaturesAdd support for the Catalog API (Consul.Catalog)Add ability to set a default consistency mode for an entire client
sessionAdd the ability to pass the consistency mode with kv.get0.3.0FeaturesAdd support for ACLs (Consul.ACL)API changes (backwards incompatible)For Consul.Agent.Service.register, renamecheckargument toscript