Simple Python library for querying Quake 3 based principal servers and their game servers
Project description
pyq3serverlist
Simple Python 🐍 library for querying Quake 3 based principal servers and their game servers. Very much based on jacklul's PHP implementation.
Features
- retrieve a list of game servers from a Quake 3 principal ("master") server
- supports both UDP (default) and TCP for server list retrieval
- retrieve status details and current players from game servers
Installation
Simply install the package via pip.
$ pip install pyq3serverlist
Usage
The following example retrieves and prints a game server list for Call of Duty 4: Modern Warfare directly from Activision via UDP.
from pyq3serverlist import PrincipalServer
from pyq3serverlist.exceptions import PyQ3SLError, PyQ3SLTimeoutError
principal = PrincipalServer('cod4master.activision.com', 20810, 6)
try:
servers = principal.get_servers()
print(servers)
except (PyQ3SLError, PyQ3SLTimeoutError) as e:
print(e)
You can also directly initialize a game server object for a known server and query its status.
from pyq3serverlist import Server
from pyq3serverlist.exceptions import PyQ3SLError, PyQ3SLTimeoutError
server = Server('198.144.177.2', 27963)
try:
info = server.get_status()
print(info)
except (PyQ3SLError, PyQ3SLTimeoutError) as e:
print(e)
You can find a few more examples in the examples
folder.
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
pyq3serverlist-0.1.7.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for pyq3serverlist-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 820f9a1a1d31556c05d648dbd4d62fec717e66d782337b03e6b586cdd400b813 |
|
MD5 | 517a77d75a640a59f2d5aad3c085eb77 |
|
BLAKE2b-256 | 03d9d0a393a3c3a2af53ca02816a6ec6303369f58ef485a87038330237f41dc5 |