Flask-Unleash
Flask extension to make using Unleash that much easier! 🚦🚦🚦 This plugin makes integrating the Python Unleash client into quick and easy.
Pre-requisites
To try out Flask-Unleash, you'll need an instance of the Unleash server. You can either use:
- Spin up a stack in Docker Compose using unleash-docker
- Check out the demo at Unleash-Hosted
Quickstart
Install Flask-Unleash using pip.
pip install Flask-Unleash
Next, add Flask-Unleash to your code.
from flask import Flask
from flask_unleash import Unleash
app = 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
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': 'hamster@hamster.com'
}
flag_value_2 = unleash.client.is_enabled("complex-feature", context)
Check out the demo app for a more real-life sample implementation.
Configuring Flask-Unleash
See the Flask-Unleash documentation for information about configuring Unleash.
Metadata
Release files for flask-unleash 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask_unleash-2.1.0.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_unleash-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.3 kB
Release files / flask_unleash-2.1.0.tar.gz
| Download URL | flask_unleash-2.1.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9377743ce689c69e7278bf19f8597fc7ff29059f96ee29334ffeb28699081f9b
|
|
BLAKE2b-256 checksum How to use checksums |
2d0fd7cabff7c4b995449d82deb7c3c20070812d101bd04774c5bdbb39eff3a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|
Release files / flask_unleash-2.1.0-py3-none-any.whl
| Download URL | flask_unleash-2.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
324e138628d6219e1a2dbcecb3e7d517c790689ad5100bc98c174ecd78cf3f30
|
|
BLAKE2b-256 checksum How to use checksums |
238c08a8dbeb573adbc6bf70066b51e85262182034e95c7e491401dd1320ff8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|