Spyder dockable pane to run input/expected test cases for the latest Python file.
Project description
Spyder AutoJudge
Spyder AutoJudge is a Spyder plugin that adds a dockable pane for running competitive-programming style test cases against the latest modified Python file in a target folder.
Features
- Detects the latest modified
.pyfile in a selected folder. - Reads test inputs from
input.txtand expected outputs fromexpected.txt. - Runs each test case with timeout protection.
- Shows pass, wrong-answer, and runtime-error summary.
- Displays a result pie chart (when
matplotlibis available).
Prerequisites
- Python 3.9 or newer.
- Spyder 5.4 or newer.
- A Spyder environment where
spyder-autojudgeis installed. - Optional but recommended:
matplotlibfor the pie chart visualization.
Installation
Install from PyPI:
pip install spyder-autojudge
If you use virtual environments, install into the same environment used by Spyder.
Quick verification:
python -m pip show spyder-autojudge
If Spyder does not detect the plugin, restart Spyder after installation.
Usage
- Open Spyder.
- Open the AutoJudge pane from Spyder's plugin UI.
- Select your working folder from the pane options.
- Add three files in that folder:
- Your solution files (
*.py). input.txtcontaining test inputs.expected.txtcontaining expected outputs.
- Your solution files (
- Click
Run Latest.
AutoJudge will select the most recently modified Python file and run it against each test case pair.
Recommended working folder layout
your-problem-folder/
solution.py
trial.py
input.txt
expected.txt
Run Latest will choose whichever Python file has the latest modified timestamp.
Test case format
Use blank lines to separate test cases in both files. Test case count must match between input.txt and expected.txt.
input.txt example:
2
3
10
20
expected.txt example:
5
30
How input.txt is used
- Each block is passed to the program's stdin for one test case.
- Multi-line input is supported inside a block.
- Blocks are split on blank lines.
How expected.txt is used
- Each block is the exact expected stdout for the corresponding input block.
- Output comparison is done per test case.
- The number of blocks must be equal to
input.txt.
Result statuses
- SUCCESS: Program output matches expected output.
- WRONG OUTPUT: Program ran but output did not match expected output.
- ERROR: Runtime error, timeout, or execution issue.
Pie chart and summary panel
When matplotlib is available, AutoJudge renders a pie chart with:
- Success (green)
- Wrong (orange)
- Error (red)
If no test data is available yet, the chart area shows a placeholder message.
Working screenshot
Add your screenshot to docs/images/autojudge-working.png, then this section will render automatically:
Development
python -m pip install -U build twine
python -m build
python -m twine check dist/*
Publishing to PyPI
python -m twine upload dist/*
For first release, test on TestPyPI first:
python -m twine upload --repository testpypi dist/*
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spyder_autojudge-0.1.0.tar.gz.
File metadata
- Download URL: spyder_autojudge-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a5afaba17f12b110de4ce95dd5f54bf4a86c84bb9900ec66c50115e5b6c2fe
|
|
| MD5 |
b94fefba88a1976753ee0c6c963ad1f4
|
|
| BLAKE2b-256 |
24109eab5e8ef8a5431649a0f62cd00deb82d6d955114426d55301c4abc2eb73
|
Provenance
The following attestation bundles were made for spyder_autojudge-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on ArnavSharma2908/spyder-autojudge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spyder_autojudge-0.1.0.tar.gz -
Subject digest:
59a5afaba17f12b110de4ce95dd5f54bf4a86c84bb9900ec66c50115e5b6c2fe - Sigstore transparency entry: 1342705539
- Sigstore integration time:
-
Permalink:
ArnavSharma2908/spyder-autojudge@aa1c9005a9fa5178fd3c34a95d6b734522fbcfe0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ArnavSharma2908
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@aa1c9005a9fa5178fd3c34a95d6b734522fbcfe0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spyder_autojudge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spyder_autojudge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48b8f888d881315a25ca2de99e83e1d0c3540feb5f12a5298c25f0611ac8d081
|
|
| MD5 |
7ee2b56e0c05fc20a05687aed79f555b
|
|
| BLAKE2b-256 |
3a93432262da148375e8bde91780590bf1bc464028c247aadf0a8145e61a4113
|
Provenance
The following attestation bundles were made for spyder_autojudge-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ArnavSharma2908/spyder-autojudge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spyder_autojudge-0.1.0-py3-none-any.whl -
Subject digest:
48b8f888d881315a25ca2de99e83e1d0c3540feb5f12a5298c25f0611ac8d081 - Sigstore transparency entry: 1342705554
- Sigstore integration time:
-
Permalink:
ArnavSharma2908/spyder-autojudge@aa1c9005a9fa5178fd3c34a95d6b734522fbcfe0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ArnavSharma2908
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@aa1c9005a9fa5178fd3c34a95d6b734522fbcfe0 -
Trigger Event:
workflow_dispatch
-
Statement type: