Skip to main content

statsfolder

Your storage, understood.

Turn any folder into a clear, interactive HTML report. See what's taking up space, find your largest files, and review folders that haven't changed in a while—all from one command.

Reports work offline, with no external assets or file uploads.

Looking for commands to copy? Quick usage examples cover common searches, filters, exports, and scan comparisons.

Install

Requires Python 3.11 or newer.

pip install statsfolder

Your first report

statsfolder ./my-project

Replace ./my-project with the folder you want to explore. The report opens in your browser automatically and is saved as my-project-statsfolder-report.html in your current directory, ready to revisit later.

To scan the current directory, simply run:

statsfolder

Paths containing spaces should be quoted:

statsfolder "path/to/My Photos"

Don't want to open a browser? Add --no-open. To choose a different report name or location, use -o:

statsfolder ./my-project --no-open -o reports/project.html

Existing output files are replaced, so choose a new filename if you want to keep an earlier report. The CLI excludes its output file from the scan.

If your terminal cannot find the statsfolder command, try python -m statsfolder ./my-project.

What you'll discover

Question What the report shows
Where is my space going? An interactive storage treemap, storage by file type, and folder footprints.
Where are those large file types? Select an extension to rank its containing folders by size and expand their matching files.
Which files make the biggest difference? The 20 largest files and plain-language storage insights.
Which folders haven't changed recently? A folder modification timeline, oldest first, with the latest file change inside each folder.
What's inside this directory? A searchable file and folder inventory with filters and sorting.
Are there duplicate files? An optional duplicate-file analysis, enabled with --duplicates.
What's changed since last time? Compare a saved JSON scan to see new, removed, and changed files, plus folder growth.

The HTML report includes a light/dark toggle, a responsive layout, and print styling. You can reopen it without running statsfolder again.

Explore storage visually

The Storage treemap sizes each tile by regular-file bytes. Select a folder to explore its contents, then use the location buttons to go back. Switch to File types to explore extensions and the folders behind them. Select a file to find its path in the explorer.

Each view accounts for every non-empty scanned regular file without double-counting subfolders. Empty files, symlinks, and other entries have no area. In crowded views, open Other ... items to explore the remaining tiles. The treemap works offline, without external chart libraries.

Download filtered results

Use the Export ... CSV buttons in the explorer, file-type folders, folder activity, modification timeline, or scan comparison. Exports include all matching rows, not just the first displayed page, in the current sort order. The file-type section can export either containing-folder totals or their matching files.

CSV files contain relative paths, exact byte sizes, and UTC timestamps where applicable. They use UTF-8 for spreadsheet compatibility. Potential formula cells are prefixed with an apostrophe to keep filenames from executing as spreadsheet formulas; this can change their displayed text in other CSV readers. Recursive folder totals can overlap; file-type containing-folder totals do not.

Find the folders behind a file type

Select an extension in Storage composition, such as .zst or .zip, to jump to Where these file types live. Containing folders are ranked by the total size of matching files, largest first, with file counts and share of that type's storage.

Expand a folder to see its matching files, sorted largest first, with relative paths, sizes, and modification dates in UTC. Files are grouped by their immediate containing folder, so parent and child folders are not double-counted. . means files directly inside the scanned root.

Use the extension search and selector to explore every discovered type, including those grouped under “Other” in the composition table. You can also filter containing folders by path. Percentages always refer to all scanned files of the selected type, even when the folder list is filtered.

Old doesn't mean unnecessary. A folder's own modification date does not necessarily change when an existing file inside it is edited. Compare it with the latest descendant file change, and review contents before deleting anything. statsfolder does not delete your files.

See what's changed

Save a baseline scan as JSON, then compare a later scan of the same folder:

statsfolder ./my-project --json -o scans/baseline.json
statsfolder ./my-project --compare scans/baseline.json -o changes.html

The comparison shows new, removed, and changed files, total size change, folder growth or shrinkage, and file type growth—which extensions gained or lost the most bytes since the baseline. File changes are detected by size and modification time, not content hashes. Renamed files appear as removed and new files.

Use the same exclusions and scan settings for both scans. Reports warn when settings differ, settings are unavailable in an older export, or either scan has filesystem errors. In a partial scan, a missing file may be unreadable rather than removed. Snapshots must refer to the same absolute root folder; comparisons do not infer moves between different roots.

