Python Client

Even though featureflag.tech is still in closed alpha you can use our Node client right now with any other feature flag service. When featureflag.tech comes out of alpha we will update this documentation.

The client has the following attributes:

View featureflagclient on pypi.

Getting started

Install the client into your application via pip:

  pip install featureflagclient
      
Now require in the client and instantiate it. You need to pass the URL of your feature flag.

  from featureflagclient.client import Featureflagclient

  f2c = Featureflagclient("https://featureflag.tech/node/exampleflag.json")

  if (f2c.get( "trueBoolean" )) {
    // do some python
  }
      

Basic usage

You can interogate the client for flag value:


  featureflagclientclient.get( "newFeature" );
      

This can be used as a condition in if statements.

Overriding values for you to test features

You may want to override values in the feature flag. This is useful when you need to test a feature by enabling it just for yourself and not all of your users.

The constructor takes an optional 2nd parameter, this is an object literal of override values. For example:


  from featureflagclient.client import Featureflagclient

  f2c = Featureflagclient(
    "https://featureflag.tech/node/exampleflag.json",
    {
      "falseBoolean": req.param("falseBooleanOverride") or None
    }
  )

  if (f2c.get( "trueBoolean" )) {
    // do some python
  }
      

API reference

Constructor


  Featureflagclient( sourceFile, overrideValues );
      

Instantiates a new FeatureFlagClient object.

Arguments:

Properties:

Methods

get( featureName )


  get( "myNewFeature" );
      

Returns a feature value from the feature flag.

Returns: String.

Arguments: