I got tired of typing more than one line to get a recursive list of pathlib.Path objects for a given directory.
Project description
pathCrawler
Small utility because I got tired of typing more than one line to get a recursive list of pathlib.Path objects for a directory.
Install using:
pip install pathCrawler
python3 -m pip install pathCrawler
pathCrawler contains just three functions: crawl, getDirectorySize, and formatSize.
crawl takes a starting directory and returns a recursive list of pathlib.Path objects for all files in the starting directory and its sub folders.
getDirectorySize takes a directory and returns the total size in bytes of the contents of the directory.
formatSize takes a number (presumed to be bytes) and returns it as a string rounded to two decimal places with the appropriate unit suffix.
i.e.
>>> formatSize(132458) '132.46 kb'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pathcrawler-0.1.0.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for pathcrawler-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b4dbc553a9cca89f1b01916d4ad5f7d3808a208c3350fe030c44156b14862a |
|
MD5 | 88add14d33e04d6241170608c3fbb63b |
|
BLAKE2b-256 | 8ccb820575cc4741ca3c7a677c81fa182df2f80ef0038449a8ef8bbc0100f647 |