skillfed

py-consul

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

py-consul v1.7.1 1.2M downloads/30d#4,200 on PyPI82
Permissive license MIT Active released

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-consul

uv

uv add py-consul

poetry

poetry add py-consul

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

consul python clientconsul key-value store apiservice discovery pythonconsul health checksdistributed configuration managementconsul acl managementconsul agent client
service-discoveryconsul-clientdistributed-systems

More Distributed Computing packages