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.

The Rust JSON Schemas generate the SDK's complete public type surface. Besides RunConfig and RunReport, nested contracts such as ProviderConfig, EvalConfig, Transcript, Usage, and JudgeVerdict are importable from onejudge_sdk; StreamEvent describes the Rust streaming envelope.

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.4.tar.gz (12.1 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.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onejudge-0.3.4.tar.gz
Algorithm Hash digest
SHA256 f0a693f4405a33357f1b11e12bde896672250eaacd363f648ed75edc703fecbd
MD5 558ea27c074121b40a8aa17934e23b7f
BLAKE2b-256 7780601cd9f5d3247ecc1636f549d827e4e4abd08417718d4e49084660df46c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for onejudge-0.3.4.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.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for onejudge-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a01cd930444c37108ef1f9cbf837ab11d01aaddf8b6d81c5677640425421a47f
MD5 0608539d84367c986d8924ad4607cea2
BLAKE2b-256 aea7c864c54506fa24a9251d45c822f2d8e84064cc67d1d851e6d34bf018b1bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for onejudge-0.3.4-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