https://github.com/cetteup/pyut2serverlist
Simple Python library for querying Unreal Engine 2 based principal servers and their game servers
https://github.com/cetteup/pyut2serverlist
python query unreal unreal-tournament ut2004
Last synced: 6 months ago
JSON representation
Simple Python library for querying Unreal Engine 2 based principal servers and their game servers
- Host: GitHub
- URL: https://github.com/cetteup/pyut2serverlist
- Owner: cetteup
- License: mit
- Created: 2022-12-16T20:49:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-31T17:42:55.000Z (6 months ago)
- Last Synced: 2026-01-04T09:56:40.955Z (6 months ago)
- Topics: python, query, unreal, unreal-tournament, ut2004
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pyut2serverlist
[](https://github.com/cetteup/pyut2serverlist/actions?query=workflow%3Aci)
[](/LICENSE)
[](https://pypi.org/project/pyut2serverlist/)
[](https://github.com/cetteup/pyut2serverlist/commits/main)
Simple Python library for querying Unreal Engine 2 based principal servers and their game servers
## Features
- retrieve a list of game servers from an Unreal Engine 2 principal ("master") server
- retrieve info directly from game servers
## Installation
Simply install the package via pip.
```bash
$ pip install pyut2serverlist
```
## Usage
The following example retrieves and prints a game server list for Unreal Tournament 2004 directly from Epic Games.
```python
from pyut2serverlist import PrincipalServer, Game, Error, Filter, Comparator
principal = PrincipalServer('utmaster.openspy.net', 28902, Game.UT2004, 'some-cd-key')
try:
servers = principal.get_servers(
Filter('gametype', Comparator.Equals, 'xDeathMatch')
)
print(servers)
except Error as e:
print(e)
```
You can also directly initialize a game server object for a known server and query it to retrieve details such as the current map and game mode.
```python
from pyut2serverlist import Server, Error
server = Server('68.232.165.172', 7778)
try:
info = server.get_info()
print(info)
except Error as e:
print(e)
```