A2SQuery is a python implementation of Valve's A2S protocol
Project description
A2SQuery
A2SQuery is a python implementation of Valve's A2S protocol.
Docs
View the full A2SQuery documentation here.
Features
A2SQuery can retrieve various information from any game server that implements the protocol. This includes all Source and GoldSource games. The library will handle connecting, parsing, and even automatically respond to challenge requests.
A2SQuery does not support multi-packet responses as they are impossible parse without knowing information about the server beforehand.
Prerequisites
- Python >= 3.6
Installation
Install the library via pypi with
pip install a2squery
Getting Started
To start querying servers, we'll need an
instance of a2squery.A2SQuery
. We can either create one manually,
or use a context manager. For this example, we will be using a context manager.
>>> from a2squery import A2SQuery
>>> with A2SQuery("127.0.0.1", 27015) as a2s:
Now, with the A2SQuery instance, we can query the game server.
When using
a2squery.A2SQuery
without a context manager. Remember to calla2squery.A2SQuery.close()
when finished.
>>> from a2squery import A2SQuery
>>> with A2SQuery("127.0.0.1", 27015) as a2s:
>>> print(a2s.info())
SourceInfo(
protocol=17, name="Awp Bhop", map="awp_iceworld",
folder="csgo", game="Counter-Strike: Global Offensive",
app_id=730, players=43, max_players=64, bots=0,
server_type=ServerType.Dedicated, environment=Environment.Linux,
password=False, vac=True, version="1.38.4.4", extra_data_flag=177,
mode=None, witnesses=None, duration=None,
port=27015, steam_id=85568392924437989, spectator_port=None,
spectator_name=None, keywords="awp,bhop,a2squeryiscool", game_id=730
)
Supported Games
App ID | Game | Notes |
---|---|---|
... | All Half-Life/Half-Life 2 mods and games | |
10 | Counter-Strike 1.6 | |
440 | Team Fortress 2 | |
550 | Left For Dead 2 | |
730 | Counter-Strike: Global Offensive | |
1002 | Rag Doll Kung Fu | |
2400 | The Ship: Murder Party | This game has various unique fields on a2squery.SourceInfo and a2squery.Player . |
4000 | Garry's Mod | |
17710 | Nuclear Dawn | |
70000 | Dino D-Day | |
107410 | Arma 3 | The query port is the server port + 1. |
115300 | Call of Duty: Modern Warfare 3 | |
211820 | Starbound | |
244850 | Space Engineers | The query port is the server port + 1. |
304930 | Unturned | The query port is the server port + 1. |
251570 | 7 Days To Die | |
252490 | Rust | |
282440 | Quake Live | |
346110 | ARK: Survival Evolved | |
108600 | Project: Zomboid |
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
File details
Details for the file a2squery-0.0.2.tar.gz
.
File metadata
- Download URL: a2squery-0.0.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dc71906f506e995d6d87535ccdae47b0f06d14de32f3d2758872fc7faa77a41 |
|
MD5 | 821b5d626bcd4844cfe16f22b6b9a703 |
|
BLAKE2b-256 | a756a3fc848e71c93d9d0073223ea8f9e860f4a096fea20393959b7e6d566e26 |
File details
Details for the file a2squery-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: a2squery-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b899ced9f43048ed3a8712ef237ed8a2e9eadf3609df62d316cf59d03d84220 |
|
MD5 | 37e4ddd037f169848db5487c81e2ad84 |
|
BLAKE2b-256 | b0b6f7c20ebba513b5a90e16149cf9fa91b50b42380bf35ef4273d5f018a032c |