Skip to main content

A simple CLI tool to analyse Python file statistics in a directory

Project description

cal-pystats

A simple CLI tool that scans directories for Python files and displays statistics.

Features

  • Recursively scans directories for .py files
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cal_pystats-0.5.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file cal_pystats-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cal_pystats-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cal_pystats-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe083bc2f85f48f9d6bff9260c819ba41ee553b729aa4b0101a3ae7b6da0df33
MD5 5d7d886b70f8297a9c280abd765a742b
BLAKE2b-256 2c50741d59113ad455285761099265063f86a77aa07c271cd71fd234a2cfa89e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page