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; --json exports scan statistics
and inventory without running duplicate detection.
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.
The dashboard also includes folder activity filters. Snapshot comparison, timestamped filenames, and terminal progress options are CLI features.
The launcher binds to localhost and disables Streamlit usage telemetry. Use it on a trusted local machine: folder paths refer to the machine running Streamlit, not the computer of a remote browser.
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 initial explorer order and JSON entry 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; does not open a browser. |
--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. |
--help |
Show all available options. |
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 in {result.folder_count:,} folders")
print(f"Total size: {result.total_size:,} bytes")
report = write_report(result, "reports/project.html", title="Project audit")
print(f"Report saved to {report}")
for error in result.errors:
print(f"Could not inspect {error.path}: {error.message}")
Use render_report(result) to get HTML as a string, or result.to_dict() for a
JSON-serializable snapshot. Entry paths are relative to the scanned folder and
use / separators.
For a filtered, size-sorted report:
result = scan("./Downloads", include=("*.exe",), sort_by="size")
write_report(result, "executables.html", sort_by="size")
For programmatic comparisons:
from statsfolder import compare_scans, load_snapshot, scan, write_report
baseline = load_snapshot("scans/baseline.json")
current = scan("./my-project", exclude=(".git", ".venv"))
changes = compare_scans(baseline, current)
write_report(current, "changes.html", comparison=changes)
scan(..., progress=callback) calls your callback with a ScanProgress object
containing the current relative path, file/folder counts, and discovered bytes.
Raising KeyboardInterrupt cancels traversal; the API does not suppress it.
Understanding your results
- Scope: By default, scans include entries owned by the current user.
On Windows, system-marked entries, the Windows folder, and other users'
profiles are skipped instead. Use
--allto include them; it does not bypass filesystem permissions. - Sizes: Values are logical file sizes, not allocated disk usage. Hard-linked files count once per path. Folder totals include descendants, so adding a parent and its child folders would double-count their contents.
- Folders and links: The root isn't included in the folder count; it appears
as
.in folder totals. Symbolic links are recorded but not followed. Links and special files do not contribute to size totals. - Dates: Modification times are shown in UTC. The folder timeline includes folders with no regular files. Latest file change covers observed regular files throughout the subtree, excluding skipped or unreadable contents.
- Partial scans: Permission errors or disappearing entries can leave a
report incomplete. Review the report's scan warnings. CLI exit codes are
0for a complete scan,1for a fatal error, and2for a partial scan. - Large directories: Inventory is held in memory and embedded in the HTML. Exclude caches and dependencies to keep large scans and reports manageable.
- Privacy: Reports contain paths, sizes, and timestamps. Review them before sharing. Normal scans read metadata; duplicate detection also reads contents. Scans are best-effort snapshots, so avoid changing the tree while scanning.
Development
From a local checkout:
pip install -e ".[streamlit]"
pip install pytest ruff mypy
pytest
ruff check .
mypy src/statsfolder
License
Copyright (C) 2026 Sermet Pekin.
statsfolder is free software, released under the GNU General Public License v3.0 or later.
Metadata
Release files for statsfolder 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| statsfolder-0.1.15.tar.gz | 58.3 kB | Without provenance | Details for statsfolder-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| statsfolder-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for statsfolder-0.1.15-py3-none-any.whl |
Total release size: 110.7 kB
Release files / statsfolder-0.1.15.tar.gz
| Download URL | statsfolder-0.1.15.tar.gz |
|---|---|
| Size | 58.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4ae95bd33a5241ddd1113c53ca4bca12107d552fb723c898e9059c55690608f
|
|
BLAKE2b-256 checksum How to use checksums |
7986abef8efb23d4376b77ed988e37bfa95a5aeacba17b897c2810744e993e5b
|
| 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.15-py3-none-any.whl
| Download URL | statsfolder-0.1.15-py3-none-any.whl |
|---|---|
| Size | 52.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc0c7d98b9afc8080e815b405f17af09b823bf0dece3e4d34fb69ee816d8435f
|
|
BLAKE2b-256 checksum How to use checksums |
6b80f4de8a5695d319e36b6e088125da71f9a2716eea88981859451fcdfbb247
|
| 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.15
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.