Skip to main content

pyfilemetre is a Python CLI tool that analyzes code using AST — counting functions, classes, and missing docstrings, and generating Markdown reports.

Project description

pyfilemetre: Python Codebase Analyzer

pyfilemetre is a Python CLI tool that calculates lines of code (LOC), counts classes and functions, checks for docstrings, and generates Markdown reports for Python projects. It is designed to give you a clear, file-by-file summary of your codebase quickly.


Features

  • Counts lines of code (LOC) per file.
  • Counts classes and functions.
  • Checks for missing docstrings.
  • Generates Markdown reports summarizing the project.
  • Interactive CLI with spinner animation.
  • Optional flag to skip saving the report.

Installation

You can install pyfilemetre from PyPI:

pip install pyfilemetre

Note: Currently not available for local development!


Usage

Run pyfilemetre on a Python file or directory:

pyfilemetre <path_to_project>

Example:

pyfilemetre "C:\Users\You\Desktop\demo_project"

Execution Flow

  1. You'll see a spinner animation showing progress.
  2. The terminal will display a summary of classes, functions, and docstrings.
  3. You’ll be prompted to save a Markdown report. Enter y to save and provide a path, or n to skip.

Optional Flags

  • --no-md = Skip saving the Markdown report.

Example with flag:

pyfilemetre "C:\Users\You\Desktop\demo_project" --no-md

Example Output

Terminal summary:

File: utils.py
  LOC: 120
  Functions: 5
  Classes: 2
  Missing docstrings: 1

File: main.py
  LOC: 200
  Functions: 8
  Classes: 1
  Missing docstrings: 0
  • Markdown report: report.md generated with the same details per file.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Notes

  • Python 3.8+ required.
  • Works on Windows, macOS, and Linux.
  • Tabulate library is used for nice terminal output.

Created by Aditi Gupta.

Project details


Download files

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

Source Distribution

pyfilemetre-0.1.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

pyfilemetre-0.1.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pyfilemetre-0.1.3.tar.gz.

File metadata

  • Download URL: pyfilemetre-0.1.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for pyfilemetre-0.1.3.tar.gz
Algorithm Hash digest
SHA256 91fbc41032647656c37a90aa4fe82bc8e97cb007d0e9b36c0406c383cfd93cd2
MD5 6489ba375b65dab362e8f7bbffb8ee5d
BLAKE2b-256 f6a849779b6a142cbaa2745530259b36a68650832e62a3f35f5e601793232d45

See more details on using hashes here.

File details

Details for the file pyfilemetre-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyfilemetre-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for pyfilemetre-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 34bdbc2fcf857e12badd8614c95dc2794aba52f9f199441a57471801db9f1402
MD5 9fb8317988a5d7adcb3e677504eb1f0f
BLAKE2b-256 a38aa32bd7b1b2c20440bfd317d498688c08c5c0d16b968ed7fcc0cdc3f1611c

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