jaraco.path

miscellaneous path functions


License
MIT
Install
pip install jaraco.path==3.7.0

Documentation

tests Ruff Code style: Black https://img.shields.io/badge/skeleton-2023-informational

Hidden File Detection

jaraco.path provides cross platform hidden file detection:

from jaraco import path
if path.is_hidden('/'):
    print("Your root is hidden")

hidden_dirs = filter(is_hidden, os.listdir('.'))

Directory Builder

When testing (and perhaps in other cases), it's often necessary to construct a tree of directories/files. This project provides a build function to simply create such a directory from a dictionary definition:

from jaraco.path import build
build(
    {
        'foo': 'Content of foo',
        'subdir': {
            'foo': 'Content of subdir/foo',
        },
    },
)