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 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 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:

python -m pyfilemetre <path_to_project>

Example:

python -m pyfilemetre "C:\Users\You\Desktop\demo_project"

Saving the report.md file:

<path_to_project\report.md>

Example:

C:\Users\You\Desktop\demo_project\report.md

Note:

  • Do not put the file path in double quotes ("") when entering as path to save report.md file.
  • Always specify \report.md at the end of the path you give.

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:

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

Example Output

Terminal summary:

## 📈 Project Totals
  Total Files: 5
  Total Functions: 20
  Total Classes: 1
  Total Missing Docstrings: 13

# 🧩 pyfilemetre Report
| File | Functions | Classes | Missing Docs |
|------|------------|----------|---------------|
| setup.py | 0 | 0 | 0 |
| analyzer.py | 6 | 1 | 1 |
| cli.py | 2 | 0 | 2 |
| __init__.py | 0 | 0 | 0 |
| test_analyzer.py | 12 | 0 | 10 |
  • 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.5.tar.gz (6.9 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.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfilemetre-0.1.5.tar.gz
  • Upload date:
  • Size: 6.9 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.5.tar.gz
Algorithm Hash digest
SHA256 19982ee9d69b3c3af3542113c571372ee585d923a4550309f211bf31e010e7f5
MD5 f0a6fc2be6147d18b5ee045852b63ea8
BLAKE2b-256 a56bfd71b39f66b8158e6e93c6df02b2d8ff35f17f6a5919a206bd61f6639bcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfilemetre-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8190297bfd917755443377681781c93268121e0a6c155433286d7e351da8304d
MD5 f464da9e6c352fe04aa397d90c6ba31b
BLAKE2b-256 fdc6f89ac10bac7bee412198a13616cfaab95d25c09fde81bad670f34c745ce1

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