Skip to main content

Flypper: feature flags, with a GUI

Flypper is a lightweight feature flag package that ships with a WSGI interface.

Installation

Use the package manager pip to install flypper.

pip install flypper

You might want to install one of the following backends instead:

Why

Feature flags can be instrumental to how a team ships software.

I have a hard take delegating such a critical part to a third-party. Also, third-parties tends to grow a bigger feature set than the one I need, to have a per-seat pricing, and to ask for a SSO tax.

Flypper aims at providing a simple feature flag library one could integrate directly to their application as a dependency. The feature set is purposedly small and will require some light work on your side to integrate.

Differences compared to other similar libraries are:

  • A scrappy web UI to manage the flags
  • An architecture aimed at being used on backends and front-ends
  • An efficient caching mecanism to avoid roundtrip to the database

Usage

The library works with 3 components:

  1. A storage backend, storing and retrieving flags in a durable way
  2. A client, acting as an efficient in-memory cache for reading flags
  3. A context, making flags consistents during its lifespan
Components and their roles
storage-client-context

Here is an example:

from redis import Redis

from flypper import Client as Flypper
from flypper_redis.storage.redis import RedisStorage

# Instanciate a *Storage*
redis_storage = RedisStorage(
    redis=Redis(host="localhost", port=6379, db=0),
    prefix="flypper-demo",
)

# Instanciate a *Client*
flypper = Flypper(storage=redis_storage)

# Query flags' statuses within a *Context*
with flypper(segment="professionals") as flags:
    if flags.is_enabled("graceful_degradation"):
        skip_that()
    elif flags.is_enabled("new_feature", user="42"):
        do_the_new_stuff()
    else:
        do_the_old_stuff()

The web UI acts as a client and only needs a storage:

from flypper.wsgi.web_ui import FlypperWebUI

flypper_web_ui = FlypperWebUI(storage=redis_storage)
Web UI
web-ui

The web UI can then be mounted as you see fit, for instance via DispatcherMiddleware.

app = DispatcherMiddleware(app, {"/flypper": flypper_web_ui})

⚠ Careful, you might need to wrap the FlypperWebUI with your own authentication layer, for instance like here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Work in progress you can contribute to

  • Testing the web UI with pytest and selenium
  • Better support prefixes within the web UI, so redirections work
  • Write tutorials and recipes in the docs/

Upcoming feature ideas

  • Javascript SDK
  • Tracking flags usage efficiently
  • More storage backends

Credits

Inspiration was heavily taken from the following projects.

Many thanks to their authors, maintainers, and contributors.

License

MIT

Metadata

Release files for flypper 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flypper 0.1.7
File Size Uploaded Provenance Actions
flypper-0.1.7.tar.gz 42.2 kB Without provenance Details for flypper-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flypper 0.1.7
File Interpreter ABI Platform Actions
flypper-0.1.7-py3-none-any.whl Python 3 none any Details for flypper-0.1.7-py3-none-any.whl

Total release size: 87.1 kB

Release files / flypper-0.1.7.tar.gz

Download URL flypper-0.1.7.tar.gz
Size 42.2 kB
Tags Source
SHA-256 checksum
How to use checksums
63a119eda8405be75eea2982f707fc96d58ca6dfa5a64301e9bd9beb074ee721
BLAKE2b-256 checksum
How to use checksums
1bf023d6bf23424c7b7f6d477de48bf8520043d2f76ff8375455e102bcfb7453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.5 Linux/5.11.0-7633-generic

Release files / flypper-0.1.7-py3-none-any.whl

Download URL flypper-0.1.7-py3-none-any.whl
Size 44.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f24fb63a33baf1413ff5a2ec35a66d9eeb0b07bf65104ce35b3082932959bba
BLAKE2b-256 checksum
How to use checksums
a25abb02e97ce0690913b8bee1eda32580cee1a567e976b1e47a4161538d9682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.5 Linux/5.11.0-7633-generic

Security for flypper 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page