Skip to main content

Feature flags, with a GUI - Redis backend

Project description

flypper-redis

Flypper-redis is a storage backend for the flypper package.

It is backed by Redis so it an be used in a distributed environment and be persisted across restarts.

Installation

Use the package manager pip to install flypper-redis.

pip install flypper-redis

Usage

Build a storage backend:

from redis import Redis
from flypper_redis.storage.redis import RedisStorage

redis = Redis(host="localhost", port=6379, db=0)
storage = RedisStorage(redis=redis, prefix="flypper-demo")

Use it in the web UI:

from flypper.wsgi.web_ui import FlypperWebUI

web_ui = FlypperWebUI(storage=storage)

Use it in your code:

  1. Build a client for your app
  2. Use a context
from flypper.client import Client as FlypperClient

# Once per thread
flypper_client = FlypperClient(storage=storage, ttl=10)

# Once per request
flypper_context = FlypperContext(
    client=flypper_client,
    entries={"user_id": "42"},
)

# Every time you need
flypper_context.is_enabled("flag_name")
flypper_context.is_enabled(
    "other_flag_name",
    entries={"item_reference": "blue-shampoo"},
)

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.

License

MIT

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

flypper-redis-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flypper_redis-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file flypper-redis-0.1.2.tar.gz.

File metadata

  • Download URL: flypper-redis-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.5 Linux/5.11.0-7633-generic

File hashes

Hashes for flypper-redis-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8878912d71e8034c54b796be3595c017acae045e55e6c71da660dccff6bc72bd
MD5 a19a8c8ee78e28c5a68e6b3d4ce6d658
BLAKE2b-256 97f1530b9e4da382ca1d55d18cea81ad8051be9efcde444f2f25a34b8d2168e8

See more details on using hashes here.

File details

Details for the file flypper_redis-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: flypper_redis-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.5 Linux/5.11.0-7633-generic

File hashes

Hashes for flypper_redis-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ab92c77d2036b0a3cbf98f3dffe68d459145b19206f1b1b5eab6377469c5660
MD5 e2b14aedb7b8065a305ad02a5ebd5b26
BLAKE2b-256 f20cd1a4c1b45e46f16fd8e46cb9aa2fa913ccbf24728dfe177199b2527aeb94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page