🐍 OpenGSQ - Python library for querying game servers
Project description
OpenGSQ Python Library
The OpenGSQ Python library provides a convenient way to query servers from applications written in the Python language.
Supported Protocols
The library supports a wide range of protocols. Here are some examples:
from opengsq.protocols import (
AoE1,
AoE2,
ASE,
AVP2,
Battlefield,
Battlefield2,
CoD1,
CoD4,
CoD5,
DirectPlay,
Doom3,
ElDewrito,
EOS,
FiveM,
Flatout2,
GameSpy1,
GameSpy2,
GameSpy3,
GameSpy4,
Halo1,
JediKnight,
Kaillera,
KillingFloor,
Minecraft,
Nadeo,
Palworld,
Quake1,
Quake2,
Quake3,
RakNet,
RenegadeX,
Samp,
Satisfactory,
Scum,
Source,
SSC,
SupCom,
StrongholdCE,
StrongholdCrusader,
TeamSpeak3,
TrackmaniaNations,
Toxikk,
UDK,
Unreal2,
UT3,
Vcmp,
W40kDow,
Warcraft3,
WON,
)
Requirements
- Python 3.9 or higher
Installation
The recommended installation method is using pip:
pip install --upgrade opengsq
Usage
Here’s an example of how to query a server using the Source protocol:
import asyncio
from opengsq.protocols import Source
async def main():
source = Source(host='45.147.5.5', port=27015)
info = await source.get_info()
print(info)
asyncio.run(main())
You can also use the Source Remote Console:
import asyncio
from opengsq.exceptions import AuthenticationException
from opengsq.rcon_protocols.source_rcon import SourceRcon
async def main():
with SourceRcon("123.123.123.123", 27015) as source_rcon:
try:
await source_rcon.authenticate("serverRconPassword")
except AuthenticationException:
print('Failed to authenticate')
response = await source_rcon.send_command("cvarlist")
print(response)
asyncio.run(main())
Command-line interface
This library additionally provides an opengsq command-line utility
which makes it easy to query game servers from your terminal. Run
opengsq -h for usage.
# query server using source protocol
opengsq source --host 123.123.123.123 --port 27015 --function get_info
Tests and Results
You can find information about tests and results at https://python.opengsq.com/tests/protocols
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
Stargazers over time
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 opengsq-3.6.0.tar.gz.
File metadata
- Download URL: opengsq-3.6.0.tar.gz
- Upload date:
- Size: 105.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0d6327cfe21e3a1ba53d45007b5a9eff0d3239c5547725a0c8beb519ce8245
|
|
| MD5 |
d23260c746aa1fe915edee99612675cd
|
|
| BLAKE2b-256 |
c682a958c9a771f7c816ace4ce19a29eaa92c662e93f1277b85810d8ec1a9814
|
Provenance
The following attestation bundles were made for opengsq-3.6.0.tar.gz:
Publisher:
python-publish.yml on opengsq/opengsq-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opengsq-3.6.0.tar.gz -
Subject digest:
8a0d6327cfe21e3a1ba53d45007b5a9eff0d3239c5547725a0c8beb519ce8245 - Sigstore transparency entry: 771076967
- Sigstore integration time:
-
Permalink:
opengsq/opengsq-python@620838b7654976c47306098f33d739efb5a09b0f -
Branch / Tag:
refs/tags/v3.6.0 - Owner: https://github.com/opengsq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@620838b7654976c47306098f33d739efb5a09b0f -
Trigger Event:
release
-
Statement type:
File details
Details for the file opengsq-3.6.0-py3-none-any.whl.
File metadata
- Download URL: opengsq-3.6.0-py3-none-any.whl
- Upload date:
- Size: 168.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 |
be1bbd4807b9a31ec758f3e72e59dae34dfea0eb7858a315e8ef884de67efe85
|
|
| MD5 |
f33d37e1bfcb68b1a245f5d04a7c84f1
|
|
| BLAKE2b-256 |
2a0cf5f9e927c145deacf0f5a3178654b5a92eb7a8f3f321f009cf1bd1b87d57
|
Provenance
The following attestation bundles were made for opengsq-3.6.0-py3-none-any.whl:
Publisher:
python-publish.yml on opengsq/opengsq-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opengsq-3.6.0-py3-none-any.whl -
Subject digest:
be1bbd4807b9a31ec758f3e72e59dae34dfea0eb7858a315e8ef884de67efe85 - Sigstore transparency entry: 771076968
- Sigstore integration time:
-
Permalink:
opengsq/opengsq-python@620838b7654976c47306098f33d739efb5a09b0f -
Branch / Tag:
refs/tags/v3.6.0 - Owner: https://github.com/opengsq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@620838b7654976c47306098f33d739efb5a09b0f -
Trigger Event:
release
-
Statement type: