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

Uploaded Source

Built Distribution

featureguards-0.1.5-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file featureguards-0.1.5.tar.gz.

File metadata

  • Download URL: featureguards-0.1.5.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for featureguards-0.1.5.tar.gz
Algorithm Hash digest
SHA256 54312b80efed7418ccf62964735cad578ac6cfa0e3db8b977013b5780e04995d
MD5 e79c96ac083d9cd01af89347905c11bd
BLAKE2b-256 8b74e56ac25261d66c4764567fa9c83db54b1818ef0652f608afc911b518bc15

See more details on using hashes here.

File details

Details for the file featureguards-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: featureguards-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for featureguards-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1872059ab3c6e80eadf1c1eea94d9e7ad8dac1e62c665dc64b82c45d149f2b17
MD5 53af8f827d61c3a60cd7cac9a0abffb6
BLAKE2b-256 1f7f2ad8d6e78ab99725fb263b72ef91792f8ef2bd2c553013bcf72e83726770

See more details on using hashes here.

Supported by

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