API reference

safir Package

Safir is the SQuaRE framework for Roundtable bots.

Variables

__version__

The version string of Safir (PEP 440 / SemVer compatible).

version_info

The decomposed version, split across ..

safir.http Module

Utilities for using the aiohttp client in Safir-based apps.

Functions

init_http_session(app)

Create an aiohttp.ClientSession and make it available as a "safir/httpSession" key on the application.

safir.logging Module

Utilities for configuring structlog-based logging.

Functions

configure_logging(*, name[, profile, log_level])

Configure logging and structlog.

get_response_logger()

Get the context-local structlog logger with bound request context.

Variables

response_logger

A context-local structlog logger.

safir.middleware Module

Middleware for aiohttp.web servers.

Functions

bind_logger(request, handler)

Bind request metadata to the context-local structlog logger.