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.3.tar.gz (11.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.3-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onejudge-0.3.3.tar.gz
  • Upload date:
  • Size: 11.1 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.3.tar.gz
Algorithm Hash digest
SHA256 eee9a57c3298047a39c3a2071abf889541576e07612dee1d9b0637bbd4daa029
MD5 787482201423a31732f0a9a9b6b47d6f
BLAKE2b-256 0c2ce5b485c0852e7d48e0f78c87ab79f167c158a5282940dc762718329722ea

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: onejudge-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 14.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66516e036fa2f0586eec1f1111e07e12c39f6a54a916ed698df26c9812d595c7
MD5 aac997a236d4060ee2b654dd7365ea6e
BLAKE2b-256 0d2d8c327016f4a04a7f1f1d1bd573a11fe191ce82fe854a8dcc273980448b40

See more details on using hashes here.

Provenance

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