Skip to main content

Code Battles CLI

A CLI for competitors in any Code Battles event!

🏃 Getting Started  ·  💡 Features

Getting Started

  • Install the library by running pip install code-battles-cli.
  • Make sure you have the Python scripts folder in your PATH by running code-battles --help.
  • If that fails, run py -m code_battles_cli --help.

The first time you run any command you will be asked for your URL, username and password, and they'll be saved in a code-battles.json file for successive calls.

Features

Downloading the bots

You can download all of the bots your team has by running code-battles download.

Uploading a bot

You can update a bot in the website by running code-battles upload bots/example.py (in this case the bot's name will be example).

If you want to choose a custom bot name, you can run code-battles upload bots/example.py -n myamazingbot.

Running a simulation

You can run a simulation by running code-battles run '{"map": "NYC"}' bots/example.py bots/another_example.py, where NYC is an example of a map.

You will probably find the scripting API nicer to work with if you want to run simulations locally.

Usage in scripts

You can import the code_battles_cli.api module and utilize its Client class to hack Code Battles for your needs!

Example:

from code_battles_cli.api import Client

client = Client()

print(client.get_bots())
print(client.run_simulation("NYC", ["bots/example.py", "bots/another_example.py"]))

Development

For development, you should set up the pre-commit hooks with uv run pre-commit install.

Metadata

Release files for code-battles-cli 1.2.8

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

Source distribution (sdist)

Source distribution for code-battles-cli 1.2.8
File Size Uploaded Provenance Actions
code_battles_cli-1.2.8.tar.gz 8.1 kB Without provenance Details for code_battles_cli-1.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for code-battles-cli 1.2.8
File Interpreter ABI Platform Actions
code_battles_cli-1.2.8-py3-none-any.whl Python 3 none any Details for code_battles_cli-1.2.8-py3-none-any.whl

Total release size: 19.3 kB

Release files / code_battles_cli-1.2.8.tar.gz

Download URL code_battles_cli-1.2.8.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
761a02fd6c2f31ad9c1294377739b8b8b0e7b8956702950bf8ce722646402196
BLAKE2b-256 checksum
How to use checksums
8425efdd6edb9b8751dc7be1e91e4a30806451f120e112dc6ded4aa416d7a649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / code_battles_cli-1.2.8-py3-none-any.whl

Download URL code_battles_cli-1.2.8-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b757cfa86af8ea9a7617322b84b59e0d762079563513308a835dda1310035416
BLAKE2b-256 checksum
How to use checksums
701979eb4bbe713dff7c2a93f9ee4dbfc4bd5b59054d05e4267457d31b8e4066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for code-battles-cli 1.2.8

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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