Utils Module

Source: gitlab_overviewer.utils.__init__.py

Utility helpers for gitlab_overviewer.

Implements Specification: Configuration Settings Layer §2.7 and Specification: GitLab API Client §1, covering:

  • Logging utilities

  • Timestamp helpers

  • API reading helpers

  • Miscellaneous functions

Provides logging setup, timestamp utilities, API reading helpers, and miscellaneous functions.

See also: Logger, get_timestamp(), read_api_response()

utils.timestamp

Source: gitlab_overviewer.utils.timestamp.py

Timestamp utilities for diagnostic outputs.

Implements Specification: Table Rendering & UI §2.2, covering:

  • ISO8601 timestamp formatting

  • Timezone handling (UTC)

This module provides functions for generating consistent, timezone-aware timestamps in ISO8601 format for use in diagnostic output filenames.

gitlab_overviewer.utils.timestamp.now_iso()[source]

Generate an ISO8601 UTC timestamp suitable for filenames.

Returns:

Current UTC time in format ‘YYYY-MM-DDTHH-MM-SSZ’

Example: ‘2025-03-18T14-55-30Z’

Return type:

str

utils.read_api

Source: gitlab_overviewer.utils.read_api.py

API data reading utilities.

Implements Specification: GitLab API Client §1, covering:

  • Endpoint discovery and documentation

  • OpenAPI spec parsing

gitlab_overviewer.utils.read_api.load_openapi_spec(path)[source]
gitlab_overviewer.utils.read_api.extract_endpoints(spec)[source]
gitlab_overviewer.utils.read_api.display(endpoints)[source]

utils.logging

Source: gitlab_overviewer.utils.logging.py

Logging configuration utilities.

Implements Specification: Configuration Settings Layer §2.7, covering:

  • Log level configuration from environment

  • Colored output formatting

class gitlab_overviewer.utils.logging._ColorFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Simple colored formatter for console output.

format(record)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

Return type:

str

gitlab_overviewer.utils.logging.get_logger(name=None)[source]

Return a configured logger.

The level is taken from – in dieser Priorität: 1. Environment variable LOG_LEVEL 2. Otherwise falls back to DEFAULT_LEVEL.

Return type:

Logger