Skip to main content

Python client for the Py-Ritone Baritone bridge

Project description

pyritone

pyritone is the Python client for the Py-Ritone Fabric bridge.

Install

pip install pyritone

Beginner usage

from pyritone import PyritoneClient

with PyritoneClient() as client:
    dispatch = client.goto(100, 70, 100)
    task_id = dispatch.get("task_id")
    if task_id:
        terminal = client.wait_for_task(task_id)
        print(terminal["event"])

Command API

All top-level Baritone v1.15.0 commands are exposed as Python methods on:

  • PyritoneClient (sync)
  • AsyncPyritoneClient (async)

Each command returns immediate dispatch info:

  • command_text
  • raw bridge response
  • optional task_id
  • optional accepted

Command aliases are exposed too (qmark, stop, wp, etc). Full generated reference:

  • python/docs/baritone-commands.md

Settings API

You can control Baritone settings through a settings namespace.

from pyritone import PyritoneClient

with PyritoneClient() as client:
    client.settings.allowSprint = True
    client.settings.allowBreak = False

    print(client.settings.allowSprint.get())
    print(client.settings.allowSprint.toggle())
    print(client.settings.allowSprint.reset())

Async style:

from pyritone import AsyncPyritoneClient

client = AsyncPyritoneClient()
await client.connect()
try:
    await client.settings.allowSprint.set(True)
    await client.settings.allowSprint.get()
finally:
    await client.close()

Low-level API still available

  • execute("...")
  • cancel()
  • ping()
  • status_get()
  • next_event()
  • wait_for_task(task_id)

Zero-setup discovery

By default, pyritone discovers bridge details from:

  • <minecraft>/config/pyritone_bridge/bridge-info.json

Override priority:

  1. Explicit constructor args
  2. Environment variables (PYRITONE_BRIDGE_INFO, PYRITONE_TOKEN, PYRITONE_HOST, PYRITONE_PORT)
  3. Default bridge info file

CLI

pyritone ping
pyritone status
pyritone exec "goto 100 70 100"
pyritone cancel
pyritone events

Regenerate command wrappers/docs

python tools/generate_baritone_commands.py

End-to-End Dev Test

  1. Start Minecraft dev client from the mod folder:
cd ..\mod
.\gradlew.bat devClient
  1. Join a world.
  2. Run one of the example scripts:
cd ..\python
python example_sync.py
python example_async.py

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

pyritone-0.1.1.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

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

pyritone-0.1.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file pyritone-0.1.1.tar.gz.

File metadata

  • Download URL: pyritone-0.1.1.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyritone-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b743da461b40259997c6728761a060eadca180d2f2480ada261e2532eb368e04
MD5 14951ecd69cbfe6bfade04931b7da39a
BLAKE2b-256 f563cf728ce43e97f5c6eba649fef495b96a9336a10773cb7b1ebeff4f7bbbf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyritone-0.1.1.tar.gz:

Publisher: publish.yml on GSstarGamer/Py-Ritone

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

File details

Details for the file pyritone-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyritone-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyritone-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8c864e5e51b8064c88f895afaff8b0ddc4efaa39ff4536be108fb061814001
MD5 b4bb57363856ec4000ec6f276b191fc4
BLAKE2b-256 6215291ab01d912d4849f3b156e53c46bcba4a3060e724d80bad9d74c0e5aa25

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyritone-0.1.1-py3-none-any.whl:

Publisher: publish.yml on GSstarGamer/Py-Ritone

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