Skip to main content

A simple Python code evaluation tool.

Project description

Python Code Evaluation Tool

A lightweight Python-based tool designed to evaluate the quality of Python scripts based on correctness, coding style, and syntax validity.

Features

  • Test Case Execution: Automatically runs predefined test cases and checks for correctness.
  • Style Evaluation: Analyzes variable naming conventions and line lengths to ensure compliance with Python style guidelines (PEP-8).
  • Syntax Checking: Ensures the provided code is syntactically correct.
  • Score Calculation: Provides a detailed report with scores for correctness, style, and syntax, along with a final evaluation.
  • Feedback Output: Generates a comprehensive evaluation report as a .txt file.

Installation

  1. Clone the Repository

    git clone <repository-url>
    cd python-code-evaluation-tool
    
  2. Install Requirements (if applicable) No external libraries are required; the tool uses Python's built-in modules.

Usage

Run the tool from the command line using the following syntax:

python evaluator.py -f <path-to-your-script> [-o <output-feedback-path>]

Arguments

  • -f, --file: (Required) Path to the Python file to evaluate.
  • -o, --output: (Optional) Path to save the evaluation report as a .txt file.

Example

python evaluator.py -f sample_script.py -o feedback.txt

Scoring

The final evaluation score is computed using the following weights:

  • Correctness: 70%
  • Style: 20%
  • Syntax: 10%

A score of 90% or higher results in code approval.

Output

The tool provides a summary in the terminal and optionally saves a detailed .txt report. The report includes:

  • Correctness, style, and syntax scores.
  • A list of style issues (if any).
  • Final evaluation status (ACCEPTED/REJECTED).

Sample Output

Terminal Output:

Evaluating your code...
...

Summary:
Correctness: 100%
Style: 80%
Syntax: 100%
Final Score: 94%
Result: Your code passed the evaluation ✅

Feedback Report:

========================================
Code Evaluation Report
========================================

Scores:
- Correctness: 100%
- Style: 80%
- Syntax: 100%
- Final Score: 94%

Evaluation Summary:
Your code is ACCEPTED ✅

Style Issues:
  - Variable 'TestVariable' is not in snake_case.
  - Line 12 exceeds 79 characters.

========================================
Detailed Feedback:
- Variable 'TestVariable' is not in snake_case.
- Line 12 exceeds 79 characters.

Contributing

Feel free to open issues or submit pull requests for additional features or improvements.

License

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

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

aio_codecheck-0.5.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

AIO_CodeCheck-0.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file aio_codecheck-0.5.tar.gz.

File metadata

  • Download URL: aio_codecheck-0.5.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for aio_codecheck-0.5.tar.gz
Algorithm Hash digest
SHA256 c7b4dbc3101f8b3831367dcce46b7508f6fe84181fb19ef18499de112759d5ab
MD5 49f393fb7f0b8862ec430f72f18d2a37
BLAKE2b-256 32b1fd8d88d1bbfdd51ab41672f7ef97e6854e88775328a93d5c5668421459db

See more details on using hashes here.

File details

Details for the file AIO_CodeCheck-0.5-py3-none-any.whl.

File metadata

  • Download URL: AIO_CodeCheck-0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for AIO_CodeCheck-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 147a4f2019a310c0d2ee7682f024246e547c8a53c68db612973f87155d03eadd
MD5 95f40905a65b21a7692e72003c037823
BLAKE2b-256 553762db945514c44844d4aef0cdd939345d830a51879e2c230dd76af133e0e7

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