Skip to main content

light-weight feature flags

Project description

Static Badge Static Badge PyPI - Python Version GitHub last commit (branch) PyPI - Downloads

PyPI version pylint_badge unittest_badge mypy PyPI - License

FastFeatureFlag is a lightweight tool to generate and use feature flags. Build in python for python. The key components are:

  • easy to add feature flag(s)
  • easily activate/deactivate features
  • naming/grouping flags
  • define custom response for flagged features
  • use environment variables as your on/off switch
  • manage feature flags with a simple toml file
  • define a shadow method which should be executed instead of your deactivated feature

🛠 Installation

pip install fastfeatureflag
poetry add fastfeatureflag

🏳 flag away ...

💡 Take a look at the decorator feature_flag() - that is all you need.

from fastfeatureflag.feature_flag import feature_flag

@feature_flag("off")
def broken_feature():
    return "I am broken"

broken_feature()
NotImplementedError: Feature not implemented

Copyright (c) 2012-2023 Sebastian Rieser flyingsepl@googlemail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.4.1 (2023-10-29)

0.4.0 (2023-10-28)

Feat

  • feature_flag: enable self within decorated functions
  • feature_flag: pytest compatibility via .pytest()

0.3.0 (2023-10-25)

Feat

  • feature_flag: use shadow to call a different function/method
  • all: feature flag configuration by file

Fix

  • feature_flag_configuration: updating and synchronising features

Refactor

  • all/*: reduces complexity

0.2.0 (2023-09-02)

Feat

  • all: featuer flag configuration by file
  • flaggen: load configuration

Refactor

  • flaggen: simplified code

0.1.0 (2023-08-14)

Feat

  • feature_flag: add named feature

Fix

  • flaggen: improved the feuatre flag naming
  • feauter_flag: added stateful decorator
  • flaggen,-docs: added dynamic output to feature flag
  • pyflag: simple featue flag implementation

Project details


Download files

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

Source Distribution

fastfeatureflag-0.4.1.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

fastfeatureflag-0.4.1-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

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