Skip to main content

A package to evaluate Python code submissions

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_codecheck-0.3.tar.gz
  • Upload date:
  • Size: 6.1 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.3.tar.gz
Algorithm Hash digest
SHA256 b95b890a004427782f3fe53467e131cbeacc5a0310ee2829686342a94a6a4b26
MD5 71f74e18e07d40d1c3c8df0d9b4fc567
BLAKE2b-256 cffdf0cf5b321181e9123cbd337b15ad7d60fb37cee0e35f1514c1c846f8bbfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: AIO_CodeCheck-0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 09302151ecd3b40c5417e58feb07ad48ac7579bb9e634869a297ebeb68b1b9fe
MD5 8566484de30e591137e49d29a586b2e2
BLAKE2b-256 1dce4d8c4765951fc04a27213e6abd00ff5ea43c3ae82bc51cfed0655e3c7ec6

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