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
Close
Hashes for configgery_client-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 380a57d764e67bba1771eb38491ff17512061a02312b6e91e27550ae76753ec0 |
|
MD5 | 465cdc2e63206c1e436d82cdebfabc8d |
|
BLAKE2b-256 | fdc7bb56bbcaa0fc1ae82943464d48c996f122f1ac77f3e4216d1137466e5014 |