Skip to main content

Flask feature flag

Project description

Flask feature flag

Tool to activate and deactivate project functionalities

pipeline status coverage report

Environment

  • Create
    $ python3 -m venv venv
    
  • Activate
    $ source venv/bin/activate
    
  • Deactivate
    $ deactivate
    

Package installation

  • Installation

    $ pip3 install flask-feature-flag
    
  • You should add this to your config.py

    FEATURE_FLAGS = {
        'ROUTE_ENABLED': os.environ.get('ROUTE_ENABLED', True)
    }
    

    FEATURE_FLAGS is required

Docs

Example:

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

```python
from flask_feature_flag import is_enabled

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

@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.0.4.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

flask_feature_flag-0.0.4-py3-none-any.whl (4.0 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