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
PATHby 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 '{"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"]))
Roadmap
- Download bots.
- Upload bots.
- Run no-UI simulations locally.
- Be usable in scripts.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_battles_cli-1.2.2.tar.gz.
File metadata
- Download URL: code_battles_cli-1.2.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dfe4425bead83903ddcd3253a79afecbe4b473e8e88e7666c9261f46180f482
|
|
| MD5 |
343b8dfc4a83284d0df3fb1d15a7df3e
|
|
| BLAKE2b-256 |
caab555b86700e627fce413ce46f567185a19b02b0218d52b8a30ace4b458142
|
File details
Details for the file code_battles_cli-1.2.2-py3-none-any.whl.
File metadata
- Download URL: code_battles_cli-1.2.2-py3-none-any.whl
- Upload date:
- Size: 11.3 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 |
59f12f7627b37fe7ca2f88594e9497e60b2a01fbb21565e83215cdfb50cb48a6
|
|
| MD5 |
1db53238cdf5e0c5c48c3506a72777c1
|
|
| BLAKE2b-256 |
4f8901e411de211ebd1dc325cc9d52c55c8f9a5c0891167495aa638f4b4f3a30
|