Skip to main content

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

Project description

PyConsul
========

> Python client for [Consul][1]


A dummy, one-file, implementation on top of the [HTTP API][5] of Consul.

Install
-------

* Install Consul following [the official guide][3] or this one-liner:

```console
$ # Install consul 0.1.0_linux_amd64 under /usr/local/bin
$ wget -qO- https://raw.githubusercontent.com/hackliff/pyconsul/master/install-consul.sh | (sudo) bash
```

* Install pyconsul library

```console
$ git clone https://github.com/hackliff/pyconsul
$ cd pyconsul && (sudo) python setup.py install
```


Getting started
---------------

I strongly advise you to go through [the official Consul documentation][4]
before playing around with pyconsul.

Make sure an agent is running, for example with :

```console
consul agent -server -bootstrap \
-data-dir /tmp/consul \
-node=agent-one \
-bind=0.0.0.0
```

Then you can talk to it

```python
from pyconsul import Consul

# On the same server
consul_ = Consul()
print consul_.status
print consul_.health(node='agent-one')

# Access key / value storage
consul_.set('node/name', 'test')
print consul_.storage.get('node/name')
consul_.storage.delete('node/name')

# Or manage local agent (incomplete)
print consul_.local_agent.members
print consul_.local_agent.services
consul_.local_agent.join('172.17.0.3')
```

... in construction ...



License
-------

Copyright 2014 Xavier Bruhiere.

PyConsul is available under the [MIT Licence][2].


[1]: http://consul.io
[2]: http://opensource.org/licenses/MIT
[3]: http://www.consul.io/intro/getting-started/install.html
[4]: http://www.consul.io/intro/
[5]: http://www.consul.io/docs/agent/http.html

Project details


Download files

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

Source Distribution

pyconsul-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file pyconsul-0.0.1.tar.gz.

File metadata

  • Download URL: pyconsul-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyconsul-0.0.1.tar.gz
Algorithm Hash digest
SHA256 65532948c22cfcf4ccd186616590080c25f8a51686552d6c14012ab9dab11bf6
MD5 b150740253f4032a95d3eb5d55d19d13
BLAKE2b-256 62af46961df3f0b69ee8681119ace5025d10d05f6de12c9d297d9d830dde6788

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page