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 | Provenance | Actions |
|---|---|---|---|---|
| togglee-1.0.48.tar.gz | 8.2 kB | Without provenance | Details for togglee-1.0.48.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| togglee-1.0.48-py3-none-any.whl | Python 3 | none | any | Details for togglee-1.0.48-py3-none-any.whl |
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
|
Security for togglee 1.0.48
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.