path_ module¶
Utilities for working with paths.
check_mkdir function¶
Check whether the path to a directory exists and create if it doesn't.
For defaults, see mkdir in path.
dir_exists function¶
Check whether a directory exists.
dir_size function¶
Get size of a directory.
dir_tree function¶
Generate a visual tree structure.
Uses dir_tree_from_paths.
dir_tree_from_paths function¶
dir_tree_from_paths(
paths,
root=None,
path_names=None,
root_name=None,
level=-1,
limit_to_dirs=False,
length_limit=1000,
sort=True,
space=' ',
branch='│ ',
tee='├── ',
last='└── '
)
Given paths, generate a visual tree structure.
file_exists function¶
Check whether a file exists.
file_size function¶
Get size of a file.
get_common_prefix function¶
Returns the common prefix of a list of URLs or file paths.
list_any_files function¶
List files and dirs matching a path.
If the directory path is not provided, the current working directory is used.
list_dirs function¶
List dirs matching a path using list_any_files.
list_files function¶
List files matching a path using list_any_files.
make_dir function¶
Make an empty directory.
make_file function¶
Make an empty file.
print_dir_tree function¶
Generate a directory tree with tree and print it out.
remove_dir function¶
Remove (delete) a directory.
remove_file function¶
Remove (delete) a file.