Skip to main content

No nonsense feature flagging system

Project description

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 data
  • refresh_interval: How often to poll the feature flag data endpoint
  • data: Instead of hosting feature flag data from URL, you can provide it as a json blob
  • env_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mrflagly-0.2.15-cp310-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows x86-64

mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ i686

mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARMv7l

mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file mrflagly-0.2.15-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f15005f1cfffe17b80e5d35781aa5e1203abcdbca14c675c4938d4e2b1040469
MD5 8c3774a116a71c49f6bbd391ebaa45fa
BLAKE2b-256 9c80d867e09e3431d3d9a8ff2ef493caf8337acb8c2c30c03171adc0d7235b79

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3deedc1f26584e12a95ac13bbab304ec6c4657138ed299bbb727284a77f718a2
MD5 410ecaff6c9c6fc12e262e41df65ca6f
BLAKE2b-256 c50f6ce09398fb678863196f240468348e65f0714af870423bc632a4df7432bc

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 02ae2c3555db82d354426dc8353bc69258135b6f5ee3533fa88933bd0783470c
MD5 22ebb9a5a90e762c11392571b503a1ca
BLAKE2b-256 96c351f0a1697c851cde31cb517736d82d304336c9d219170bb38c429685f6bf

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 0a8dc20755828cdce95c93fa5530a4241ed026f23d6ab1027d4f7bbe01638e75
MD5 ffbcdc0221a9ab7bbc3b0a8682d23420
BLAKE2b-256 8c5b3b9b26e0945a76cdaf119f6f68e6a0dbf1c72771c41d2abc4c60f054cb68

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 92facb4bde08a1f7d7ad382293d6de3aa0d69c84d66cb92cdb47f24e51945dca
MD5 6dbe83da9dd8771dd77f40639dcf6930
BLAKE2b-256 6070e65bb992c0b14f9710386e4b915203369e54a6889d346f5b209011ce2013

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 872d4bd8212bb5c2ee7e736e78e316cc1473ad5dbe025abe21f177e052752e14
MD5 78c3e89db5df2e52d494265c925ab7b1
BLAKE2b-256 c4eb2d40da3c72931b1dd77478995da5f6aec56c0f1f8b236c66060427f4c229

See more details on using hashes here.

File details

Details for the file mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.15-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 64bc75f37cc4eb72f4327d220125aca14110190149b01da7117a875dd08296c0
MD5 57a989df4679930a410df03b98304ae5
BLAKE2b-256 6144a74573e48cf622b39fe2dd133f41f374481612f7a3f46c15a4d29f95347f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page