Motivation
Simple library to separate deployment of features from release time. It uses network accesible files without the need of a server to provide feature toggles.
Installation
add it to your project using pip install togglee
Usage
from togglee import Togglee
url = "https://gist.githubusercontent.com/kanekotic/c469f99bef5a5c0634b4a94a4acd6546/raw/b67985d8e3a5112c9be2da47bdadf2cf17edbe44/toggles"
refresh_rate_seconds = 5
default_values = [
{
"name": "prop",
"type": "release",
"value": True
}
]
subject = Togglee(url, refresh_rate_seconds, default_values)
if subject.is_enabled("prop"):
print("do stuff")
else:
print("dont do stuff")
Type of toggles
Release
Simple true/false logical path definition.
{
"type": "release",
"value": true,
}
Context
Allows complex logic to decide the outcome of the logical path (example traffic, users, resources available).
{
"type": "context",
"conditions": [
{
"field": "username",
"value": "user1",
"operation": "eq"
}
]
}
available operations are:
‘eq’: equal (===)
‘ne’: not equal (!==)
‘gt’: greater than (>)
‘ge’: greater equal (>=)
‘lt’: lesser than (<)
‘le’: lesser qqual (<=)
Metadata
Release files for togglee 1.0.48
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| togglee-1.0.48.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| togglee-1.0.48-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / togglee-1.0.48.tar.gz
| Download URL | togglee-1.0.48.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
302ab0d8c8d26d19589032a7d6ad6b7ef914feed5633e1f4473dce5a93899cce
|
|
BLAKE2b-256 checksum How to use checksums |
db39d5efcf22b45dad62d041d91e4b9abe1bc102a51f34f1cfbade0873e788c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Release files / togglee-1.0.48-py3-none-any.whl
| Download URL | togglee-1.0.48-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1fd9bc52db305b172bde99cd74f489cda1d7a32975a3c714d67c5ed7b1043d53
|
|
BLAKE2b-256 checksum How to use checksums |
021e46949770ec5179457364754b84f77a4a37519086f862459fde9905254e55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|