Skip to main content

statsfolder

Your storage, understood.

A Python library and command-line tool that turns a folder into a clear, interactive HTML report. Understand where space goes, explore your files, and review folders that have not changed recently.

Reports are self-contained and work offline: no CDN, external fonts, telemetry, or file uploads. Prefer a live dashboard? Streamlit is included with every installation.

Installation

Requires Python 3.11 or newer. No uv installation is required.

pip install statsfolder

Use python -m pip install statsfolder if you want to select the Python interpreter explicitly. A virtual environment is recommended.

Before the first PyPI release, install from a local checkout with pip install .. Streamlit is a required dependency and is installed automatically; no extras are needed.

If you prefer an isolated command-line installation, either of these also works after publication:

pipx install statsfolder
uv tool install statsfolder

Quick start

Generate a report and open it in your browser:

statsfolder ./my-project

Replace ./my-project with the folder you want to inspect. Paths containing spaces should be quoted.

To scan the current directory:

statsfolder .

HTML reports open in your browser automatically. Use --no-open to save without launching a browser, for example in scripts or headless environments:

statsfolder ./my-project --no-open

The default output is statsfolder-<folder-stem>-report.html in your current directory: scanning ./my-project creates statsfolder-my-project-report.html. The stem comes from the resolved folder name with its final suffix removed (for example, archive.v1 becomes archive); a filesystem root uses root. JSON exports use the same name with .json and never open a browser. Existing output files are replaced and automatically excluded from the CLI scan. An explicit -o overrides the default filename.

If the console command is not on your PATH, use the module entry point:

python -m statsfolder ./my-project

Customize your report

statsfolder ./my-project -o reports/project.html --title "Project storage audit"
statsfolder . --exclude .git --exclude .venv --exclude "*.pyc"
statsfolder . --exclude-hidden --exclude node_modules
statsfolder . --json -o inventory.json
statsfolder --help
Option Purpose
-o, --output Choose the output file. Parent directories are created if needed.
--open Explicitly open the HTML report; this is already the default.
--no-open Save without opening a browser. Useful for scripts and headless environments.
--title Set the HTML report heading.
--exclude Skip a name or root-relative path glob; repeat for multiple patterns.
--exclude-hidden Skip dotfiles and dotfolders.
--json Export statistics and inventory as JSON instead of HTML.
--streamlit Launch the included interactive dashboard.

Streamlit dashboard

Launch the dashboard after a normal installation:

statsfolder ./my-project --streamlit

Choose a folder, adjust exclusions, and click Analyze folder. Explore charts, filter the inventory, and download the same offline HTML report.

The launcher binds to localhost and disables Streamlit usage telemetry. Folder paths refer to the machine running Streamlit, not a remote browser's computer. Run the dashboard only on a trusted local machine; it can inspect that machine's files. Stop it with Ctrl+C.

What's in the report?

  • Total logical file size, file/folder counts, average size, empty files, and links
  • Storage composition by extension, including extensionless files
  • The 20 largest files and 20 largest recursive folder footprints
  • A complete file/folder inventory with path search, kind filters, and sorting
  • Modification timestamps in UTC, scan duration, exclusions, and explicit errors
  • An all-folders modification timeline below the existing tables, oldest first, with a newest-first option, latest descendant file change, file counts, and sizes
  • Responsive layout, light/dark toggle, accessible controls, and print styling

Python API

from statsfolder import scan, write_report

result = scan("./my-project", exclude=(".git", ".venv"), include_hidden=True)
print(result.total_size, len(result.files), result.folder_count)
print(result.file_types())
report_path = write_report(result, "reports/project.html", title="Project audit")

for error in result.errors:
    print(f"Could not inspect {error.path}: {error.message}")

render_report(result) returns HTML as a string; result.to_dict() provides a JSON-serializable snapshot. Entries use root-relative POSIX paths. Omitting the output argument to write_report(result) uses the same folder-based filename as the CLI, but the Python API never opens a browser. Streamlit downloads also use the folder-based HTML filename.

Understanding the results

  • Hidden files are included unless --exclude-hidden is specified.
  • --exclude is repeatable. Case-sensitive glob patterns match the entry name or root-relative path. A matching folder is pruned, including its entire subtree. A pruned subtree counts as one excluded entry; its descendants are not inspected.
  • Symlinks (including broken links) are recorded but never followed. Special files are recorded as other; neither links nor special files add to size totals.
  • Sizes are logical bytes, not allocated disk usage. Hard-linked files count once per path. Folder sizes include descendants, so parent/child totals overlap.
  • The root is excluded from the folder count and shown as . in folder totals.
  • The folder timeline uses each directory's own modification timestamp and includes folders with no regular files. Directory timestamps reflect direct entry changes, not edits to existing files. The separate latest-file-change column is recursive; it ignores symlinks and is unavailable when no regular files were observed. Excluded or unreadable contents are not included. Old dates do not prove redundancy or imply that a folder is safe to delete.
  • Permission errors and disappearing files produce visible partial results. CLI exit codes: 0 complete, 1 fatal failure, 2 partial scan.
  • Scans read metadata only, not file contents. A scan is a best-effort snapshot, not an atomic filesystem snapshot; avoid actively changing the scanned tree.
  • Inventory data is kept in memory and embedded in HTML. Very large trees can produce large reports; exclude dependency/cache directories when appropriate.
  • Reports expose paths, sizes, and timestamps. Treat them as private when scanning sensitive directories.

Development

Contributors can use standard Python tools:

pip install -e .
pip install pytest ruff mypy build
pytest
ruff check .
ruff format --check src tests
mypy src/statsfolder
python -m build

Alternatively, use uv to manage the development environment and its locked dependencies:

uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check src tests
uv run mypy src/statsfolder
uv build

License

Licensed under the GNU General Public License, version 3 or (at your option) any later version (GPL-3.0-or-later). See the GNU GPLv3 license text.

Metadata

Release files for statsfolder 0.1.0

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.0
File Size Uploaded Provenance Actions
statsfolder-0.1.0.tar.gz 150.8 kB Without provenance Details for statsfolder-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 180.4 kB

Release files / statsfolder-0.1.0.tar.gz

Download URL statsfolder-0.1.0.tar.gz
Size 150.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e45c90fe7ce4e84e944e263f8d1ab9aae4bbc4cd9cc2ff50fc961ae00629a317
BLAKE2b-256 checksum
How to use checksums
2d03840e270e2c716a1d9a2ef445214ffdf7fdefc3a14f5b567b978aa00a371b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

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

Download URL statsfolder-0.1.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d15098fca75e93d84166981f35bc063e11558327bfcc8989d7c5da31afc51cc6
BLAKE2b-256 checksum
How to use checksums
4bf4854101b51e6b0fa4b83dc38503fbf0260738082ecc8e74730e75d61e5477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

Security for statsfolder 0.1.0

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