Skip to main content

Business Intelligence events - structured JSON BI event logging on top of Python logging

Project description

bievents

Business Intelligence events — structured JSON BI event logging on top of Python logging.

Installation

pip install git+https://github.com/entirius/entirius-py-bievents.git@v2.0.0

(PyPI release planned: pip install entirius-py-bievents.)

Example usage

Emitting a simple event:

import logging
from bievents import (
    BiFormatter,
    BI_LOGGER_NAME,
    BiEventAbstract,
)

json_handler = logging.FileHandler(filename="example-json.log")
json_handler.setFormatter(BiFormatter())
logger = logging.getLogger(BI_LOGGER_NAME)
logger.addHandler(json_handler)
logger.setLevel(logging.DEBUG)


class SimpleEvent(BiEventAbstract):
    details_type = "Simple Event test"
    version = 2


SimpleEvent(
    source="example source name",
    business_unit="example business unit",
    environment="example environment",
    status="success",
)

The code above appends one JSON event to example-json.log:

{
  "details_type": "Simple Event test",
  "event_source": "example source name",
  "business_unit": "example business unit",
  "environment": "example environment",
  "id": "199f75bb-260b-46e2-8c8d-3463b9981c92",
  "version": "0.0.1",
  "status": "success",
  "resources": [
    "xxxx"
  ],
  "is_ongoing_event": false,
  "time_start": "2022-05-13T12:29:35.705751+00:00",
  "time_end": "2022-05-13T12:29:35.705751+00:00",
  "time_duration": 0,
  "details": {}
}

Development

make install     # sync dependencies (uv)
make check       # lint + format check (ruff)
make test        # test suite (pytest)

Development and agent instructions: AGENTS.md.

License

Mozilla Public License 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entirius_py_bievents-2.0.0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entirius_py_bievents-2.0.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file entirius_py_bievents-2.0.0.tar.gz.

File metadata

  • Download URL: entirius_py_bievents-2.0.0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for entirius_py_bievents-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ec23373080ed3e3a90784b850ef15536946e44e379070a3dc0e427237fbe4903
MD5 c23441645a200cf26b3e5d90b904c439
BLAKE2b-256 6716c5dbc75547b905262a7df7df14b18b79325586eed8b8b49a418c6612e8b5

See more details on using hashes here.

File details

Details for the file entirius_py_bievents-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: entirius_py_bievents-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for entirius_py_bievents-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40b93a235638bccac10b63719696f798eaa1acd1f2b1d5212bf7c5952d426332
MD5 3b3943904676237f25c58d23a9370593
BLAKE2b-256 cf4cca0d805a5710717d4465e01e8bf115d4de344a8454a997642f7fec0dae53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page