A Quake3 RCON interface in Python
Project description
A Quake3 RCON interface in Python
Send rcon commands to Q3 compatible servers.
For an outline of past/future changes refer to: CHANGELOG
Requirements
- Python 3.11 or greater
- The game must implement RCON using the Q3 protocol.
Installation
pip install q3rconlib
Use
import os
import q3rconlib
def main():
with q3rconlib.connect(
host=os.environ["Q3RCON_HOST"],
port=int(os.environ["Q3RCON_PORT"]),
password=os.environ["Q3RCON_PASSWORD"],
) as rcon:
resp = rcon.send("status")
print(resp)
if __name__ == "__main__":
main()
q3rconlib.connect(host: str='host', port: int=port, password: str='strongrconpassword')
The Q3Rcon class accepts the following keyword arguments:
host: hostname the gameserver resides onport: port the gameserver accepts rcon requests onpassword: rcon passwordlogin_timeout: max timeout for a successful logindefault_timeout: default amount of time we wait for a response from the game servertimeouts: a dataclass containingcmd: timeoutmappings.- Some commands take more time to return a response or the response is returned in fragments. You may pass a timeouts dataclass to specify how long to wait for a given command.
Timeouts
Let's say that that restarting or rotating the map takes a long time, you could pass the following timeouts dataclass:
from dataclasses import dataclass
@dataclass
class Timeouts:
map_restart: int = 1
map_rotate: int = 1
with q3rconlib.connect(timeouts=Timeouts(), **config_from_toml()) as rcon:
"""do cool stuff"""
This will cause the program to wait for 1 second for all response fragments to come back from the server.
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
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 q3rconlib-1.0.3.tar.gz.
File metadata
- Download URL: q3rconlib-1.0.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd436e83b8af57f8f43ca850b6b3529470e22e6014175b81a763893fed74dffd
|
|
| MD5 |
8742ec4004265098c88b74b2edc1b668
|
|
| BLAKE2b-256 |
e7a4e6efc6ce8c8c76cf7a34f855a2806c7a333b34a46bb36b77bc406098acd7
|
Provenance
The following attestation bundles were made for q3rconlib-1.0.3.tar.gz:
Publisher:
publish.yml on onyx-and-iris/q3rconlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
q3rconlib-1.0.3.tar.gz -
Subject digest:
dd436e83b8af57f8f43ca850b6b3529470e22e6014175b81a763893fed74dffd - Sigstore transparency entry: 1078477746
- Sigstore integration time:
-
Permalink:
onyx-and-iris/q3rconlib@e5fbb0a8aa9aa54023dc87a14a7945ed82980d3d -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/onyx-and-iris
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5fbb0a8aa9aa54023dc87a14a7945ed82980d3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file q3rconlib-1.0.3-py3-none-any.whl.
File metadata
- Download URL: q3rconlib-1.0.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d4828948d9f237145098d7e2d7dd3e2c6518d225f859cb3f5643ed9753a8d71
|
|
| MD5 |
468700a2aff3030cf92e8e1580e4f69c
|
|
| BLAKE2b-256 |
6397dde1288bbc5ba546c69f194414ae6146b3824ac631bca9e38291d5f0a5d8
|
Provenance
The following attestation bundles were made for q3rconlib-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on onyx-and-iris/q3rconlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
q3rconlib-1.0.3-py3-none-any.whl -
Subject digest:
5d4828948d9f237145098d7e2d7dd3e2c6518d225f859cb3f5643ed9753a8d71 - Sigstore transparency entry: 1078477757
- Sigstore integration time:
-
Permalink:
onyx-and-iris/q3rconlib@e5fbb0a8aa9aa54023dc87a14a7945ed82980d3d -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/onyx-and-iris
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5fbb0a8aa9aa54023dc87a14a7945ed82980d3d -
Trigger Event:
push
-
Statement type: