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.6

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.6
File Size Uploaded Provenance Actions
code_battles_cli-1.2.6.tar.gz 7.4 kB Without provenance Details for code_battles_cli-1.2.6.tar.gz

Built distribution (wheel)

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

Total release size: 18.4 kB

Release files / code_battles_cli-1.2.6.tar.gz

Download URL code_battles_cli-1.2.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84f874cbde901050a6c45837aea1ae04c8003b86c1fe6e8ee7a0955083c76ad8
BLAKE2b-256 checksum
How to use checksums
856cd1f4474822fef27a3236c412aa35f990ff7f1faf9a48c8805f012d03f7b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.6-py3-none-any.whl

Download URL code_battles_cli-1.2.6-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d76cec95868f83acac3a9110e8f5304aba5eed5a8f9954735bc879fa680489f3
BLAKE2b-256 checksum
How to use checksums
8913b2ac7cc890632bf770994bc2835f8eb78f1fb04ed381e80587c61f522ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.6

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