Introduction
Feature flagging should not be so complicated.
Mr Flagly is a decentralized feature flagging system written in Rust with bindings for other languages.
It does not depend on third party services or require you to deploy services and databases to manage.
Supported feature flag definition sources:
- URL
- JSON Value
- Environment Variable
Rust usage
Setup your flag service:
use mrflagly::service::{FlagService, FlagServiceOptions};
let flag_service = FlagService::new(FlagServiceOptions {
finder_type: mrflagly::service::types::FlagFinderType::URL,
url: "https://path/to/hosted/json/file",
refresh_interval: 600,
data: None,
env_var: None,
})
Then, to check for feature flag:
if flag_service.enabled("feature_x", false /* default value */, Some(HashMap::from([(String::from("user_id"), String::from("123")),])) /* optional context */) {
// do something
}
Python support
import mrflagly
flag_service = mrflagly.FlagService(url="https://path/to/hosted/json/file")
if flag_service.enabled("feature_x", default=False, context={"foo": "bar"}):
# do something
FlagService constructor parameters
finder_type: (NULL, URL, JSON, ENVVAR)url: URL to download feature flag json datarefresh_interval: How often to poll the feature flag data endpointdata: Instead of hosting feature flag data from URL, you can provide it as a json blobenv_var: Provide feature flag data in environment variable
JSON format
JSON format for feature flag data:
{
"my_feature": {
"rollout": 100
},
"my_feature_with_variants": {
"rollout": 0,
"variants" {
"user_id": ["123"],
"company_id": ["123"]
}
}
}
Example activating for a particular customer
JSON config data:
{
"feature": {
"rollout": 0,
"variants": {
"customer_id": ["123"]
}
}
}
Usage:
import mrflagly
import json
flag_service = mrflagly.FlagService(
data=json.dumps({"feature": {"rollout": 0, "variants": {"customer_id": ["123"]}}}))
if flag_service.enabled("feature_x", default=False, context={"customer_id": "123"}):
# do something
Release files for mrflagly 0.2.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| mrflagly-0.2.15-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-32 | Details |
| mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARMv7l | Details |
| mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size:9.5 MB
Release files / mrflagly-0.2.15-cp310-abi3-win_amd64.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f15005f1cfffe17b80e5d35781aa5e1203abcdbca14c675c4938d4e2b1040469
|
|
BLAKE2b-256 checksum How to use checksums |
9c80d867e09e3431d3d9a8ff2ef493caf8337acb8c2c30c03171adc0d7235b79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3deedc1f26584e12a95ac13bbab304ec6c4657138ed299bbb727284a77f718a2
|
|
BLAKE2b-256 checksum How to use checksums |
c50f6ce09398fb678863196f240468348e65f0714af870423bc632a4df7432bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
02ae2c3555db82d354426dc8353bc69258135b6f5ee3533fa88933bd0783470c
|
|
BLAKE2b-256 checksum How to use checksums |
96c351f0a1697c851cde31cb517736d82d304336c9d219170bb38c429685f6bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
0a8dc20755828cdce95c93fa5530a4241ed026f23d6ab1027d4f7bbe01638e75
|
|
BLAKE2b-256 checksum How to use checksums |
8c5b3b9b26e0945a76cdaf119f6f68e6a0dbf1c72771c41d2abc4c60f054cb68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
92facb4bde08a1f7d7ad382293d6de3aa0d69c84d66cb92cdb47f24e51945dca
|
|
BLAKE2b-256 checksum How to use checksums |
6070e65bb992c0b14f9710386e4b915203369e54a6889d346f5b209011ce2013
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
872d4bd8212bb5c2ee7e736e78e316cc1473ad5dbe025abe21f177e052752e14
|
|
BLAKE2b-256 checksum How to use checksums |
c4eb2d40da3c72931b1dd77478995da5f6aec56c0f1f8b236c66060427f4c229
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|
Release files / mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
64bc75f37cc4eb72f4327d220125aca14110190149b01da7117a875dd08296c0
|
|
BLAKE2b-256 checksum How to use checksums |
6144a74573e48cf622b39fe2dd133f41f374481612f7a3f46c15a4d29f95347f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.12.6
|