rcon
An RCON client implementation.
Requirements
rcon requires Python 3.10 or higher.
Documentation
Documentation is available on readthedocs.
Installation
Install rcon from the AUR or via:
pip install rcon
Quick start
The RCON protocols are used to remotely control game servers, i.e. execute
commands on a game server and receive the respective results.
Source RCON
from rcon.source import Client
with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
response = client.run('some_command', 'with', 'some', 'arguments')
print(response)
Async support
If you prefer to use Source RCON in an asynchronous environment, you can use
rcon().
from rcon.source import rcon
response = await rcon(
'some_command', 'with', 'some', 'arguments',
host='127.0.0.1', port=5000, passwd='mysecretpassword'
)
print(response)
BattlEye RCon
from rcon.battleye import Client
with Client('127.0.0.1', 5000, passwd='mysecretpassword') as client:
response = client.run('some_command', 'with', 'some', 'arguments')
print(response)
Handling server messages
Since the BattlEye RCon server will also send server messages to the client alongside command responses, you can register an event handler to process those messages:
from rcon.battleye import Client
from rcon.battleye.proto import ServerMessage
def my_message_handler(server_message: ServerMessage) -> None:
"""Print server messages."""
print('Server message:', server_message)
with Client(
'127.0.0.1',
5000,
passwd='mysecretpassword',
message_handler=my_message_handler
) as client:
response = client.run('some_command', 'with', 'some', 'arguments')
print('Response:', response)
Have a look at rcon.battleye.proto.ServerMessage for details on the
respective objects.
Metadata
Release files for rcon 2.4.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rcon-2.4.9.tar.gz | 45.2 kB | Without provenance | Details for rcon-2.4.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rcon-2.4.9-py3-none-any.whl | Python 3 | none | any | Details for rcon-2.4.9-py3-none-any.whl |
Total release size: 76.3 kB
Release files / rcon-2.4.9.tar.gz
| Download URL | rcon-2.4.9.tar.gz |
|---|---|
| Size | 45.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d41a8311dc13352da35163f46a3cc13eb20f5cde1297b75b56e7645ef76d0a48
|
|
BLAKE2b-256 checksum How to use checksums |
e445edde086b16cd38591794d328ef62c47f089ac04f32a63b4fcab0981d349a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.7
|
Release files / rcon-2.4.9-py3-none-any.whl
| Download URL | rcon-2.4.9-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0d2477070f189a6b49774133c412473ece40bb452473f160c7373b162dc8929
|
|
BLAKE2b-256 checksum How to use checksums |
69d32668a6e6bd6d66046ebe811f3fac65402620762e31f80b8f88661a7f3e42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.7
|
Security for rcon 2.4.9
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.