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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 077393ec67affc07b7335003360d72c663721ae21349fdd03554257b9f13a1fa |
|
MD5 | 6f9637acfc017823fa01f588d056e188 |
|
BLAKE2b-256 | 73ab1f26263ba4a4fbc15227d92929e7e9a458fd220f51817310724fb71ca42d |
File details
Details for the file karman-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: karman-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd5773c398d6a5a3d706e1be0bbafe7e57ed58daa58b11b4ce02a3d474fa59a6 |
|
MD5 | a5d96509cb8140ea98e8d631e66329c0 |
|
BLAKE2b-256 | ce11a34f36ac08e8a9c238b37ff58f01cdf59e9636c548432b175e289b78fcc2 |