Skip to main content

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

Release files for karman 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for karman 1.0.1
File Size Uploaded
karman-1.0.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for karman 1.0.1
File Interpreter ABI Platform
karman-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size:10.4 kB

Release files / karman-1.0.1.tar.gz

Download URL karman-1.0.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
077393ec67affc07b7335003360d72c663721ae21349fdd03554257b9f13a1fa
BLAKE2b-256 checksum
How to use checksums
73ab1f26263ba4a4fbc15227d92929e7e9a458fd220f51817310724fb71ca42d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / karman-1.0.1-py3-none-any.whl

Download URL karman-1.0.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd5773c398d6a5a3d706e1be0bbafe7e57ed58daa58b11b4ce02a3d474fa59a6
BLAKE2b-256 checksum
How to use checksums
ce11a34f36ac08e8a9c238b37ff58f01cdf59e9636c548432b175e289b78fcc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page