A wrapper around etcd3 package
Project description
etcd3_wrapper
A thin wrapper around Python module etcd3 to make it a little easier to deal with etcd.
Warning: The API isn't fully stable and can changed significantly in future.
For Example, you want to get an entry from etcd. You would write something like this
from etcd3_wrapper import Etcd3Wrapper
client = Etcd3Wrapper()
entry = client.get("/planet/earth")
if entry:
# It would print key and value of entry
# in bytes format b'....'
print(entry.key, entry.value)
Output
b'/planet/earth' b'{"population": "7.53 Billion"}'
# If you know that the value in etcd is in JSON
# format. You can do the following
json_entry = client.get("/planet/earth", value_in_json=True)
if json_entry:
# Now, entry.value is of type dict
print(entry.key, entry.value)
# So, you can do this too
print(f"Earth population is {entry.value['population']}")
Output
/planet/earth {"population": "7.53 Billion"}
Earth population is 7.53 Billion
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
etcd3_wrapper-0.5.3.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for etcd3_wrapper-0.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a17df188020a007418edb5a4757f31ecc8b0df6b50ab6e7a17e978293379ac65 |
|
MD5 | 6f36369a3bdae1867652791773e40e99 |
|
BLAKE2b-256 | 5a1c62155444e2a19ae28cf34c7c91984a18b1a630bd23dc6e8d82d1df4fbf66 |