stouputils.config module#

Global configuration module for stouputils.

This module provides the StouputilsConfig class which contains global configuration options that control the behavior of various stouputils functions. Configuration values can be set programmatically or via environment variables.

Environment Variables:

Configuration options can be overridden using environment variables with the prefix STP_ or STOUPUTILS_ followed by the configuration variable name.

Examples:

STP_PROCESS_TITLE_PER_WORKER=false STOUPUTILS_PROCESS_TITLE_PER_WORKER=true

Usage:
from stouputils.config import StouputilsConfig as Cfg

# Change configuration programmatically
Cfg.PROCESS_TITLE_PER_WORKER = False
class StouputilsConfig[source]#

Bases: object

Global configuration class for stouputils.

VERBOSE_READING_ENV: bool = False#

Configuration option for verbose output when reading environment variables when stouputils is imported.

  • If true, stouputils will print out the environment variables it reads and their values. Defaults to False.

RESET: str = '\x1b[0m'#
RED: str = '\x1b[91m'#
GREEN: str = '\x1b[92m'#
YELLOW: str = '\x1b[93m'#
BLUE: str = '\x1b[94m'#
MAGENTA: str = '\x1b[95m'#
CYAN: str = '\x1b[96m'#
LINE_UP: str = '\x1b[1A'#
BOLD: str = '\x1b[1m'#

Terminal color/style constants used throughout the package.

Used by: stouputils.print and other modules that output colored text (e.g., stouputils.backup, stouputils.version_pkg, …).

BAR_FORMAT: str = '{l_bar}{bar}\x1b[95m| {n_fmt}/{total_fmt} [{rate_fmt}{postfix}, {elapsed}<{remaining}]\x1b[0m'#

Default bar format used for TQDM progress bars.

Used by: stouputils.print and stouputils.parallel for progress bars.

CPU_COUNT: int = 4#

Number of CPUs to use by default for parallel operations (int).

Used by: stouputils.parallel (modules common and multi) and other concurrency helpers.

PROCESS_TITLE_PER_WORKER: bool = True#

Configuration option for process title in multiprocessing() function. - If true, process title is set only once per worker (reflecting worker index 0 to max_workers-1). - If false, process title is updated for each task (reflecting task index 0 to len(args)-1).

Defaults to True for easier/accurate worker identification.

Used by: stouputils.parallel.multi (see stouputils.parallel.multi.process_title_wrapper()).

CHUNK_SIZE: int = 1048576#

Default chunk size for file I/O operations (bytes).

Used by: stouputils.backup and other modules performing chunked file operations.

LARGE_CHUNK_SIZE: int = 8388608#

Larger chunk size for file I/O operations (bytes).

Used by: stouputils.backup and other modules needing larger I/O buffers.

GITHUB_API_URL: str = 'https://api.github.com'#

Base GitHub API URL used by the continuous_delivery utilities.

Used by: stouputils.continuous_delivery.github for API endpoints.

COMMIT_TYPES: ClassVar[dict[str, str]] = {'build': 'Build System', 'chore': 'Chores', 'ci': 'CI/CD', 'docs': 'Documentation', 'feat': 'Features', 'fix': 'Bug Fixes', 'perf': 'Performance Improvements', 'refactor': 'Code Refactoring', 'revert': 'Reverts', 'style': 'Style', 'test': 'Tests', 'uwu': 'UwU ◕_◕ ༽つ', 'wip': 'Work in Progress'}#

Mapping of conventional commit short types to human-friendly headings used in changelogs.

Used by: stouputils.continuous_delivery.cd_utils (parsing and grouping conventional commits for changelogs).

AUTO_DOCS_REQUIREMENTS: tuple[str, ...] = ('myst_parser',)#

List of requirements used by the automatic docs utilities.

Used by: stouputils.applications.automatic_docs (dependency checks for documentation generation).