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.14-cp310-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows x86-64

mrflagly-0.2.14-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.14-cp310-abi3-manylinux_2_28_i686.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ i686

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

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARMv7l

mrflagly-0.2.14-cp310-abi3-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

mrflagly-0.2.14-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.14-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e993c58f084041626b04916973d23b970300be17986a93b45c4e43e187dc8cd6
MD5 baa38eeb7f658961eea75a1b85ab450d
BLAKE2b-256 dd08a77ff5c4d48758f544df241e08b44d26a02b9fd99b5ae54eba37ac53a39b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1ebae9fed3ac61369713c85844729e0b0f419e2c719b89dbeb6639b6f2c909ae
MD5 1c331a01b777afc8e62de4395ec64ba7
BLAKE2b-256 7a8e7ad19339766e6e3cc9d5535f2e3976f580a1f02fc802e1a04d58112d429b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 31c1f115489d93442a8f94d526e38e9912929d11ddb09906f9df1f13951e1111
MD5 b9c6cb192f30886cf96ec9787957c42b
BLAKE2b-256 fd492b43dd9ea49741b90e844ac5e475434fb2a20ebe2fe6eb1ed82470c1d5e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 7d4c41a41f064da68d96d650ea9bf495bf353fb9faeb4882640c23de5fb585ee
MD5 c89cc96bfbc902c51d666989b44657d3
BLAKE2b-256 f5194e41d02157f98ba3f971f3f9348b43eddb3e7d83ee81cf2e65a31f250346

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 667477cb21e5832821a6c316e13a643876c4c177f6af24fc2576e9e03360b51d
MD5 4eb7ff1700f94f3e0b35b7848c5d9895
BLAKE2b-256 1e86eda1ff8b3e5451817db1b86053f51b9a03b3a56880ba3b155a9048e9147b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a29b22d3e43dafedd706993e3cd0d7ea383353e9bf0381d35641d11fa3ab4165
MD5 e47748ecdebebd5efd43c1bf46029062
BLAKE2b-256 0901f4854507dffe95c091b3c95570a573e219916976dc29c8a37b6ecfcff539

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mrflagly-0.2.14-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e15e777b554988844b221fae4b2f30e48d16b94bf02c10905497629ef327fd54
MD5 0a9d2a70a39ffdadf23e301b56a8517b
BLAKE2b-256 e9b87383297daa5cbeae7a5330727e93f6c625c4e11bd641b90d949551843c01

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