market_analysis.utils

Utility helper functions for the market_analysis project.

This module provides small reusable helpers, such as filename sanitization for safe file saving across operating systems.

Module Contents

Functions

safe_filename

Convert a string into a filesystem-safe filename.

API

market_analysis.utils.safe_filename(s: str) str

Convert a string into a filesystem-safe filename.

The function removes special characters, normalizes Unicode characters to ASCII, replaces spaces with underscores, and collapses repeated underscores.

Parameters

s : str Input string.

Returns

str Sanitized filename safe for most filesystems.