pycomgrader


Namepycomgrader JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryThis module provides a grader for c++ programs.
upload_time2024-12-31 10:18:42
maintainerNone
docs_urlNone
authorAnibal Hernández
requires_python>=3.10
licenseMIT License Copyright (c) 2024 ajhglez99 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords competitive programming educational grader c++
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyComGrader: A Python Package for Grading C++ Programs

## Table of Contents
- [Introduction](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Introduction

PyComGrader is a Python package designed to help educators and students easily evaluate and grade C++ programs against multiple test cases. It provides a simple and efficient way to test programs against multiple test cases and can be used on multiple platforms, including Windows and Linux. The package can be used as a command-line tool and provides various options to customize the grading process. PyComGrader aims to simplify the process of setting up training contests offline, testing problems against multiple test cases during a contest to get preliminary results, and helping prepare and form competitive programmers. However, please note that this package is not intended for official contests and is solely meant as an educational tool.

## Features

- Grade C++ programs against multiple test cases
- Command-line interface for easy usage
- Customizable time and memory limits
- Detailed status messages for each test case
- Cross-platform support (Windows and Linux)

## Installation

To install PyComGrader, use pip:

```sh
pip install pycomgrader
```

### Prerequisites

Before using PyComGrader, ensure that you have `g++` installed and accessible in your system's PATH. PyComGrader relies on `g++` to compile C++ programs before grading them. You can install `g++` using your system's package manager. For example, on Ubuntu, you can install it with:

```sh
sudo apt-get install g++
```

On Windows, you can install `g++` as part of MinGW or through other means.

## Usage

### Getting Started

To start using PyComGrader, follow these steps:

1. Install PyComGrader by running `pip install pycomgrader` in your terminal.
2. Import the necessary modules: `from pycomgrader import Grader`.
3. Create a `Grader` object with the file to test, time limit, and memory limit: `grader = Grader(2000, 128, exec_file = 'my_program')`
4. Create a corresponding directory for the test cases, and place the input files (with the extension `.in`) and expected output files (with the extension `.out`) inside. The filenames for the input and output files can be arbitrary, but they must have the same name. For example, you can have 01.in, 01.out, 02.in, 02.out, etc.
5. Test the program against one or more test cases using the `grader.grade('test_cases_dir')` method.

### Command Line Interface

PyComGrader can be used as a command-line tool by running `pycomgrader` followed by the path to the file to test and the directory with the test cases. For example:
```bash
$ pycomgrader my_program.cpp test_cases_dir
```
You can specify the time limit (milliseconds) and memory limit (megabytes) as positional arguments respectively:
```bash
$ pycomgrader my_program.cpp test_cases_dir 1000 32
```
One of the key features of PyComGrader is its ability to execute C++ programs directly, without the need for a separate compiler. This makes it easy to use on systems where a C++ compiler is not installed, or where the user has other means of compiling their source code. Users can use the `-e` flag when running PyComGrader to indicate that a file should be executed directly.
```bash
$ pycomgrader my_program test_cases_dir -e
```
This will tell PyComGrader to execute the contents of `my_program` directly, rather than compiling it first.

For detailed usage information, run:
```bash
$ pycomgrader --help
```

## License

PyComGrader is released under the MIT License. See LICENSE for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pycomgrader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "competitive programming, educational, grader, c++",
    "author": "Anibal Hern\u00e1ndez",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9e/f8/4979e15be173cc800b8e1a169f540d4a8247f062ed20a047bcc5a62a6557/pycomgrader-1.1.0.tar.gz",
    "platform": null,
    "description": "# PyComGrader: A Python Package for Grading C++ Programs\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Introduction\n\nPyComGrader is a Python package designed to help educators and students easily evaluate and grade C++ programs against multiple test cases. It provides a simple and efficient way to test programs against multiple test cases and can be used on multiple platforms, including Windows and Linux. The package can be used as a command-line tool and provides various options to customize the grading process. PyComGrader aims to simplify the process of setting up training contests offline, testing problems against multiple test cases during a contest to get preliminary results, and helping prepare and form competitive programmers. However, please note that this package is not intended for official contests and is solely meant as an educational tool.\n\n## Features\n\n- Grade C++ programs against multiple test cases\n- Command-line interface for easy usage\n- Customizable time and memory limits\n- Detailed status messages for each test case\n- Cross-platform support (Windows and Linux)\n\n## Installation\n\nTo install PyComGrader, use pip:\n\n```sh\npip install pycomgrader\n```\n\n### Prerequisites\n\nBefore using PyComGrader, ensure that you have `g++` installed and accessible in your system's PATH. PyComGrader relies on `g++` to compile C++ programs before grading them. You can install `g++` using your system's package manager. For example, on Ubuntu, you can install it with:\n\n```sh\nsudo apt-get install g++\n```\n\nOn Windows, you can install `g++` as part of MinGW or through other means.\n\n## Usage\n\n### Getting Started\n\nTo start using PyComGrader, follow these steps:\n\n1. Install PyComGrader by running `pip install pycomgrader` in your terminal.\n2. Import the necessary modules: `from pycomgrader import Grader`.\n3. Create a `Grader` object with the file to test, time limit, and memory limit: `grader = Grader(2000, 128, exec_file = 'my_program')`\n4. Create a corresponding directory for the test cases, and place the input files (with the extension `.in`) and expected output files (with the extension `.out`) inside. The filenames for the input and output files can be arbitrary, but they must have the same name. For example, you can have 01.in, 01.out, 02.in, 02.out, etc.\n5. Test the program against one or more test cases using the `grader.grade('test_cases_dir')` method.\n\n### Command Line Interface\n\nPyComGrader can be used as a command-line tool by running `pycomgrader` followed by the path to the file to test and the directory with the test cases. For example:\n```bash\n$ pycomgrader my_program.cpp test_cases_dir\n```\nYou can specify the time limit (milliseconds) and memory limit (megabytes) as positional arguments respectively:\n```bash\n$ pycomgrader my_program.cpp test_cases_dir 1000 32\n```\nOne of the key features of PyComGrader is its ability to execute C++ programs directly, without the need for a separate compiler. This makes it easy to use on systems where a C++ compiler is not installed, or where the user has other means of compiling their source code. Users can use the `-e` flag when running PyComGrader to indicate that a file should be executed directly.\n```bash\n$ pycomgrader my_program test_cases_dir -e\n```\nThis will tell PyComGrader to execute the contents of `my_program` directly, rather than compiling it first.\n\nFor detailed usage information, run:\n```bash\n$ pycomgrader --help\n```\n\n## License\n\nPyComGrader is released under the MIT License. See LICENSE for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 ajhglez99  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "This module provides a grader for c++ programs.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ajhglez99/PyComGrader"
    },
    "split_keywords": [
        "competitive programming",
        " educational",
        " grader",
        " c++"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c685460272636d4708846ce93022037bf316d5ae282e2cfb1418bd075dab1bc8",
                "md5": "75f95ca3ec93776015ef37e6ff7b55a0",
                "sha256": "d25fb63a44e93997e582d70502ec047ebc3c57a57055dcec85aef61b6cf8a749"
            },
            "downloads": -1,
            "filename": "pycomgrader-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75f95ca3ec93776015ef37e6ff7b55a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 9303,
            "upload_time": "2024-12-31T10:18:40",
            "upload_time_iso_8601": "2024-12-31T10:18:40.691579Z",
            "url": "https://files.pythonhosted.org/packages/c6/85/460272636d4708846ce93022037bf316d5ae282e2cfb1418bd075dab1bc8/pycomgrader-1.1.0-py3-none-any.whl",
            "yanked": true,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ef84979e15be173cc800b8e1a169f540d4a8247f062ed20a047bcc5a62a6557",
                "md5": "94177614f68ad2052385c1edde98ef94",
                "sha256": "2cbc7e4653b0901f7daad4f1cafe1591558f483bc3ef7c528188f4b7c47bafee"
            },
            "downloads": -1,
            "filename": "pycomgrader-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "94177614f68ad2052385c1edde98ef94",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 9987,
            "upload_time": "2024-12-31T10:18:42",
            "upload_time_iso_8601": "2024-12-31T10:18:42.973425Z",
            "url": "https://files.pythonhosted.org/packages/9e/f8/4979e15be173cc800b8e1a169f540d4a8247f062ed20a047bcc5a62a6557/pycomgrader-1.1.0.tar.gz",
            "yanked": true,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-31 10:18:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ajhglez99",
    "github_project": "PyComGrader",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pycomgrader"
}
        
Elapsed time: 0.36480s