Registry / observability / honeybadger

honeybadger

JSON →
library1.2.3pypypi✓ verified 85d ago

Honeybadger Python is the official client library for sending Python and Django errors to Honeybadger.io. It provides real-time error tracking, uptime monitoring, and performance insights for applications built with frameworks like Django, Flask, and Celery, as well as general Python applications and AWS Lambda functions. The library is actively maintained, with version 1.2.2 being the latest, and receives frequent updates including bug fixes and minor features.

pip install honeybadger
INSTALL
IMPORT
SIG · HONEYBADGER
H
honeybadger
observabilitypythonv1.2.3
Install
1.8s avg
Import
124ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.129s · 18.9MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 1.8s · import 0.118s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

honeybadger
import honeybadger
configure
honeybadger.configure(...)
notify
honeybadger.notify(...)
set_context
honeybadger.set_context(...)
Honeybadger
from honeybadger.contrib.flask import Honeybadger
For Flask applications, use the `Honeybadger` class from `contrib.flask`.

This quickstart demonstrates basic initialization using an API key (preferably from an environment variable) and how to manually send an exception to Honeybadger. For immediate reporting in short-lived scripts, `force_sync=True` is recommended. Remember to replace `HONEYBADGER_API_KEY` with your actual API key from your Honeybadger project settings.

import honeybadger import os # Configure Honeybadger using an environment variable or direct assignment honeybadger.configure(api_key=os.environ.get('HONEYBADGER_API_KEY', '')) def problematic_function(): raise ValueError("This is a test error from Honeybadger Python!") try: problematic_function() except Exception as e: # Manually send the error to Honeybadger honeybadger.notify(e, force_sync=True) print("Error notified to Honeybadger. Check your dashboard.") # Example of setting custom context honeybadger.set_context(user_id=123, email='test@example.com')
honeybadger --version
Debug
Known issues
gotchaErrors not appearing in Honeybadger dashboard due to missing API key configuration.
fix
Ensure `honeybadger.configure(api_key='YOUR_API_KEY')` is called, or the `HONEYBADGER_API_KEY` environment variable is set. Errors won't be sent without a valid API key.
affects: All versions
gotchaManual `honeybadger.notify()` calls might not complete in short-lived scripts or serverless functions without `force_sync=True`.
fix
When calling `honeybadger.notify()`, explicitly set `force_sync=True` (e.g., `honeybadger.notify(exception, force_sync=True)`) to ensure the HTTP request completes before the process exits.
affects: All versions
gotchaAutomatic error capture for frameworks like Django or Flask requires specific integration setup (middleware/init), not just importing the library.
fix
For Django, add `'honeybadger.contrib.django'` to `INSTALLED_APPS` and configure it in `settings.py`. For Flask, initialize `Honeybadger` from `honeybadger.contrib.flask` with your Flask app (e.g., `hb = Honeybadger(app=my_flask_app)`).
affects: All versions
breakingPrior to v1.0, the configuration method was `honeybadger.init()`. This was renamed to `honeybadger.configure()`.
fix
Update `honeybadger.init(...)` calls to `honeybadger.configure(...)`.
affects: < 1.0
Errors
Common errors & fixes
Honeybadger API key is not configured. Errors will not be sent.
The `api_key` was not provided to `honeybadger.configure()` or the `HONEYBADGER_API_KEY` environment variable is missing.
fix
Set the `HONEYBADGER_API_KEY` environment variable or explicitly pass `api_key='YOUR_KEY'` to `honeybadger.configure()`.
No errors appearing in Honeybadger UI, even after `honeybadger.notify()` calls.
Errors are sent asynchronously by default. In fast-exiting scripts (e.g., a CLI tool or serverless function without proper await), the process might terminate before the error report is sent.
fix
Add `force_sync=True` to your `honeybadger.notify()` call: `honeybadger.notify(e, force_sync=True)`.
TypeError: __init__() got an unexpected keyword argument 'config'
This error can occur if you're trying to pass a dictionary of configuration options as `config` to `honeybadger.configure()`. The `configure` method expects keyword arguments directly.
fix
Pass configuration options as individual keyword arguments: `honeybadger.configure(api_key='...', environment='production', ...)` instead of `honeybadger.configure(config={'api_key': '...'})`.
Upgrade
Version history
1.2.3latest on PyPI · released May 29, 2026
Audit
Dependencies
requestsrequiredHTTP client for sending data to Honeybadger API
wraptrequiredDecorator module used for various integrations and patching
sixrequiredPython 2 and 3 compatibility utilities
DjangooptionalRequired for Django framework integration (optional extra)
FlaskoptionalRequired for Flask framework integration (optional extra)
celeryoptionalRequired for Celery integration (optional extra)
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Amazon
1
Resources
honeybadger — pip install honeybadger · libregistry