Internal Pub/Sub → BigQuery event logger for Bookable services (Python)
Project description
bookable-event-logger (Python)
Internal Python SDK for publishing Bookable events to Pub/Sub, following the shared Event Logging Contract.
Installation
From this repo root:
cd python
pip install -e .
Usage
from bookable_event_logger import init_event_logger, get_event_logger
# during startup
init_event_logger() # uses env vars
# later in code
logger = get_event_logger()
logger.info(
event_type="email.sync.batch.started",
correlation_id="req-123",
data={"accounts_total": 12, "sync_type": "cron"},
actor={"kind": "internal_service", "source": "scheduler"},
)
logger.log(
"warning",
event_type="email.sync.batch.slow",
correlation_id="req-123",
data={"duration_ms": 120000},
)
Environment variables
LOG_GCP_PROJECTLOG_TOPIC(default:events)LOG_ENVIRONMENTLOG_SERVICE_NAMELOG_GCP_CREDENTIALS(path to service account JSON for local/dev)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bookable_event_logger-0.2.0.tar.gz.
File metadata
- Download URL: bookable_event_logger-0.2.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a90b599c7b3a7eb438b80af1916d4e0cea024c6c7cbfd9cc36a0d6a513f6aec4
|
|
| MD5 |
1e7dd391b86955b0eb39d0ea2882633a
|
|
| BLAKE2b-256 |
f1503c1bee5d27d564bbaaf134c74d70286b3261a0f4297ae01c3030912e7ef9
|
File details
Details for the file bookable_event_logger-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bookable_event_logger-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6dae60034592e41a45c7329aa3da667b1587f12e984cbdea5f91017fc049cbc
|
|
| MD5 |
a94db383c93294aaa2ad9db53228ec07
|
|
| BLAKE2b-256 |
152e3ad0c5eb219269f80a2f95487a967981ed8c32393eaac2efd81f1bb3f679
|