Skip to main content

A client for the ablator feature-switching server

Project description

This is karman – a Python Client for the ablator project.

Using karman, you can connect to a hosted or self-hosted instance of ablator, and check which functionalities to present to your user.

Installation

To install karman, use pip:

pip install karman

Usage

You can include karman.py in your code and use its which and caniuse methods.

To do so, you’ll need a username – basically any string that uniquely identifies one of your users – and the functionality id, which you can copy and paste from the ablator web interface:

import karman
username = "(your user name string)"
functionality_id = "f8077bfe-bb42-404c-a0d0-3fa107b01860"
ablator_client = karman.Karman(base_url='http://ablator.space/')
availability = ablator_client.which(username, functionality_id)

# this will return one of the following:
# availability == "breakthesystem.test-app.test-func.on"
# availability == None

Both the which and the caniuse methods are blocking and will only return once they get an answer from the ablator server. There is no caching implemented at the moment.

The which method will return either a string that corresponds to the flavor slug of the flavor that was selected for your user, or None, if the functionality is disabled for your user.

The caniuse method will return True if any flavor is activated for your user, and False otherwise. Use this method if you only want to use ablator to roll out a functionality, as opposed to a/b testing.

Command Line

If you install karman via pip, you also get the karman command line tool. To use it run it like this:

karman --base_url http://ablator.space/ <username> <functionality_id>

Add the -c parameter to continuously query the ablator server. If that’s too fast add slow parameter as well like this: -c -s

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

karman-1.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

karman-1.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file karman-1.0.1.tar.gz.

File metadata

  • Download URL: karman-1.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for karman-1.0.1.tar.gz
Algorithm Hash digest
SHA256 077393ec67affc07b7335003360d72c663721ae21349fdd03554257b9f13a1fa
MD5 6f9637acfc017823fa01f588d056e188
BLAKE2b-256 73ab1f26263ba4a4fbc15227d92929e7e9a458fd220f51817310724fb71ca42d

See more details on using hashes here.

File details

Details for the file karman-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for karman-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd5773c398d6a5a3d706e1be0bbafe7e57ed58daa58b11b4ce02a3d474fa59a6
MD5 a5d96509cb8140ea98e8d631e66329c0
BLAKE2b-256 ce11a34f36ac08e8a9c238b37ff58f01cdf59e9636c548432b175e289b78fcc2

See more details on using hashes here.

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