Skip to main content

Production-ready feature flags library for Litestar

Project description

litestar-flags

Production-ready feature flags for Litestar applications.

PyPI version Python versions License

Installation

uv add litestar-flags

# With extras
uv add litestar-flags[redis]      # Redis backend
uv add litestar-flags[database]   # SQLAlchemy backend
uv add litestar-flags[workflows]  # Approval workflows
uv add litestar-flags[all]        # Everything

Quick Start

from litestar import Litestar, get
from litestar_flags import FeatureFlagsPlugin, FeatureFlagsConfig, FeatureFlagsClient

config = FeatureFlagsConfig()
plugin = FeatureFlagsPlugin(config=config)

@get("/")
async def index(feature_flags: FeatureFlagsClient) -> dict:
    if await feature_flags.is_enabled("new_checkout"):
        return {"flow": "new"}
    return {"flow": "legacy"}

app = Litestar(plugins=[plugin])

Features

  • Multiple backends - Memory, Redis, and SQLAlchemy storage
  • Percentage rollouts - Gradual releases with consistent hashing
  • User targeting - Rules based on user attributes
  • A/B testing - Weighted variants for experiments
  • Time-based rules - Scheduled launches and maintenance windows
  • OpenFeature support - Vendor-agnostic evaluation via OpenFeature SDK
  • Approval workflows - Human-in-the-loop governance for enterprise use

Documentation

Full docs at flags.litestar.scriptr.dev.

Development

git clone https://github.com/JacobCoffee/litestar-flags.git
cd litestar-flags
uv sync --all-extras
uv run pytest

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

litestar_flags-0.1.1.tar.gz (82.6 kB view details)

Uploaded Source

Built Distribution

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

litestar_flags-0.1.1-py3-none-any.whl (106.8 kB view details)

Uploaded Python 3

File details

Details for the file litestar_flags-0.1.1.tar.gz.

File metadata

  • Download URL: litestar_flags-0.1.1.tar.gz
  • Upload date:
  • Size: 82.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for litestar_flags-0.1.1.tar.gz
Algorithm Hash digest
SHA256 da057298fd5abaa66a67e214ee906fd5d223cd3fa2c27b1a846dd34e2ef1f5b0
MD5 b26f794e028f5fa17ae2338dc7203c1b
BLAKE2b-256 f247a5b1b94fac1dd56b0f3f15d573f38730865b9965e3ac93c979442e45594e

See more details on using hashes here.

Provenance

The following attestation bundles were made for litestar_flags-0.1.1.tar.gz:

Publisher: publish.yml on JacobCoffee/litestar-flags

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litestar_flags-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: litestar_flags-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 106.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for litestar_flags-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aaade1dc87e796a844b65ea7362ba69145df1572520256289c0b31cfc81f50b
MD5 c66c858b1e22bd5ec19caf74a468590f
BLAKE2b-256 ca24353e4502ebae1d0176c8501af52b9cc534c74e8b55db8ddd04876f904a04

See more details on using hashes here.

Provenance

The following attestation bundles were made for litestar_flags-0.1.1-py3-none-any.whl:

Publisher: publish.yml on JacobCoffee/litestar-flags

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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