Keep snapshots and reports outside the scanned tree, or exclude their folder (for example, --exclude scans). The current output and baseline snapshot are automatically excluded, but other saved reports are ordinary files.

To export both the current snapshot and its comparison as JSON:

statsfolder ./my-project --compare scans/baseline.json --json -o scans/current.json

Keep a report history

Add --timestamp to preserve each report:

statsfolder ./my-project --timestamp
statsfolder ./my-project --json --timestamp -o scans/project.json

A UTC timestamp with microseconds is inserted before the extension, for example my-project-statsfolder-report-20261130T160000123456Z.html. This also works with an explicit -o filename. Without --timestamp, the existing overwrite behavior is unchanged.

Find large, inactive folders

The Folder activity section measures the most recent modification anywhere in each observed subtree—including directory entries, not just regular files. Filter by inactivity (180, 365, or 730 days), minimum size, and folder path; sort by oldest activity, newest activity, or largest size.

Inactivity is measured at scan time. Future-dated activity shows zero days. The existing folder modification timeline remains available separately. Excluded or unreadable contents cannot contribute to activity dates, and a folder with no observed regular files is not necessarily empty.

Follow progress or cancel

On interactive terminals, the CLI shows file/folder counts, discovered bytes, and the current path. Use --progress to enable it explicitly or --no-progress to keep scripts quiet. Progress covers filesystem scanning, not a completion percentage or the optional duplicate-hashing phase.

Press Ctrl+C during scanning or report generation to cancel with exit code 130. Output is replaced only after writing finishes, so an interrupted scan does not overwrite an existing report or save a partial scan as a complete one.

Quick stats in the terminal

No browser handy—on a server, over SSH, or in a script? Print the highlights instead of writing a report:

statsfolder ./my-project --summary

This shows totals, the top 10 file types with shares, and the 10 largest files. No report file is written and no browser opens. Combine it with --compare to also print the top file type changes, or with --duplicates for wasted-space totals. All include/exclude filters work as usual.

statsfolder --help lists every option with usage examples.

Focus on what matters

Search for matching files and folders

Include only matching entries, with the largest files first:

statsfolder ./Downloads --include "*.exe" --sort size

Nonmatching folders are still searched recursively, so executables inside them are found. A matching folder includes its entire subtree, even when its children do not match individually. Exclusions, ownership checks, hidden-entry settings, and minimum size still apply; an excluded folder is never searched. Report statistics describe the included entries, not the entire source folder.

Repeat --include to match any of several patterns, or prefix a regex with re::

statsfolder . --include "*.exe" --include "*.dll" --sort size
statsfolder . --include "re:(?i)[.]exe$" --sort size
statsfolder . --include "*cache*/" --exclude node_modules --sort size

Patterns match entry names or root-relative paths using / separators. Globs are case-sensitive; the regex example uses (?i) to also match .EXE. A trailing / restricts a pattern to folders. Quote patterns to prevent shell expansion.

Use --sort path (the default), --sort size (largest first), or --sort modified (newest first). This selects the HTML explorer's initial order and orders entries in JSON output; you can still change the order in the report. Folder sorting uses the total bytes of included regular files beneath each folder, not directory metadata size. These recursive sizes also appear in the explorer and its CSV export. JSON preserves entry metadata and provides recursive sizes separately in folder_sizes.

The same include patterns and sort controls are available with --streamlit.

Skip caches and dependencies

Repeat --exclude for each pattern:

statsfolder . --exclude .git --exclude .venv --exclude node_modules

Patterns match entry names or paths relative to the scanned folder. A matching folder and its contents are skipped. Quote wildcard patterns so your shell doesn't expand them:

statsfolder . --exclude "*.pyc" --exclude "*cache*/"

A trailing / matches folders only. For advanced matching, prefix a regular expression with re:, for example --exclude "re:[.]log$".

Save your exclusions

Create a .statsfolderignore file in the folder you scan:

# Dependencies and generated files
.git
.venv
node_modules
*.pyc
*cache*/

The CLI reads it automatically. You can also load a separate file with --ignore-file patterns.txt; repeat the option to load more than one.

Hide small or hidden files

statsfolder . --min-size 10MB
statsfolder . --exclude-hidden

Sizes accept bytes or units such as 10KB, 1.5MB, and 2GB, using 1024-based units. Hidden entries are included by default; --exclude-hidden skips dotfiles and dotfolders.

