Flager
Feature flags updater for python
Installation
pip install flager
Features
- Anyio
- Abstract code for any backend, e.g., flipt, redis, etc.
Usage
feature flags updater
import asyncio
from dataclasses import dataclass
from typing import Dict, Optional
from flager import FeatureFlagsUpdater
async def show_flags(flags: Dict[str, bool]) -> None:
while True:
print(flags)
await asyncio.sleep(1)
async def main() -> None:
flags = {"flag_1": False}
ff_updater = FeatureFlagsUpdater([flags], client=Client(), interval=5)
await asyncio.gather(ff_updater.run(), show_flags(flags))
@dataclass
class Flag:
key: str
enabled: Optional[bool]
class Client:
flags = {"flag_1": Flag("flag_1", True)}
async def get_flag(self, key: str) -> Optional[Flag]:
return self.flags[key]
asyncio.run(main())
feature flag proxy
from flager import FeatureFlagsProxy
async def main() -> None:
flags = {"flag_1": False}
flags_proxy = FeatureFlagsProxy(flags, client=Client())
print(await flags_proxy["flag_1"])
License
Contribution
Metadata
Release files for flager 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flager-0.1.2.tar.gz | 4.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flager-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / flager-0.1.2.tar.gz
| Download URL | flager-0.1.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20069190bb73b099c2c3c2a45d93b562c5a72adadeddcc7b282fdb5bf1fd7515
|
|
BLAKE2b-256 checksum How to use checksums |
300a67d62337e00b834615ef0c983b08131254b4228725cad84940ba7b260f9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.8.18 Linux/6.2.0-1012-azure
|
Release files / flager-0.1.2-py3-none-any.whl
| Download URL | flager-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4cd26b8277c4f27e221c3d59f2abc347230eb1a30c10080d8daaa8631b98da3d
|
|
BLAKE2b-256 checksum How to use checksums |
8909ce9ce29bdd6df327a171b8c4c965a00157156da687576508db17096392f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.8.18 Linux/6.2.0-1012-azure
|
Security for flager 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.