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.2.tar.gz (5.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.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_codecheck-0.2.tar.gz
  • Upload date:
  • Size: 5.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.2.tar.gz
Algorithm Hash digest
SHA256 9b9efa0653767c06127b5c4a3c2fd83d31f7eef8160c08f9015606801f2c9761
MD5 2979c1f48dbfff2f6361e39160f54aa1
BLAKE2b-256 8f008132cf7ba615a2a4af614d14e229a864d4c3cba4946c78e3382e4596ff64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: AIO_CodeCheck-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bfde67ec22ee137b06e29731062e8ddd0996f0bc6fed15743cd6968f7a7c7354
MD5 0a05a999eea243537c79d05e6462a3e5
BLAKE2b-256 30838ee181de48a3880ecc74bfa657b7877aa12b185ecccd92c5d8bc891b4675

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