Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unleash/flask-unleash
Flask extension to make using Unleash that much easier! 🚦🚦🚦
https://github.com/unleash/flask-unleash
Last synced: 7 days ago
JSON representation
Flask extension to make using Unleash that much easier! 🚦🚦🚦
- Host: GitHub
- URL: https://github.com/unleash/flask-unleash
- Owner: Unleash
- License: mit
- Created: 2019-10-10T12:02:55.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-03T09:35:31.000Z (5 months ago)
- Last Synced: 2024-10-07T02:17:15.857Z (about 1 month ago)
- Language: Python
- Homepage: https://unleash.github.io/Flask-Unleash/
- Size: 5.49 MB
- Stars: 6
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Flask-Unleash
![](https://github.com/unleash/flask-unleash/workflows/CI/badge.svg?branch=main) [![Coverage Status](https://coveralls.io/repos/github/Unleash/Flask-Unleash/badge.svg?branch=main)](https://coveralls.io/github/Unleash/Flask-Unleash?branch=main) [![PyPI version](https://badge.fury.io/py/flask-unleash.svg)](https://badge.fury.io/py/flask-unleash) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flask_unleash) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Flask extension to make using Unleash that much easier! 🚦🚦🚦 This plugin makes integrating the [Python Unleash client](https://github.com/unleash/unleash-client-python) into quick and easy.
* [Documentation](https://unleash.github.io/Flask-Unleash/)
* [Changelog](https://docs.getunleash.io/Flask-Unleash/changelog.html)## Pre-requisites
To try out Flask-Unleash, you'll need an instance of the [Unleash](http://github.com/unleash/unleash) server. You can either use:
* Spin up a stack in Docker Compose using [unleash-docker](https://github.com/Unleash/unleash-docker)
* Check out the demo at [Unleash-Hosted](https://www.unleash-hosted.com/)## Quickstart
Install Flask-Unleash using pip.```python
pip install Flask-Unleash
```Next, add Flask-Unleash to your code.
```Python
from flask import Flask
from flask_unleash import Unleashapp = Flask(__name__)
app.config["UNLEASH_URL"] = "http://localhost:4242/api"
app.config["UNLEASH_APP_NAME"] = "demoapp"
unleash = Unleash(app)
```Now you can use the client to check feature flags
```Python
flag_value_1 = unleash.client.is_enabled("simple-feature")# You can pass in a context object (https://unleash.github.io/docs/unleash_context) for more complex features.
context = {
'userId': '[email protected]'
}
flag_value_2 = unleash.client.is_enabled("complex-feature", context)
```Check out the [demo app](https://github.com/Unleash/Flask-Unleash/tree/main/demo_app) for a more real-life sample implementation.
## Configuring Flask-Unleash
See the [Flask-Unleash documentation](https://docs.getunleash.io/Flask-Unleash/) for information about configuring Unleash.