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
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.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for pathcrawler-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 575ad713f3844112566afe862fa74715e1d656d8f58863c342dd0e8f8f13fe68 |
|
MD5 | b2e9937cfd6252409b35f75c67d84c4c |
|
BLAKE2b-256 | 30a74bed36edfb2f956be337bbc9ebd55d49940548740e63c88e6c1581ff8e9e |