Skip to main content

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 .py file in a selected folder.
  • Reads test inputs from input.txt and expected outputs from expected.txt.
  • Runs each test case with timeout protection.
  • Shows pass, wrong-answer, and runtime-error summary.
  • Displays a result pie chart (when matplotlib is available).

Prerequisites

  • Python 3.9 or newer.
  • Spyder 5.4 or newer.
  • A Spyder environment where spyder-autojudge is installed.
  • Optional but recommended: matplotlib for 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

  1. Open Spyder.
  2. Open the AutoJudge pane from Spyder's plugin UI.
  3. Select your working folder from the pane options.
  4. Add three files in that folder:
    • Your solution files (*.py).
    • input.txt containing test inputs.
    • expected.txt containing expected outputs.
  5. 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:

Spyder AutoJudge working screenshot

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spyder_autojudge-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spyder_autojudge-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

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

Hashes for spyder_autojudge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59a5afaba17f12b110de4ce95dd5f54bf4a86c84bb9900ec66c50115e5b6c2fe
MD5 b94fefba88a1976753ee0c6c963ad1f4
BLAKE2b-256 24109eab5e8ef8a5431649a0f62cd00deb82d6d955114426d55301c4abc2eb73

See more details on using hashes here.

Provenance

The following attestation bundles were made for spyder_autojudge-0.1.0.tar.gz:

Publisher: publish-pypi.yml on ArnavSharma2908/spyder-autojudge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spyder_autojudge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spyder_autojudge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48b8f888d881315a25ca2de99e83e1d0c3540feb5f12a5298c25f0611ac8d081
MD5 7ee2b56e0c05fc20a05687aed79f555b
BLAKE2b-256 3a93432262da148375e8bde91780590bf1bc464028c247aadf0a8145e61a4113

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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