A CLI for competitors in any Code Battles event!
Project description
Code Battles CLI
A CLI for competitors in any Code Battles event!
🏃 Getting Started · 💡 Features · 🚗 Roadmap
Getting Started
- Install the library by running
pip install code-battles-cli
. - Make sure you have the Python scripts folder in your
PATH
by runningcode-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 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"]))
Roadmap
- Download bots.
- Upload bots.
- Run no-UI simulations locally.
- Be usable in scripts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file code_battles_cli-1.1.0.tar.gz
.
File metadata
- Download URL: code_battles_cli-1.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f7564635c630099b283fd0e494d653a47370b9e171fd37651ebaafc183e982a |
|
MD5 | e2ab3b4289be2196277e620ac966f2bc |
|
BLAKE2b-256 | 419cca4ec4f970050f531c13cc52b36298e872829ed1ecd3609cd722e9579199 |
File details
Details for the file code_battles_cli-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: code_battles_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c063fde7ebd8ec84691689b8f047884afd2c61217b5a6f63bc05782cb1b49bd |
|
MD5 | b4ed592721fcf55f320a80bdbbd75619 |
|
BLAKE2b-256 | fa3aa27f5b2587c95aefaddc033100503006a065f7bdaa776a7bf881540a0d95 |