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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file incognitus-client-1.0.1.tar.gz.

File metadata

  • Download URL: incognitus-client-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for incognitus-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4a74c6b85eec45b9dd20ff0c5552b83ff3c457dbb0357a55e2fa9891a089974e
MD5 43513e7c7a015c7b1e63426992ff17bb
BLAKE2b-256 e09679a463cbb91e41e01f7f90f88dc1058054597d1df42b19038567d6ee3940

See more details on using hashes here.

File details

Details for the file incognitus_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: incognitus_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for incognitus_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36f48e01d11a25c35cd3a082ba32d0c1b4f916414edbdb72de7f7a074824d41f
MD5 b289e7cbe75a032648d979f4822c3abf
BLAKE2b-256 e936f8924e382ac4932d137fcea79c86dd267a3f7ba461c1ee51b1634a492e06

See more details on using hashes here.

Supported by

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