rust-arenaclient
rust-arenaclient was created for ai-arena to act as a proxy between bots and StarCraft II. It was originally written entirely in Python, but due to performance concerns, was rewritten using Rust + pyo3.
It can be used as a stand-alone binary or as a Python library for convenience.
Installation
You can install rust_arenaclient using:
pip install rust_arenaclient
or alternatively build a binary from source using
cargo build --bin rust_ac_bin
Usage
Python
from rust_ac import Server
server = Server("127.0.0.1:8642")
server.run()
Binary
Currently the proxy server starts on 127.0.0.1:8642 when launched. Future updates will enable the user to specify
host and port using command line arguments, after which this README will be updated.
Running a game
rust_arenaclient was made for the purpose of being part of a bigger system to run StarCraft II games. The system will interact with the rust_arenaclient through websockets and is known as a supervisor. rust_arenaclient only acts as a proxy between bots and StarCraft II. The starting of bots and creating game config is the supervisor's job. Example of an extremely basic supervisor script in Python:
import os, subprocess, asyncio, aiohttp
from rust_ac import Server
from rust_ac.match_runner import MatchRunner
from rust_ac import GameConfig
m = MatchRunner(bot_directory=r"D:\desktop backup\aiarenaclient\aiarena-client\aiarena-test-bots")
result = m.run_game(game=GameConfig('AutomatonLE', 'loser_bot', 'MicroMachine')) # One game
games = [GameConfig('AutomatonLE', 'loser_bot', 'basic_bot') for _ in range(20)]
results = m.run_games_multiple(games=games, instances=3) # Multiple games - Run 3 games at a time
Logging
Logging is done via the handly pyo3-log crate. To get the Rust logs in Python, initialize the logging library before importing rust-arenaclient, i.e.
import os, subprocess, asyncio, aiohttp
import logging # Needs to be imported before importing rust_ac
logging.getLogger().setLevel(logging.DEBUG) # Set debugging level
logging.basicConfig(filename="log.txt", level=logging.DEBUG, filemode="w+") # Write logs to a file called "log.txt"
logging.info("") # Needed to initialize logging
from rust_ac import Server
from rust_ac.match_runner import MatchRunner
from rust_ac import GameConfig
m = MatchRunner(bot_directory=r"D:\desktop backup\aiarenaclient\aiarena-client\aiarena-test-bots")
...
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Metadata
Release files for rust-arenaclient 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rust_arenaclient-0.2.4-cp311-none-win_amd64.whl | CPython 3.11 | none | Windows x86-64 | Details |
| rust_arenaclient-0.2.4-cp311-cp311-manylinux_2_31_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.31+ x86-64 | Details |
| rust_arenaclient-0.2.4-cp310-none-win_amd64.whl | CPython 3.10 | none | Windows x86-64 | Details |
| rust_arenaclient-0.2.4-cp310-cp310-manylinux_2_31_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.31+ x86-64 | Details |
| rust_arenaclient-0.2.4-cp39-none-win_amd64.whl | CPython 3.9 | none | Windows x86-64 | Details |
| rust_arenaclient-0.2.4-cp39-cp39-manylinux_2_31_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.31+ x86-64 | Details |
| rust_arenaclient-0.2.4-cp38-none-win_amd64.whl | CPython 3.8 | none | Windows x86-64 | Details |
| rust_arenaclient-0.2.4-cp38-cp38-manylinux_2_31_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.31+ x86-64 | Details |
Total release size: 7.3 MB
Release files / rust_arenaclient-0.2.4-cp311-none-win_amd64.whl
| Download URL | rust_arenaclient-0.2.4-cp311-none-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
193cda2f7a5ab1fc0ed8a36c138b4ad854031d115c8c6964a6caccb6572b0101
|
|
BLAKE2b-256 checksum How to use checksums |
9ee6c7b50339d4013f9c211d41617edb8e43972ee53a5e4e4e229a856183d63b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp311-cp311-manylinux_2_31_x86_64.whl
| Download URL | rust_arenaclient-0.2.4-cp311-cp311-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 798.2 kB |
| Tags | CPython 3.11 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
38f36f564f2def7ed52a60ecf8794618163bc2db065a56c49d0b7d97e20d66b1
|
|
BLAKE2b-256 checksum How to use checksums |
2723ed4f8ed130fbad811cfa3719aff596c30c933e065d1de98c673fa919fbcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp310-none-win_amd64.whl
| Download URL | rust_arenaclient-0.2.4-cp310-none-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
aa98a48bac293c09899cd4676fa5f0a6fe29ce96f56f9e0e919fbe9c28e432d8
|
|
BLAKE2b-256 checksum How to use checksums |
3fad67bafb6407eaf99d39d73751ceaf0b8b1378a9222bc3cf54c78a5be2ca14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp310-cp310-manylinux_2_31_x86_64.whl
| Download URL | rust_arenaclient-0.2.4-cp310-cp310-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 798.2 kB |
| Tags | CPython 3.10 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
ee65e765761d2ed40ea2f797b20e38287a82ee33e02ee94554eec239c0e44cc7
|
|
BLAKE2b-256 checksum How to use checksums |
95ac9415401073b168f3c8cc9d4728fd25566a5a0d814c5947c6e59f9982a1ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp39-none-win_amd64.whl
| Download URL | rust_arenaclient-0.2.4-cp39-none-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
87bc13640e86ddcda8ea2ea946309db288e60c74bd4694a4def990b1ac0e816c
|
|
BLAKE2b-256 checksum How to use checksums |
a40804288758bd2d3a89fbaf19a5620b533d7b76fb75526def8dd7c011ffed04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp39-cp39-manylinux_2_31_x86_64.whl
| Download URL | rust_arenaclient-0.2.4-cp39-cp39-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 798.3 kB |
| Tags | CPython 3.9 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
bf371a00bd4310926a0a471d7816a090a93d1849387e9d1b2c108d17a7b4d13e
|
|
BLAKE2b-256 checksum How to use checksums |
099e7fc96dc75183a30fc7020b055ed068671a69bb92e74c94cea0bd5491ef85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp38-none-win_amd64.whl
| Download URL | rust_arenaclient-0.2.4-cp38-none-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e45e7b0826e27d35af367f0eb57f065488ec1d0c10bc34fd672d9542aea497de
|
|
BLAKE2b-256 checksum How to use checksums |
a72cacaa480cdbd7141d7f6e5985be6b4c8a29e56a61732fc36c814c93eddaac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Release files / rust_arenaclient-0.2.4-cp38-cp38-manylinux_2_31_x86_64.whl
| Download URL | rust_arenaclient-0.2.4-cp38-cp38-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 798.3 kB |
| Tags | CPython 3.8 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
8afcd656377ce76c3c1b5f2542d4b228f8eba9195b67f8ffe73b8f3bbb6d1940
|
|
BLAKE2b-256 checksum How to use checksums |
f4f430511e1141cff84a32fe5fd9552a9f00cdfaf207405ae8bf4e42022c7e50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.13.7
|
Security for rust-arenaclient 0.2.4
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.