{"id":20555275,"url":"https://github.com/aben20807/local-judge","last_synced_at":"2025-06-26T08:32:45.224Z","repository":{"id":62576561,"uuid":"234668761","full_name":"aben20807/local-judge","owner":"aben20807","description":"judge the program locally","archived":false,"fork":false,"pushed_at":"2025-02-18T03:32:06.000Z","size":290,"stargazers_count":6,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T06:04:40.847Z","etag":null,"topics":["automation","cli","diff","education","judge","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aben20807.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-18T02:10:05.000Z","updated_at":"2025-02-18T03:32:02.000Z","dependencies_parsed_at":"2025-04-14T12:55:25.387Z","dependency_job_id":null,"html_url":"https://github.com/aben20807/local-judge","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/aben20807/local-judge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aben20807%2Flocal-judge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aben20807%2Flocal-judge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aben20807%2Flocal-judge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aben20807%2Flocal-judge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aben20807","download_url":"https://codeload.github.com/aben20807/local-judge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aben20807%2Flocal-judge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262030202,"owners_count":23247611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cli","diff","education","judge","python3"],"created_at":"2024-11-16T03:17:32.703Z","updated_at":"2025-06-26T08:32:45.207Z","avatar_url":"https://github.com/aben20807.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local Judge\n\n[![PyPI](https://img.shields.io/pypi/v/local-judge?color=blue\u0026style=flat\u0026logo=pypi)](https://pypi.org/project/local-judge/)\n[![Downloads](https://pepy.tech/badge/local-judge)](https://pepy.tech/project/local-judge)\n[![Python version](https://img.shields.io/badge/python-_3.9,_3.10,_3.11,_3.12,_3.13-blue.svg)](https://github.com/aben20807/local-judge/actions/workflows/format-check-and-test.yml)\n[![GitHub license](https://img.shields.io/github/license/aben20807/local-judge?color=blue)](LICENSE)\n[![Coding style](https://img.shields.io/badge/code%20style-black-1183C3.svg)](https://github.com/psf/black)\n[![Maintainability](https://api.codeclimate.com/v1/badges/cb5df372c4368bedf7ac/maintainability)](https://codeclimate.com/github/aben20807/local-judge/maintainability)\n\nGiven source code, Makefile (or build commands), input files, and answer files then judge the program locally.\n\n\u003e NOTE: this package is not an \"online judge\" (UVa, LeetCode, etc.) that allows you to solve some algorithmic problems but a tool that can judge (or correct) the students' compiler assignments (included but not limited to) by themselves and by the teaching assistants. You can still use this package to help simulate \"online judge\", which is not the goal of this work.\n\n## Workflow\n\n![Workflow](https://raw.githubusercontent.com/aben20807/local-judge/master/images/workflow.png)\u003c!--https://app.diagrams.net/#G1sHhxLAY34FpYWBGIHJirRF19tevzqwi0--\u003e\n\n## Screenshot\n\n![screenshot](https://raw.githubusercontent.com/aben20807/local-judge/master/images/screenshot.png)\n\n## Installation\n\n+ For global usage:\n\n  ```bash\n  $ pip install local-judge\n  ```\n\n+ With virtualenv:\n\n  ```bash\n  $ virtualenv -p python3.6 venv\n  $ source venv/bin/activate\n  $ pip install local-judge\n  ```\n\n## Features\n\n+ Both\n  + Automatically build the source code into executable\n  + Automatically run the executable for each input and compare output with answer\n  + Customization friendly\n  + Able to leverage git diff tool to compare the result with the answer\n+ Student (`judge`)\n  + Without any dependencies but standard build-in python packages\n+ TA (`ta_judge`)\n  + Two dependencies packages: `openpyxl`, `rarfile`\n  + Support different zip type (`.zip`, `.rar`)\n  + When error is occurred, not interrupt or exit but just log it \n  + Output to excel table\n  + Multiprocessing\n\n## Environment (Recommended)\n\n+ Ubuntu 18.04\n+ python 3.6\n+ git 2.17.1 (Our default diff tool for comparing between output and answer is git. Please make sure that you have installed it.)\n\n## Usage Examples\n\n+ [judge](https://github.com/aben20807/local-judge/tree/master/examples/judge/)\n+ [ta_judge](https://github.com/aben20807/local-judge/tree/master/examples/ta_judge/)\n\n## Documentation of Configuration\n### judge\n\n+ `judge.conf`: be placed in the root of your program [[example]](https://github.com/aben20807/local-judge/tree/master/examples/judge/wrong/judge.conf)\n  + `BuildCommand`: how to build the executable\n  + `Executable`: the name of the executable\n  + `RunCommand`: how to run the executable with input and output\n  + `Inputs`: input files (can use wildcard)\n  + `TempOutputDir`: the temporary directory to place output files\n  + `DiffCommand`: how to find differences between output and answer\n  + `DeleteTempOutput`: whether to delete the temporary output after finding the differences (true or false)\n  + `AnswerDir`: the directory where contains the answer files corresponding to the input files\n  + `AnswerExtension`: the extension of the answer files\n  + `ExitOrLog`: exit when any error occurred or just log the error\n  + `ScoreDict`: the dictionary for the mapping of correctness and score\n  + `TotalScore`: used if the number of tests is more than `ScoreDict`\n  + `Timeout`: execution timeout for each test case\n\n### ta_judge\n\n+ `ta_judge.config`: [[example]](https://github.com/aben20807/local-judge/tree/master/examples/ta_judge/ta_judge.conf)\n  + First part is `judge.conf`\n  + `StudentList`: the execl file which contains student name and id\n  + `StudentsZipContainer`: the directory where contains students' submit homeworks\n  + `StudentsPattern`: used to match zip files\n  + `UpdateStudentPattern`: used for update score of single student\n  + `StudentsExtractDir`: the directory where contains extracted homeworks\n  + `ScoreOutput`: the output excel file\n  + `ExtractAfresh`: true: re-extract zipped file for each judge time; false: use pre-extracted files (under `StudentsExtractDir`) to judge\n\n## Contributing\n\nPlease make sure that you have installed [pre-commit](https://pre-commit.com/) for linting the code with the [black](https://github.com/psf/black) style.\n\n## Development\n\n### Environment\n```bash\n$ virtualenv -p python3.7 venv3.7\n$ source venv3.7/bin/activate\n$ python setup.py develop\n$ pip install -e .\n$ pip list\nPackage            Version Location\n------------------ ------- ---------------------------------\nblack              21.12b0\nclick              8.0.3\net-xmlfile         1.1.0\nimportlib-metadata 4.10.0\nlocal-judge        2.4.7   /home/ben/pro/selfpro/local-judge\nmypy-extensions    0.4.3\nopenpyxl           3.0.9\npathspec           0.9.0\npip                21.0.1\nplatformdirs       2.4.1\nrarfile            4.0\nsetuptools         54.1.1\ntomli              1.2.3\ntyped-ast          1.5.1\ntyping-extensions  4.0.1\nwheel              0.36.2\nzipp               3.6.0\n```\n\n### Run the test locally\n```bash\n$ python -m pytest tests/test_cli.py\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faben20807%2Flocal-judge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faben20807%2Flocal-judge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faben20807%2Flocal-judge/lists"}