Incognitus python client
Project description
Incognitus Feature Flag
Integrating Incognitus
Initializing the service
Before you're able to use the service you'll need to initialize with your tenant and application IDs.
main.py
Initialize Incognitus service
from incognitus_client import Incognitus, IncognitusConfig
Incognitus.initialize(
IncognitusConfig(
"{your tenant key}",
"{your app id}"
)
)
Key | Description |
---|---|
tenant_id | Your tenant id |
application_id | The id of the application |
Checking features
from incognitus_client import Incognitus
svc = Incognitus.instance
response = "old feature text"
if (svc.is_enabled("{feature name}")):
response = "new feature text"
Methods
Method | Description |
---|---|
Incognitus.initialize(config) | Initializes the service (must be called first) |
Incognitus.instance() | The shared instance of the service |
svc.is_enabled(featureName) | Checks if the flag is enabled |
svc.is_disabled(featureName) | Check if the flag is disabled |
svc.get_feature(featureName) | Fetches the feature from the server and returns it's status |
svc.get_all_features() | Fetches all features and stores them in the cache |
Caching
Currently all known feature flags are cached when the app initializes. New features that are not found
in the cache are retrieved on-demand. The cache stays in place until the app is reloaded or by calling the get_all_features()
method on the service.
Future Caching Stories
- Save verified cache to local storage
- Provide hard cache refresh (wipe cache if fails)
- Provide soft cache refresh (keep cache if fails)
- Customizable cache refresh times
- Option to disable cache
Changelog
Please check the github release notes for changes.
Project details
Release history Release notifications | RSS feed
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 incognitus-client-1.0.1.dev7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c7ec6de590046be199dbf407db0f32d8bb0b0c456521679819d8f0d6bd0283d |
|
MD5 | 09b163ebc762b808b95d6bc84c8082ef |
|
BLAKE2b-256 | 560fa1bc110a47b06307bd8cef0d8f046b12e6ca6b309024e19aabeac3490240 |
Close
Hashes for incognitus_client-1.0.1.dev7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2121779c67f11f9cd1740d0dd360c0320d692efabe19331e4699bce25e0580b1 |
|
MD5 | feb7e1cd58ab7204e86ee64dbfa2ad9a |
|
BLAKE2b-256 | 0b849af05cecc3f18c8f8a8cf7399ed819ae72ab87d66ea746fe13044536872a |