finam.tools#

Tools for using FINAM.

Logging helper#

ErrorLogger([logger, do_log])

Context manager to log Exceptions.

LogCStdOutStdErr([logger, level_stdout, ...])

Context manager to redirect low-level C stdout and stderr to a logger.

LogStdOutStdErr([logger, level_stdout, ...])

Context manager to redirect stdout and stderr to a logger.

LogWriter([logger, level])

Log writer.

is_loggable(obj)

Check if given object is loggable.

add_logging_level(name, num[, method])

Adds a logging level to the logging module.

Datetime helper#

is_timedelta(value)

Tests if a value is an instance of timedelta or relativedelta.

CWD helper#

execute_in_cwd(func)

Decorator to execute method in given cwd of containing class.

set_directory(path)

Sets the cwd within a context.

ENUM helper#

get_enum_value(value, enum_cls[, error])

Convert value to corresponding enum value.

Inspection helper#

inspect(obj)

Prints information about a component, adapter or input/output slot.

Connect helper#

ConnectHelper(logger_name, inputs, outputs)

Helper for iterative connect.

FromInput(name[, fields])

Info transfer rule from an input.

FromOutput(name[, fields])

Info transfer rule from an output.

FromValue(field, value)

Info transfer rule from a given value