Official Python SDK for FeatureGuards
Project description
featureguards-python
Official Python SDK for FeatureGuards
Installation
python3 -m pip install --upgrade featureguards
from featureguards.feature_flags import feature_flags
from os import getenv
fg = feature_flags(api_key=getenv('FEATUREGUARDS_API_KEY'))
# Simple example checking is feature flag FOO is on
print(fg.is_on('FOO'))
# Passing user_id as an attribute.
print(fg.is_on('FOO', {'user_id': 123}))
Documentation
For details on all the functionality in this library, see the Python documentation.
Below are a few simple examples:
is_on
# Create the featureguards class once.
fg = feature_flags(api_key=getenv('FEATUREGUARDS_API_KEY'))
# Call is_on multiple times.
fg.is_on('FOO')
fg.is_on('BAR')
is_on with attributes
# Create the featureguards class once.
fg = feature_flags(api_key=getenv('FEATUREGUARDS_API_KEY'))
# Call is_on multiple times.
fg.is_on('FOO', {'user_id': 123})
fg.is_on('BAR', {'user_id': 123, 'company_slug': 'acme'})
Examples
See full examples
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
featureguards-0.1.5.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for featureguards-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1872059ab3c6e80eadf1c1eea94d9e7ad8dac1e62c665dc64b82c45d149f2b17 |
|
MD5 | 53af8f827d61c3a60cd7cac9a0abffb6 |
|
BLAKE2b-256 | 1f7f2ad8d6e78ab99725fb263b72ef91792f8ef2bd2c553013bcf72e83726770 |