This used to be more useful when I didn't realize I could just rglob('*.*'). Leaving it up so I don't break my other projects/ format_size() is still convenient.
Project description
pathcrawler
Just a file globber that also give you directory size.
Install using:
pip install pathcrawler
pathcrawler contains just three functions: crawl, get_directory_size, and format_size.
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.
get_directory_size takes a directory and returns the total size in bytes of the contents of the directory.
format_size 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.
>>>import pathcrawler >>> pathcrawler.format_size(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-2.0.0.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for pathcrawler-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17d187a217a6eaa7fc68ff5a69c21a9f250505661bbcfe52c7124a896757d142 |
|
MD5 | e1202ac92eb3d3f7f16b13db12e046ef |
|
BLAKE2b-256 | 0bcfb8fd7369898f5aa4d99699165ce72f0cbd28d1c3152b20eae2b9345d72d4 |