Python client for devices interacting with configgery.com
Project description
Configgery Python client
Install
$ pip install configgery-client
Getting Started
This library allows you to fetch the latest set of configurations for your client.
First, create a client at configgery.com and store the generated API key in a safe place. Then, once you've added configurations to your Client Group, you can fetch those same configurations.
Fetching configurations
from configgery.client import Client
client = Client(API_KEY, "/path/to/store/configurations")
client.download_configurations()
Checking if up-to-date
from configgery.client import Client
client = Client(API_KEY, "/path/to/store/configurations")
client.check_latest()
print(client.is_download_needed())
Using a configuration
from configgery.client import Client
client = Client(API_KEY, "/path/to/store/configurations")
success, data = client.get_configuration('myconfiguration.json')
if success:
print(data)
else:
print('Could not find configuration')
Updating state
from configgery.client import Client, ClientState
client = Client(API_KEY, "/path/to/store/configurations")
client.download_configurations()
client.update_state(ClientState.Configurations_Applied)
if device_happy(): # your own check
client.update_state(ClientState.Upvote)
else:
client.update_state(ClientState.Downvote)
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
Built Distribution
File details
Details for the file configgery_client-2.1.1.tar.gz
.
File metadata
- Download URL: configgery_client-2.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73153026db151925827e4e09fbd8a5fb6150b07e0ba3699c9f712c2831a2b133 |
|
MD5 | 376a800398ea89e01cab5e5382bea682 |
|
BLAKE2b-256 | 1b0b0604a16e42ec502a7adfd5693db748fcdd63eb2126abcc34c4baf8ef2bde |
File details
Details for the file configgery_client-2.1.1-py3-none-any.whl
.
File metadata
- Download URL: configgery_client-2.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebb05b2e8fcc559994f6f22c279fa39d91efece58aa699528b20c435e0718de2 |
|
MD5 | 7dd8e519033d451b593c410939364a49 |
|
BLAKE2b-256 | 28b5c8a90677d057b68f2443b9b756eb9db1332b353b0934531eea71a9003e5b |