Skip to main content

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)

Uploaded Source

Built Distribution

pathcrawler-0.1.0-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page