Skip to content

oreh/simpletcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

introduction

simpletcd is a simple etcd client that aims to make recursive get/put operations easier. If you are using etcd mainly as a configuration repository or a meta data storage, simpletcd helps to simplify store and retrieve dictionary datawith a single call.

Install

pip install simpletcd

Usage

Put a value to a key

>> from simpletcd.ectd import Etcd

>> # Etcd can be initallized with specific host (default, 127.0.0.1) and port (default 2379)
>> # e.g. Etcd(host=<host>, port=<port>)
>> etcd = Etcd() 
>> etcd.put('mytestkey', 'test value')

Get a key

>> from simpletcd.ectd import Etcd

>> etcd = Etcd()
>> etcd.get('mytestkey')
{u'mytestkey': u'test value'}

Put multiple keys recursively

>> from simpletcd.ectd import Etcd

>> etcd = Etcd()
>> etcd.put('mytopkey', {'key_0': 'v0', 'key_1': {'key_1_0': 'v1_0', 'key_1_1': 'v1_1'}})

Get multiple keys recursively

>> from simpletcd.ectd import Etcd

>> etcd = Etcd()
>> etcd.get('mytopkey')
{u'mytopkey': {u'key_0': u'v0',
  u'key_1': {u'key_1_0': u'v1_0', u'key_1_1': u'v1_1'}}}

Changes: 0.1.3: Initial release

About

A simple etcd client to make recursive get/put easy

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages