Skip to main content

Flask feature flag

Project description

Flask feature flag

Tool to activate and deactivate project functionalities

pipeline status coverage report

Package installation

  • Installation
    $ pip3 install flask-feature-flag


  • Feature flag type availables.

    • MONGO
  • Define the following to your


    FEATURE_FLAG_TYPE is required.

  • You should add this to your if it's feature type FLASK_CONFIG

        'ROUTE_ENABLED': os.environ.get('ROUTE_ENABLED', True)

    FEATURE_FLAGS is required.



is_enabled this decorator allows to activate or deactivate a functionality and receives as parameters a function to return in case feature is disabled and the name of the feature

from flask import Flask
from flask_caching import Cache
from flask_feature_flag import Flag

config = {
    "DEBUG": True,
    "CACHE_TYPE": "simple",
app = Flask(__name__)
# tell Flask to use the above defined config
cache = Cache(app)
flag = Flag(app, cache)

def error():
    return dict(massage='this is a mistake')

@flag.is_enabled(error, 'ENV_HELLO')
def hello(name):
    return dict(message=f'Hi, {name}')

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

flask_feature_flag-0.2.1.tar.gz (5.0 kB view hashes)

Uploaded source

Built Distribution

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