Look for duplicates

statsfolder ./my-project --duplicates

Duplicate detection reads file contents and can take longer than a normal scan. It compares same-sized files using SHA-256, checking files of at least 1 MiB by default. To change that threshold:

statsfolder ./my-project --duplicates --min-duplicate-mb 10

Duplicate analysis appears in the HTML report only.

Prefer a live dashboard?

Install the optional Streamlit interface:

pip install "statsfolder[streamlit]"

Then launch it:

statsfolder ./my-project --streamlit

Choose a folder in the sidebar and click Analyze folder. Explore charts, filter the inventory, and download an offline HTML report. Stop the dashboard with Ctrl+C.

Snapshot comparison, timestamps, and progress are CLI-only. The dashboard binds to localhost, so use it on a trusted local machine.

More command-line options

Option What it does
-o, --output FILE Choose where to save the report.
--title TEXT Customize the HTML report heading.
--no-open Save without opening a browser.
--exclude PATTERN Skip matching entries; repeat for multiple patterns.
--include PATTERN Include matching entries and matching folders' contents; repeat for alternatives.
--sort path|size|modified Set report, JSON, and CSV order.
--ignore-file FILE Load exclusions from a file.
--exclude-hidden Skip dotfiles and dotfolders.
--min-size SIZE Ignore files smaller than the given size.
-a, --all Include other users' and system entries, where permissions allow.
--duplicates Check file contents for duplicates in the HTML report.
--min-duplicate-mb MB Set the minimum duplicate-check size in MiB.
--json Save JSON instead of HTML.
--csv Save a CSV inventory (one row per entry, in --sort order; folder rows hold totals) instead of HTML.
--summary Print top file types and largest files in the terminal; writes no file.
--compare SNAPSHOT Compare with a previous JSON scan of the same folder.
--timestamp Add a UTC timestamp to the output filename to keep report history.
--progress, --no-progress Enable or disable CLI scan progress.
--streamlit Launch the optional live dashboard.

For example:

statsfolder ./my-project --title "Project storage audit" -o audit.html
statsfolder ./my-project --json -o inventory.json

Use it in Python

from statsfolder import scan, write_report

result = scan("./my-project", exclude=(".git", ".venv"))
print(f"{len(result.files):,} files, {result.total_size:,} bytes")
write_report(result, "reports/project.html", title="Project audit")

Use render_report(result) for HTML as a string, result.to_dict() for a JSON-serializable snapshot, and compare_scans(load_snapshot(path), result) to compare scans. Pass progress=callback to scan to track a run.

Good to know

  • Scope: Scans include your own entries by default; use --all for others (permissions still apply). Symbolic links are recorded, not followed.
  • Sizes: Logical file sizes, not disk usage. Folder totals include their contents, so don't add a parent and its children together.
  • Exit codes: 0 complete, 1 fatal error, 2 partial scan (unreadable entries are listed as warnings).
  • Privacy: Reports contain paths, sizes, and dates. Review before sharing. Only --duplicates reads file contents.

License

Copyright (C) 2026 Sermet Pekin. Released under the GNU General Public License v3.0 or later.

Metadata

Release files for statsfolder 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statsfolder 0.1.16
File Size Uploaded Provenance Actions
statsfolder-0.1.16.tar.gz 58.4 kB Without provenance Details for statsfolder-0.1.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statsfolder 0.1.16
File Interpreter ABI Platform Actions
statsfolder-0.1.16-py3-none-any.whl Python 3 none any Details for statsfolder-0.1.16-py3-none-any.whl

Total release size: 110.6 kB

Release files / statsfolder-0.1.16.tar.gz

Download URL statsfolder-0.1.16.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b6b249be1a8536a2425cd24ae05112340a74558569857b63832af74012a0efb7
BLAKE2b-256 checksum
How to use checksums
03ff9011e8a97d0c819aea6ac48e849e7f5ba6e48be2d84d1726f5df1befaeac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / statsfolder-0.1.16-py3-none-any.whl

Download URL statsfolder-0.1.16-py3-none-any.whl
Size 52.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9970f07ce1803b9a93fba2741fe43a5a4e9c4428c0bc89c9a7d40b2caf480001
BLAKE2b-256 checksum
How to use checksums
7c293b0878800858d549e6387a68036101df0d59d92206510c34fa57b4e33e36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for statsfolder 0.1.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page