path
— Utilities for accessing the filesystem
Utility functions to access the filesystem.
- valjean.path.ensure(*paths, is_dir=False)[source]
Make sure that the given path exists.
- Parameters:
paths (str or pathlib.Path) – One or more paths. Multiple arguments will be concatenated into a single path.
is_dir (bool) – If True, the path will be constructed as a directory.
- valjean.path.sanitize_filename(name)[source]
Check that the name string can be used as a filename.
- Raises:
ValueError – if the string contains characters that are forbidden in a filename.
- Returns:
name unchanged