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

# Install dependencies
make sync

# Run linting and type checks
make check

# Format code
make format

# Build wheel and docs
make build

# Build docs only
make docs

# Serve docs locally
make docs-serve

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.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cal_pystats-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cal_pystats-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fc0e36e68d25e7be5d28d74087d5954bcb2003d13d0b6c5afbf8a8ab1599b24
MD5 9610edd0bbddd51cc413f326a00c6c47
BLAKE2b-256 0c8a89b38fda196d3c8d30f54014d0ccd673aa997027ff4d6c84c31d6f7140b3

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