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

mrflagly-0.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

mrflagly-0.2.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

mrflagly-0.2.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

mrflagly-0.2.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-pp37-pypy37_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp312-none-win_amd64.whl (955.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

mrflagly-0.2.5-cp312-none-win32.whl (910.4 kB view hashes)

Uploaded CPython 3.12 Windows x86

mrflagly-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl (2.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.2 MB view hashes)

Uploaded CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp311-none-win_amd64.whl (965.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

mrflagly-0.2.5-cp311-none-win32.whl (917.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

mrflagly-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.2 MB view hashes)

Uploaded CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp310-none-win_amd64.whl (965.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

mrflagly-0.2.5-cp310-none-win32.whl (917.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

mrflagly-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.2 MB view hashes)

Uploaded CPython 3.10 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp39-none-win_amd64.whl (965.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

mrflagly-0.2.5-cp39-none-win32.whl (917.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

mrflagly-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.2 MB view hashes)

Uploaded CPython 3.9 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mrflagly-0.2.5-cp38-none-win_amd64.whl (965.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

mrflagly-0.2.5-cp38-none-win32.whl (917.1 kB view hashes)

Uploaded CPython 3.8 Windows x86

mrflagly-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

mrflagly-0.2.5-cp37-none-win_amd64.whl (965.0 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

mrflagly-0.2.5-cp37-none-win32.whl (917.1 kB view hashes)

Uploaded CPython 3.7 Windows x86

mrflagly-0.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

mrflagly-0.2.5-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARMv7l

mrflagly-0.2.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

mrflagly-0.2.5-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

Supported by

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