py-consul
Python client for Consul (http://www.consul.io/)
What it is and what it does
py-consul is a Python client for HashiCorp Consul, a distributed service mesh and configuration management system. It wraps Consul's HTTP API to let you interact with Consul's key-value store, service registration and discovery, health checks, and access control lists (ACLs) from Python code. The library supports both synchronous and asynchronous patterns and is maintained by Criteo as an active fork of the original python-consul project, which has been unmaintained since 2018.
The package is designed for developers building applications that need to integrate with Consul for service discovery, distributed configuration, or health monitoring. It handles the HTTP communication with a Consul agent and provides a clean Python interface to common operations like storing and retrieving configuration values, registering services, querying service health, and managing ACL policies and tokens.
Use it for:
- Store and retrieve application configuration from Consul's key-value store with watch-based polling for updates.
- Register microservices in Consul's service catalog and query for healthy instances of dependent services.
- Manage ACL tokens and policies programmatically for fine-grained access control in a Consul cluster.
- Monitor service health by querying Consul's health check endpoints and reacting to state changes.
- Implement service-to-service authentication and authorization using Consul Connect policies.
- Build configuration management tools that synchronize settings across distributed systems via Consul.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for HashiCorp Consul that provides programmatic access to Consul's key-value store, service catalog, health checks, and ACL management through a synchronous and asynchronous API.
Yes. py-consul is actively maintained, has no known vulnerabilities, installs with minimal friction, and is the primary maintained Python client for Consul. Install it if you need to integrate Consul into a Python application for service discovery, configuration management, or health monitoring. The MIT license poses no restrictions.
Install
py-consul on PyPI
pip
pip install py-consuluv
uv add py-consulpoetry
poetry add py-consulInstalling py-consul
Before you install
Low friction installation with a single runtime dependency (requests). Actively maintained by Criteo with recent releases; supports Python 3.10 through 3.14. Last commit was 2026-07-06.
License in practice
MIT license (permissive) allows use in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install py-consul
import consul
c = consul.Consul()
index, data = c.kv.get('foo')
print(data['Value'])
Requires Python 3.10 or later. When using behind a proxy server, http_proxy, https_proxy, and no_proxy environment variables may need to be set.
Verify before relying
- Whether all Consul 1.20–1.22 endpoints are fully implemented or if some remain partially handled as the description suggests.
- Async API capabilities and whether they are production-ready or still experimental.
- Performance characteristics and connection pooling behavior with requests.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 263 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,221,815/month — #4,200 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_consul-1.7.1-py2.py3-none-any.whl
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
python-consulPython client library for Consul, a service…
permissive · top 5,000 on PyPI
consulateConsulate is a Python client library for…
permissive · top 15,000 on PyPI
fastlyA Python client library for the Fastly API,…
permissive · top 15,000 on PyPI
hvachvac is a Python client library for HashiCorp…
permissive · top 1,000 on PyPI
python-barbicanclientPython client library and command-line tool for…
permissive · top 15,000 on PyPI
patroniPatroni orchestrates PostgreSQL…
permissive · top 15,000 on PyPI
nebiusClient library for Nebius AI Cloud services…
unclear · top 5,000 on PyPI
azure-keyvault-secretsSecurely store, retrieve, and manage secrets…
permissive · top 1,000 on PyPI