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

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

Built distribution (wheel)

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

Total release size: 18.3 kB

Release files / code_battles_cli-1.2.5.tar.gz

Download URL code_battles_cli-1.2.5.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7621a99a921abb261c1419309e5d940d6e8ddfdc7a666e53e79f7f801cfc59cd
BLAKE2b-256 checksum
How to use checksums
ffde259e7e0ee9f095008aa80fd70f5d531ab0c3a8fd311ca22434c41626defe
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.5-py3-none-any.whl

Download URL code_battles_cli-1.2.5-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3112ad9a36c048c9a47fd9686f66f4fd1ca398a681467d212cc6365ba964053e
BLAKE2b-256 checksum
How to use checksums
d653ef7d3746ce186c05d18713c6fe521f5efa27e87121d3b3533860e7226e84
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.5

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