Skip to main content

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

code_battles_cli-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

code_battles_cli-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file code_battles_cli-1.0.0.tar.gz.

File metadata

  • Download URL: code_battles_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for code_battles_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a3f10ea3b0e4ab216997c921e242bd3e2595f53fc0c86a97debf5ce0065f2719
MD5 d4737c6435d0f47d8d6939f29609b849
BLAKE2b-256 125755dcfa76dc4c5b17e9148bc9643616d284083dd1b932c10358d81c584015

See more details on using hashes here.

File details

Details for the file code_battles_cli-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for code_battles_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e00d9a54a115ea69b18dff36bcbfc8ba31ed395ee80573061cf5d08cb1b620fc
MD5 d7e20538f57f44df8c790ad81e4ee0d5
BLAKE2b-256 6fe7dfbe8f44f56e1b7b1c5176d34cf247ad1c4dcf8afa12ffdce1da2351e6ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page