Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python client for Consul Service Discovery API

Project Description

Consul Service Discovery API

This module provides a simple way to work with the Consul Service Discovery API from python.


Usage examples:

import consul
service = consul.Client()
service.register(id='flexlm1', name='flexlm',
            address='', port=28518,
            tags=('flexlm1', light', 'v1'),
            check={'id': 'flexlm', 'name': 'flexlm on port 28518',
                   'tcp': '',
                   'Interval': '30s', 'timeout': '2s'})

The registration/deregistration is done using the consul agent API:

PUT /v1/agent/service/register
DELETE /v1/agent/service/deregister/<serviceId>

To query the information the catalog API is used:

GET /v1/catalog/services
GET /v1/catalog/service/bigdata
GET /v1/catalog/nodes
GET /v1/catalog/node/c13-9

The payload for the registration request has the following format:

  "ID": "flexlm1",
  "Name": "flexlm",
  "Tags": ["flexlm1", light", "v1"],
  "Address": "",
  "Port": 28518,
  "Check": {
    "id": "flexlm",
    "name": "flexlm on port 28518",
    "tcp": "",
    "Interval": "30s",
    "timeout": "2s"

Release History

This version
History Node


History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(2.5 kB) Copy SHA256 Hash SHA256
Source May 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting