Humbug: Do you build developer tools? Humbug helps you know your users.
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install humbugREADME as published on PyPI with version 0.3.2.
Humbug Python
The Humbug Python library.
Installation
Using pip
pip install humbug
From source
Clone this repository and enter this directory. Make sure you are in your desired Python environment and then run:
python setup.py install
Integration
To add Humbug to your project, first create a Bugout access token and journal following these instructions.
You can follow the recipes below to integrate Humbug into your codebase:
All reports are generated (and published) by a Humbug reporter. By default, Humbug publishes all
reports asynchronously and in the background. If you would like to publish selected reports
synchronously, all reporter methods take a wait=True argument.
If you plan to only use a reporter synchronously or to do your own thread management, you can instantiate the reporter in synchronous mode:
from humbug.report import Reporter, Modes
reporter = Reporter(
"<name>",
client_id="<client_id>",
session_id="<session_id>",
bugout_token="<bugout_token>",
bugout_journal_id="<bugout_journal_id>",
mode=Modes.SYNCHRONOUS,
)
Using Modes.SYNCHRONOUS in this manner skips the creation of the thread from which the reporter publishes reports.
Consent
Humbug cares deeply about consent. The innocuous HumbugConsent from the snippet above supports
a wide range of consent flows.
Opting in with environment variables
For example, if you would like your users to be able to opt in by setting an environment variable
MY_APP_CONSENT=true:
from humbug.consent import environment_variable_opt_in, HumbugConsent
from humbug.report import Reporter
consent = HumbugConsent(environment_variable_opt_in("MY_APP_CONSENT", ["true"]))
reporter = Reporter(
"<name of your project>",
consent,
bugout_token="<your Bugout token>",
bugout_journal_id="<your Bugout journal ID>",
)