Skip to main content

beetlelib

The canonical Żuczki battle-royale engine, bot contract and training library. Use it to write a bot, train it locally against the native engine, and submit it to the platform unchanged.

pip install beetlelib
beetlelib init my-bot
cd my-bot
python run_local.py

Quickstart

import math
from beetlelib import Bot, Action, Control, Env
from beetlelib.bot.examples.greedy_bot import GreedyBot


class MyBot(Bot):
    def __init__(self) -> None:
        self.ready_to_play()  # finish slow setup before signalling ready

    def act(self, observations):
        actions = {}
        for beetle_id, obs in observations.items():
            # steer toward the nearest food
            target = min(obs.points, key=lambda p: (p.x - obs.me.x) ** 2 + (p.y - obs.me.y) ** 2, default=None)
            angle = math.atan2(target.y - obs.me.y, target.x - obs.me.x) if target else obs.me.angle
            actions[beetle_id] = Action(angle, Control.NONE)
        return actions


env = Env(seed=7, opponents=[GreedyBot(), GreedyBot(), GreedyBot()])
obs, done = env.reset(), False
bot = MyBot()
while not done:
    obs, rewards, done = env.step(bot.act(obs))

The contract

One method, shared by every controller (your bot, the baselines, the live human):

def act(self, observations: dict[str, Observation]) -> dict[str, Action]

You own a pair of two beetles, so you receive two observations (keyed by beetle id) and return two actions. An Action is a steering target_angle plus a Control flag. An Observation is your beetle's vision-bounded view: itself (me), and the nearby beetles, points, rubys, obstacles and projectiles.

See src/template/task.md (ships with the participant kit) for the full rules, the observation/action fields, the limits, and how to submit.

Submit from the command line

Log in once. The password is requested without displaying it and is not saved:

beetlelib login --server https://example.com --username your-name

Then upload bot.py and any other Python files it needs:

beetlelib upload bot.py helpers.py --name my-bot

You can pass a directory instead; all .py files directly inside it will be uploaded. If your class is not MyBot in bot.py, provide its module and class name:

beetlelib upload my-bot/ --name my-bot \
  --command "python -m beetlelib.bot.runner agent:SmartBot"

Metadata

Release files for beetlelib 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beetlelib 0.1.0
File Size Uploaded Provenance Actions
beetlelib-0.1.0.tar.gz 317.0 kB With provenance Details for beetlelib-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for beetlelib 0.1.0
File Actions
beetlelib-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for beetlelib-0.1.0-py3-none-win_amd64.whl
beetlelib-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details for beetlelib-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
beetlelib-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for beetlelib-0.1.0-py3-none-macosx_11_0_arm64.whl
beetlelib-0.1.0-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for beetlelib-0.1.0-py3-none-macosx_10_9_x86_64.whl

Total release size: 678.9 kB

Release files / beetlelib-0.1.0.tar.gz

Download URL beetlelib-0.1.0.tar.gz
Size 317.0 kB
Tags Source
SHA-256 checksum
How to use checksums
eb4a8400002c992842e97a0580461bbd5394dfb52aef6d9a250227469ad0bcca
BLAKE2b-256 checksum
How to use checksums
68b95e8b072ec718b87f0fb036a4ad2fe04f37d2a0bbe40eed9dd7e41ce98729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / beetlelib-0.1.0-py3-none-win_amd64.whl

Download URL beetlelib-0.1.0-py3-none-win_amd64.whl
Size 110.2 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4d35b397a4f2855122c070131ace91e062316e7079fee5fad0cbd762c0679cde
BLAKE2b-256 checksum
How to use checksums
9b46b99faee7503e68f403cc65606187ca5d648b804d19135ba62f26e6350eb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / beetlelib-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL beetlelib-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 86.7 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
167bd958670e44d0763ef8d3279c26ea51d2da4431c0f171e0a0816bd89423cf
BLAKE2b-256 checksum
How to use checksums
1ab359a12e678c7848d8c4e7565593d3f3fabadc0dbac020e1df939d5df467b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / beetlelib-0.1.0-py3-none-macosx_11_0_arm64.whl

Download URL beetlelib-0.1.0-py3-none-macosx_11_0_arm64.whl
Size 81.4 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ceae482691f28fb7ae4fa5b3b84955f79c7c149cdc26c2445784c8cdc9ec91bb
BLAKE2b-256 checksum
How to use checksums
77a92f617efa2afe1962c0e7266c025dee7c3b9b97624c8702dab987cc95d89f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / beetlelib-0.1.0-py3-none-macosx_10_9_x86_64.whl

Download URL beetlelib-0.1.0-py3-none-macosx_10_9_x86_64.whl
Size 83.5 kB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e548afcd721f422d29623e08c1d8a9b52e006d3c0a12a2da847a05e5c90d8b0b
BLAKE2b-256 checksum
How to use checksums
59517392b0414217dae61c1d1b627c7b226293b840b9be417168e60e991ff2fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Security for beetlelib 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for beetlelib-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page