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, 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-1.0.0.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for pathcrawler-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f859352297c9486debbcfdab45fa4cd4b341fd69d3ddd704ac28c01365c57e |
|
MD5 | f9f61209590780ed92aea08f78e8b065 |
|
BLAKE2b-256 | 3cd85b03bd6b19cdfb69ec620ebb5dfef3c0526ffc891ca74ad854c137ef9590 |