Skip to main content

A Quake3 RCON interface in Python

Poetry Ruff

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 on
  • port: port the gameserver accepts rcon requests on
  • password: rcon password
  • login_timeout: max timeout for a successful login
  • default_timeout: default amount of time we wait for a response from the game server
  • timeouts: a dataclass containing cmd: timeout mappings.
    • 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.

Metadata

Release files for q3rconlib 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for q3rconlib 1.0.3
File Size Uploaded Provenance
q3rconlib-1.0.3.tar.gz 5.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for q3rconlib 1.0.3
File Interpreter ABI Platform
q3rconlib-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / q3rconlib-1.0.3.tar.gz

Download URL q3rconlib-1.0.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dd436e83b8af57f8f43ca850b6b3529470e22e6014175b81a763893fed74dffd
BLAKE2b-256 checksum
How to use checksums
e7a4e6efc6ce8c8c76cf7a34f855a2806c7a333b34a46bb36b77bc406098acd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Release files / q3rconlib-1.0.3-py3-none-any.whl

Download URL q3rconlib-1.0.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d4828948d9f237145098d7e2d7dd3e2c6518d225f859cb3f5643ed9753a8d71
BLAKE2b-256 checksum
How to use checksums
6397dde1288bbc5ba546c69f194414ae6146b3824ac631bca9e38291d5f0a5d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

Security for q3rconlib 1.0.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for q3rconlib-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page