Skip to main content

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)

Uploaded Source

Built Distribution

pathcrawler-2.0.0-py3-none-any.whl (3.1 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