Skip to main content

Typed async Python SDK for onejudge

Project description

onejudge

Typed async Python access to the onejudge CLI. The distribution is onejudge, the import is onejudge_sdk, and each release depends on the exact same onejudge-cli version.

pip install onejudge
import asyncio

from onejudge_sdk import OneJudge


async def main() -> None:
    result = await OneJudge().run(
        {"provider": {"kind": "oneharness"}},
        "Review this repository",
        cwd="/path/to/repository",
        timeout=3600,
    )
    print(result.completed, result.assistant_turns, result.verdicts)


asyncio.run(main())

run validates the config before starting the CLI, writes a temporary effective JSON config (JSON is valid YAML), and always sends the task over stdin with --task -. It accepts a provider override, subprocess cwd, additional env (including ONEHARNESS_HISTORY_LABELS and ONEHARNESS_TIMEOUT), and a timeout. Executable resolution is the constructor's executable, then ONEJUDGE_BIN, then onejudge on PATH.

Exit 0 and 1 return RunResult: exit_code and stderr remain available, and raw, completed, verdicts, usage, assistant_turns, and agent_turns cover ai-orchestrator's dispatch needs. Exit 2 (bad config or provider/runtime failure) and unexpected nonzero exits raise OneJudgeProcessError without discarding the exit code or stderr. A caller timeout raises OneJudgeTimeoutError.

There is no run_stream method. onejudge run currently emits one final JSON report; the JSONL interface in docs/protocol.md is the internal provider protocol, not a CLI result stream.

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

onejudge-0.3.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

onejudge-0.3.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file onejudge-0.3.2.tar.gz.

File metadata

  • Download URL: onejudge-0.3.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for onejudge-0.3.2.tar.gz
Algorithm Hash digest
SHA256 d6a6bbf89e9c4f78aeee805d29d92206754f1fd4babe6a7ce0ca7771d0099f5a
MD5 9f1bef7304da1896ed3dff346c146541
BLAKE2b-256 83437a4bdae9f5537e25e3db850086f50b5a1b2fd869f935c775e1a48c8f3a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for onejudge-0.3.2.tar.gz:

Publisher: release-pypi.yml on nickderobertis/onejudge

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

File details

Details for the file onejudge-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: onejudge-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for onejudge-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 67955b0e4288100c2cd5768fc39686a45a151017e902408ca1b00de3d4c3eba5
MD5 718ced7da44bac4fac493a5bfac3704c
BLAKE2b-256 4a0a3948ad31c194dfe171fee3d5b824938708d467ec03671230795711c5452f

See more details on using hashes here.

Provenance

The following attestation bundles were made for onejudge-0.3.2-py3-none-any.whl:

Publisher: release-pypi.yml on nickderobertis/onejudge

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