rechu package

Subpackages

Submodules

rechu.database module

Database access.

class rechu.database.Database[source]

Bases: object

Database provider.

clear() None[source]

Reset any permanent settings-based state of the database.

close() None[source]

Close any open database session connection.

create_schema() None[source]

Perform schema creation on an empty database, marking it as up to date using alembic’s stamp command.

drop_schema() None[source]

Clean up the database by removing all model tables.

static get_alembic_config(stdout: ~typing.TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) Config[source]

Retrieve the configuration object for alembic preconfigured for rechu.

rechu.settings module

Settings module.

class rechu.settings.Settings(path: str | PathLike[str] = 'settings.toml', environment: bool = True, prefix: tuple[str, ...] = (), fallbacks: tuple[_SettingsFile, ...] = ())[source]

Bases: object

Settings reader and provider.

FILES: tuple[_SettingsFile, ...] = ({'path': 'settings.toml'}, {'environment': False, 'path': 'pyproject.toml', 'prefix': ('tool', 'rechu')}, {'environment': False, 'path': PosixPath('/home/runner/work/rechu/rechu/rechu/settings.toml')})
classmethod clear() None[source]

Remove the singleton instance and any fallback instances.

get(section: str, key: str) str[source]

Retrieve a settings value from the file based on its section name, which refers to a TOML table grouping multiple settings, and its key, potentially with an environment variable override.

get_comments() dict[str, dict[str, list[str]]][source]

Retrieve comments of the settings by section.

This retrieves comments for a setting from the settings file latest in the chain that has comments. Only comments preceding the setting are preserved.

get_document() TOMLDocument[source]

Reconstruct a TOML document with overrides from environment variables, default values and comments from fallbacks.

classmethod get_settings() Settings[source]

Retrieve the settings singleton.

Module contents

Receipt cataloging module.