Quickstart
Install the package:
uv add lexigram-featuresMinimal example
Section titled “Minimal example”import asynciofrom lexigram import Applicationfrom lexigram.features import FeatureFlagsModule, FeatureFlagsConfig
async def main() -> None: config = FeatureFlagsConfig(initial_flags={"new_checkout": True}) async with Application.boot(name="my-app", modules=[FeatureFlagsModule.configure(config=config)]) as app: from lexigram.contracts.feature_flags import FlagProviderProtocol
flags = await app.container.resolve(FlagProviderProtocol) enabled = await flags.get_flag("new_checkout") print(f"new_checkout enabled: {enabled}") # True
asyncio.run(main())What just happened
Section titled “What just happened”FeatureFlagsModule.configure()registeredFlagProviderProtocolandFlagManagersingletons in the container- The
LocalProviderwas seeded withnew_checkout → Truefrominitial_flags FlagProviderProtocol.get_flag()evaluated the flag synchronously from the in-memory store
Next steps
Section titled “Next steps”- Guide — mental model, flag types, evaluation, decorators
- Architecture — provider, backends, contracts, lifecycle
- Configuration — cache TTL, env prefix, initial flags
- How-Tos — percentage rollouts, A/B testing, feature gates