flypper-redis-0.1.2
توضیحات
Feature flags, with a GUI - Redis backend
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | flypper-redis-0.1.2 |
| نام | flypper-redis |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Nicolas Zermati |
| ایمیل نویسنده | nicoolas25@gmail.com |
| آدرس صفحه اصلی | https://github.com/nicoolas25/flypper-redis |
| آدرس اینترنتی | https://pypi.org/project/flypper-redis/ |
| مجوز | - |
# flypper-redis
Flypper-redis is a storage backend for the [flypper](https://github.com/nicoolas25/flypper) package.
It is backed by Redis so it an be used in a distributed environment and be persisted across restarts.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `flypper-redis`.
```bash
pip install flypper-redis
```
## Usage
Build a storage backend:
```python
from redis import Redis
from flypper_redis.storage.redis import RedisStorage
redis = Redis(host="localhost", port=6379, db=0)
storage = RedisStorage(redis=redis, prefix="flypper-demo")
```
Use it in the web UI:
```python
from flypper.wsgi.web_ui import FlypperWebUI
web_ui = FlypperWebUI(storage=storage)
```
Use it in your code:
1. Build a client for your app
2. Use a context
```python
from flypper.client import Client as FlypperClient
# Once per thread
flypper_client = FlypperClient(storage=storage, ttl=10)
# Once per request
flypper_context = FlypperContext(
client=flypper_client,
entries={"user_id": "42"},
)
# Every time you need
flypper_context.is_enabled("flag_name")
flypper_context.is_enabled(
"other_flag_name",
entries={"item_reference": "blue-shampoo"},
)
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)
نیازمندی
| مقدار | نام |
|---|---|
| >=0.1.0,<0.2.0 | flypper |
| >=3.5.3,<4.0.0 | redis |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl flypper-redis-0.1.2:
pip install flypper-redis-0.1.2.whl
نصب پکیج tar.gz flypper-redis-0.1.2:
pip install flypper-redis-0.1.2.tar.gz