/usr/lib/python2.7/dist-packages/python_etcd-0.4.3.egg-info/PKG-INFO is in python-etcd 0.4.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | Metadata-Version: 1.1
Name: python-etcd
Version: 0.4.3
Summary: A python client for etcd
Home-page: http://github.com/jplana/python-etcd
Author: Jose Plana
Author-email: jplana@gmail.com
License: MIT
Description: python-etcd documentation
=========================
A python client for Etcd https://github.com/coreos/etcd
Official documentation: http://python-etcd.readthedocs.org/
.. image:: https://travis-ci.org/jplana/python-etcd.png?branch=master
:target: https://travis-ci.org/jplana/python-etcd
.. image:: https://coveralls.io/repos/jplana/python-etcd/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/jplana/python-etcd?branch=master
Installation
------------
Pre-requirements
~~~~~~~~~~~~~~~~
Install etcd (2.0.1 or later). This version of python-etcd will only work correctly with the etcd version 2.0.x or later. If you are running an older version of etcd, please use python-etcd 0.3.3 or earlier.
This client is known to work with python 2.7 and with python 3.3 or above. It is not tested or expected to work in more outdated versions of python.
From source
~~~~~~~~~~~
.. code:: bash
$ python setup.py install
Usage
-----
The basic methods of the client have changed compared to previous versions, to reflect the new API structure; however a compatibility layer has been maintained so that you don't necessarily need to rewrite all your existing code.
Create a client object
~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
import etcd
client = etcd.Client() # this will create a client against etcd server running on localhost on port 4001
client = etcd.Client(port=4002)
client = etcd.Client(host='127.0.0.1', port=4003)
client = etcd.Client(host='127.0.0.1', port=4003, allow_redirect=False) # wont let you run sensitive commands on non-leader machines, default is true
# If you have defined a SRV record for _etcd._tcp.example.com pointing to the clients
client = etcd.Client(srv_domain='example.com', protocol="https")
# create a client against https://api.example.com:443/etcd
client = etcd.Client(host='api.example.com', protocol='https', port=443, version_prefix='/etcd')
Write a key
~~~~~~~~~
.. code:: python
client.write('/nodes/n1', 1)
# with ttl
client.write('/nodes/n2', 2, ttl=4) # sets the ttl to 4 seconds
client.set('/nodes/n2', 1) # Equivalent, for compatibility reasons.
Read a key
~~~~~~~~~
.. code:: python
client.read('/nodes/n2').value
client.read('/nodes', recursive = True) #get all the values of a directory, recursively.
client.get('/nodes/n2').value
Delete a key
~~~~~~~~~~~~
.. code:: python
client.delete('/nodes/n1')
Atomic Compare and Swap
~~~~~~~~~~~~
.. code:: python
client.write('/nodes/n2', 2, prevValue = 4) # will set /nodes/n2 's value to 2 only if its previous value was 4 and
client.write('/nodes/n2', 2, prevExist = False) # will set /nodes/n2 's value to 2 only if the key did not exist before
client.write('/nodes/n2', 2, prevIndex = 30) # will set /nodes/n2 's value to 2 only if the key was last modified at index 30
client.test_and_set('/nodes/n2', 2, 4) #equivalent to client.write('/nodes/n2', 2, prevValue = 4)
You can also atomically update a result:
.. code:: python
result = client.read('/foo')
print(result.value) # bar
result.value += u'bar'
updated = client.update(result) # if any other client wrote '/foo' in the meantime this will fail
print(updated.value) # barbar
Watch a key
~~~~~~~~~~~
.. code:: python
client.read('/nodes/n1', wait = True) # will wait till the key is changed, and return once its changed
client.read('/nodes/n1', wait = True, timeout=30) # will wait till the key is changed, and return once its changed, or exit with an exception after 30 seconds.
client.read('/nodes/n1', wait = True, waitIndex = 10) # get all changes on this key starting from index 10
client.watch('/nodes/n1') #equivalent to client.read('/nodes/n1', wait = True)
client.watch('/nodes/n1', index = 10)
Locking module
~~~~~~~~~~~~~~
.. code:: python
# Initialize the lock object:
# NOTE: this does not acquire a lock yet
client = etcd.Client()
lock = etcd.Lock(client, 'my_lock_name')
# Use the lock object:
lock.acquire(blocking=True, # will block until the lock is acquired
lock_ttl=None) # lock will live until we release it
lock.is_acquired() #
lock.acquire(lock_ttl=60) # renew a lock
lock.release() # release an existing lock
lock.is_acquired() # False
# The lock object may also be used as a context manager:
client = etcd.Client()
with etcd.Lock(client, 'customer1') as my_lock:
do_stuff()
my_lock.is_acquired() # True
my_lock.acquire(lock_ttl = 60)
my_lock.is_acquired() # False
Get machines in the cluster
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
client.machines
Get leader of the cluster
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
client.leader
Generate a sequential key in a directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
x = client.write("/dir/name", "value", append=True)
print("generated key: " + x.key)
print("stored value: " + x.value)
List contents of a directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
#stick a couple values in the directory
client.write("/dir/name", "value1", append=True)
client.write("/dir/name", "value2", append=True)
directory = client.get("/dir/name")
# loop through directory children
for result in directory.children:
print(result.key + ": " + result.value)
# or just get the first child value
print(directory.children.next().value)
Development setup
-----------------
To create a buildout,
.. code:: bash
$ python bootstrap.py
$ bin/buildout
to test you should have etcd available in your system path:
.. code:: bash
$ bin/test
to generate documentation,
.. code:: bash
$ cd docs
$ make
Release HOWTO
-------------
To make a release
1) Update release date/version in NEWS.txt and setup.py
2) Run 'python setup.py sdist'
3) Test the generated source distribution in dist/
4) Upload to PyPI: 'python setup.py sdist register upload'
News
====
0.4.3
-----
*Release date: 14-Dec-2015*
* Fix check for parameters in case of connection error
* Python 3.5 compatibility and general python3 cleanups
* Added authentication and module for managing ACLs
* Added srv record-based DNS discovery
* Fixed (again) logging of cluster id changes
* Fixed leader lookup
* Properly retry request on exception
* Client: clean up open connections when deleting
0.4.2
-----
*Release date: 8-Oct-2015*
* Fixed lock documentation
* Fixed lock sequences due to etcd 2.2 change
* Better exception management during response processing
* Fixed logging of cluster ID changes
* Fixed subtree results
* Do not check cluster ID if etcd responses don't contain the ID
* Added a cause to EtcdConnectionFailed
0.4.1
-----
*Release date: 1-Aug-2015*
* Added client-side leader election
* Added stats endpoints
* Added logging
* Better exception handling
* Check for cluster ID on each request
* Added etcd.Client.members and fixed etcd.Client.leader
* Removed locking and election etcd support
* Allow the use of etcd proxies with reconnections
* Implement pop: Remove key from etc and return the corresponding value.
* Eternal watcher can be now recursive
* Fix etcd.Client machines
* Do not send parameters with `None` value to etcd
* Support ttl=0 in write.
* Moved pyOpenSSL into test requirements.
* Always set certificate information so redirects from http to https work.
0.3.3
-----
*Release date: 12-Apr-2015*
* Forward leaves_only value in get_subtree() recursive calls
* Fix README prevExists->prevExist
* Added configurable version_prefix
* Added support for recursive watch
* Better error handling support (more detailed exceptions)
* Fixed some unreliable tests
0.3.2
-----
*Release date: 4-Aug-2014*
* Fixed generated documentation version.
0.3.1
-----
*Release date: 4-Aug-2014*
* Added consisten read option
* Fixed timeout parameter in read()
* Added atomic delete parameter support
* Fixed delete behaviour
* Added update method that allows atomic updated on results
* Fixed checks on write()
* Added leaves generator to EtcdResult and get_subtree for recursive fetch
* Added etcd_index to EtcdResult
* Changed ethernal -> eternal
* Updated urllib3 & pyOpenSSL libraries
* Several performance fixes
* Better parsing of etcd_index and raft_index
* Removed duplicated tests
* Added several integration and unit tests
* Use etcd v0.3.0 in travis
* Execute test using `python setup.py test` and nose
0.3.0
-----
*Release date: 18-Jan-2014*
* API v2 support
* Python 3.3 compatibility
0.2.1
-----
*Release data: 30-Nov-2013*
* SSL support
* Added support for subdirectories in results.
* Improve test
* Added support for reconnections, allowing death node tolerance.
0.2.0
-----
*Release date: 30-Sep-2013*
* Allow fetching of multiple keys (sub-nodes)
0.1
---
*Release date: 18-Sep-2013*
* Initial release
Keywords: etcd raft distributed log api client
Platform: UNKNOWN
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database :: Front-Ends
|