Skip to main content

Incognitus python client

Project description

Incognitus Feature Flag

Continuous Integration codecov PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

incognitus-client-1.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

incognitus_client-1.0.1-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page