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.4.tar.gz (6.5 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.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_codecheck-0.4.tar.gz
  • Upload date:
  • Size: 6.5 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.4.tar.gz
Algorithm Hash digest
SHA256 1ca4550eec47034c346793bbae734efe7aff7a92c33e0bd6a04f1364d31b647f
MD5 fdd6b5511262cf8cb23a62e2691b93cb
BLAKE2b-256 58c365766c10012944bc27e0299da9fc17223c44066d39969b2d6cd44cd6aeb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: AIO_CodeCheck-0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e91d1818691845b09aa7a5ce4dc5cb0892e7414bd2209c5ff591859173c96f4a
MD5 6d2cb9bc9b0d08b23277e7083d763016
BLAKE2b-256 d1714a2314e47a58cb654d6df4f08eaf6eaf71caf109f6d1a639af5a58fdccbd

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