Utils package

Submodules

yt_audio_collector.utils.file_utils module

yt_audio_collector.utils.file_utils.create_dir(dir_path: str | Path) Path[source]

Create a directory with the given path.

Parameters:

dir_path: Union[str, Path]

The path of the directory to create.

Return:

Path

The created directory path.

yt_audio_collector.utils.file_utils.load_json(file_path: str | Path) Any[source]

Load data from a JSON file.

Parameters:

file_path: Union[str, Path]

The path of the JSON file.

Return:

Any

A dictionary with the data in the file.

yt_audio_collector.utils.file_utils.resolve_path(file_path: str | Path) Path[source]

Check if the given file path exists and return a Path object if it does.

Parameters:

file_path: Union[str, Path]

The path of the file to check.

Exceptions:

FileNotFoundError:

If the file path does not exist.

Return:

Path

The Path object of the file path.

Module contents