cal-pystats
A simple CLI tool that scans directories for Python files and displays statistics.
Features
- Recursively scans directories for
.pyfiles - Reports:
- Number of Python files
- Total size (KB/MB)
- Total lines
- Code lines (excluding blank lines, docstrings, and decorative comments)
- Beautiful ASCII box output with ANSI colours (when running in a terminal)
- Plain text and JSON output formats available
Installation
# Using uv
uv pip install cal-pystats
# Using pip
pip install cal-pystats
Usage
# Scan current directory
cal-pystats
# Scan a specific directory
cal-pystats /path/to/project
# Plain text output (no box)
cal-pystats --plain
# JSON output
cal-pystats --json
Example Output
╭────────────────────────────────╮
│ Python Stats: my-project │
│────────────────────────────────│
│ Files : 42 │
│ Total Size : 128.5 KB │
│ Total Lines : 3,847 │
│ Code Lines : 2,691 │
╰────────────────────────────────╯
Development
# Set up development environment
make dev
# Run linting and type checks
make check
# Format code
make format
# Build wheel and docs
make build
Publishing
Publishing requires cal-publish-python configuration. See the cal-publish-python documentation for setup.
# Build first
make build
# Publish wheel to PyPI and docs to GitLab Pages
make publish
Licence
MIT License — Copyright (c) 2026 Cyber Assessment Labs
Metadata
Release files for cal-pystats 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cal_pystats-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for cal_pystats-1.0.0-py3-none-any.whl |
Release files / cal_pystats-1.0.0-py3-none-any.whl
| Download URL | cal_pystats-1.0.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb6a735c29a30667e996b2790a640b210e0bd727e85677806bfe390476f9979
|
|
BLAKE2b-256 checksum How to use checksums |
862c1105dd7ae087a8a7fa56899d9f2a4bae2d6c3bd4e73f59b671980b94d664
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for cal-pystats 1.0.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.