A minimal, dependency-free feature flag implementation for FastAPI applications.
FastAPI Feature Flags is a Python library that adds feature flag functionality to FastAPI applications. It allows developers to toggle features on or off dynamically, enabling safer deployments, A/B testing, and gradual feature rollouts without code changes.
Backend developers and teams building FastAPI-based services who need to manage feature releases, conduct experiments, or control feature visibility in production environments.
It stands out for its minimal configuration, lack of external dependencies, and seamless integration with FastAPI, making it a lightweight yet reliable choice for feature flag management.
FastAPI Feature Flags
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports loading flags from JSON files, URLs, dictionaries, and environment variables, as demonstrated in the README with examples like load_conf_from_url and load_conf_from_json.
Allows enabling or disabling features on the fly with methods like enable_feature, and reloading configurations dynamically via reload_feature_flags, enabling quick adjustments without redeploys.
Unregistered flags default to false, preventing unintended feature exposure, which is explicitly highlighted in the README as a safety measure.
Includes a built-in FastAPI router with Swagger UI for non-production testing, making it easy to visualize and manage flags during development, as shown in the usage section.
The library only supports basic boolean flags without built-in functionality for user-specific or contextual toggles, restricting advanced use cases like A/B testing with targeted audiences.
Flags are loaded from static sources like files or URLs, lacking real-time updates or database integration, which can be inefficient for dynamic, high-frequency changes in distributed systems.
The built-in router is recommended to be excluded in production using include_in_schema=False, indicating it's not fully optimized for secure, scalable live environments.