Skip to main content

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


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)

Uploaded Source

Built Distribution

featureguards-0.1.5-py3-none-any.whl (20.2 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