Skip to main content

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[openfeature]  # OpenFeature SDK provider
uv add litestar-flags[prometheus]   # Prometheus metrics
uv add litestar-flags[observability] # OpenTelemetry + structlog
uv add litestar-flags[all]          # Everything

Quick Start

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

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

@get("/")
async def index(feature_flags: FeatureFlagClient) -> 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
  • Segment-based targeting - Reusable user groups for complex targeting
  • A/B testing - Weighted variants for experiments
  • Time-based rules - Scheduled launches and maintenance windows
  • Multi-environment - Environment inheritance, promotion, and per-env configs
  • Admin API - REST endpoints for flag management with RBAC and audit logging
  • Analytics - Evaluation tracking, metrics, and Prometheus export
  • 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

Metadata

Release files for litestar-flags 0.2.1

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

Source distribution (sdist)

Source distribution for litestar-flags 0.2.1
File Size Uploaded
litestar_flags-0.2.1.tar.gz 172.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for litestar-flags 0.2.1
File Interpreter ABI Platform
litestar_flags-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 391.2 kB

Release files / litestar_flags-0.2.1.tar.gz

Download URL litestar_flags-0.2.1.tar.gz
Size 172.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5f727f523034e536ec1a51abb07acddb1c3474e74a2664647a3506ffcec064b6
BLAKE2b-256 checksum
How to use checksums
8ecaf02a76d3626447d652303ad67111a73bd60391be6d563552c405fa6c218b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.

Transparency log

Release files / litestar_flags-0.2.1-py3-none-any.whl

Download URL litestar_flags-0.2.1-py3-none-any.whl
Size 218.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4d519ec98f66915c9be16332baa453032e2b89f95e64c8890f1f0f3c5ac454
BLAKE2b-256 checksum
How to use checksums
b74dc945008b3d17faec8aa8b2aac91ebc298e325888e6fa162cf7ad006a1f47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

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