Skip to main content

simple_module_feature_flags

Feature flags for simple_module apps. Global flags with per-tenant overrides, a tiny consumer API, and no external service to run.

Install

pip install simple_module_feature_flags

What it provides

  • Flags are declared via the framework register_feature_flags hook (FeatureFlagDefinition(name, default_enabled=...)); the module persists only overrides in the feature_flags_override SQLModel table (scoped by scope / scope_id).
  • FeatureFlagRegistry.is_enabled("flag.name", tenant_id=...) consumer API (resolution order: tenant override > system override > declared default).
  • Admin UI at /feature_flags — toggle flags, add per-scope overrides.
  • The registry is an in-memory cache hydrated from the DB so checking a flag on every request is cheap.

Usage

Declare a flag in your module:

from simple_module_core.feature_flags import FeatureFlagDefinition, FeatureFlagRegistry


class OrdersModule(ModuleBase):
    def register_feature_flags(self, registry: FeatureFlagRegistry) -> None:
        registry.add(FeatureFlagDefinition(name="orders.new_pricing_engine", default_enabled=False))

Gate a route using the registry dependency:

from fastapi import APIRouter, HTTPException

from feature_flags.web.deps import FeatureFlagRegistryDep

router = APIRouter()


@router.get("/new-feature")
async def new_feature(flags: FeatureFlagRegistryDep):
    if not flags.is_enabled("orders.new_pricing_engine"):
        raise HTTPException(404)
    return {"rolled_out": True}

Overrides (system or per-tenant) are managed through the admin UI at /feature_flags.

Depends on

  • simple_module_core, simple_module_db, simple_module_hosting

License

MIT — see LICENSE.

Metadata

Release files for simple-module-feature-flags 0.0.46

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

Source distribution (sdist)

Source distribution for simple-module-feature-flags 0.0.46
File Size Uploaded Provenance Actions
simple_module_feature_flags-0.0.46.tar.gz 29.5 kB With provenance Details for simple_module_feature_flags-0.0.46.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-module-feature-flags 0.0.46
File Interpreter ABI Platform Actions
simple_module_feature_flags-0.0.46-py3-none-any.whl Python 3 none any Details for simple_module_feature_flags-0.0.46-py3-none-any.whl

Total release size: 57.1 kB

Release files / simple_module_feature_flags-0.0.46.tar.gz

Download URL simple_module_feature_flags-0.0.46.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
053546d4f9c1d34a94e8f24293851acdac728b8a97c42e4f267f44a97bd6369d
BLAKE2b-256 checksum
How to use checksums
a5178e0a55cb5f68d4e29be56868d246b630b44cbb480bdcc8498c50da5fa514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Release files / simple_module_feature_flags-0.0.46-py3-none-any.whl

Download URL simple_module_feature_flags-0.0.46-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5280e372d9079d9c7bc29c97f58e000fe984d8be7676d391fd91f6b5dc391367
BLAKE2b-256 checksum
How to use checksums
2448e6a2b4bab47331d0d7ee3f27d9a744889d6dbf3207cb6f9e68b38365aa4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 13, 2026.

Transparency log

Security for simple-module-feature-flags 0.0.46

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simple_module_feature_flags-0.0.46.tar.gz

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 Nov 13, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.0.46 This release

2 release files Full provenance

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