Background error reporting SDK for Python and Django
A lightweight error and event reporting SDK for Python applications, with optional Django integration. Reports are submitted in the background so application request handling does not wait for the remote API.
Author: CyberHuginn Organization: Fardad Noavar Website: cyberhuginn.com Organization website: fardadnoavar.ir Contact: contact@cyberhuginn.com
pip install bidar Quick start import bidar bidar.init( url="https://api.bidarhq.ir/api/v1/errors/", access_key="YOUR_ACCESS_KEY", project_name="billing-api", environment="Production", log_level="error", timeout=3.0, ) try: run_job() except Exception as exc: bidar.capture_exception(exc) Reports are queued on a background worker. capture_exception, capture_message, and capture_event return immediately with a boolean indicating whether the event was accepted for processing.
MIDDLEWARE = [ # ... "bidar.middleware.BidarMiddleware", ] Configure the SDK:
bidar = { "URL": "https://api.bidarhq.ir/api/v1/errors/", "ACCESS_KEY": "YOUR_ACCESS_KEY", "PROJECT_NAME": "my-django-app", "ENVIRONMENT": "Production", "LOG_LEVEL": "error", "TIMEOUT": 3.0, "ENABLED": True, "MIDDLEWARE_ENABLED": True, "CAPTURE_REQUEST_BODY": False, "DEDUPLICATION_WINDOW": 30, "MAX_WORKERS": 2, } The middleware reports unhandled exceptions and re-raises the original exception. Set MIDDLEWARE_ENABLED to False to disable automatic middleware reporting without removing the middleware from MIDDLEWARE.
The SDK is initialized lazily from BIDAR when the middleware first runs. You can also call bidar.init(...) explicitly during application startup.
import bidar bidar.capture_exception(error) bidar.capture_message( "Payment provider is unavailable", level="warning", ) bidar.capture_event( {"event": "subscription.renewal_failed", "customer_id": 42}, level="error", ) Configuration Option Default Description url Required HTTP endpoint that receives JSON POST reports access_key Required API key sent in X-Bidar-Access-Key log_level error One of info, warning, or error project_name None Project identifier attached to every event environment Production Deployment environment timeout 3.0 Outbound HTTP timeout in seconds enabled True Enables or disables all reporting middleware_enabled True Enables or disables Django middleware reporting capture_request_body False Opt-in request body capture deduplication_window 30 Suppresses identical events within this many seconds; set to 0 to disable max_workers 2 Number of background HTTP workers Log levels are threshold-based: info accepts all levels, warning accepts warnings and errors, and error accepts errors only.
bidar.flush() bidar.shutdown() Call flush() during controlled shutdown if pending reports should be given a chance to finish. shutdown() prevents further submissions until the SDK is initialized again.
bidar error-reporting django monitoring sentry
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




