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 and 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.4.7-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cal_pystats-0.4.7-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ea54fdf5f69064d5b6a8001e710c875d2b2d17b00fb6d226db0a3c36b2176eaf
MD5 af0fabad5151af4919cb417b1db54b3e
BLAKE2b-256 f700479e18675be80a8002878a47454483ef46a0e1a1d77e54dccd7edf69c1a2

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