Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Python library designed for querying game servers. It supports 24 different query protocols and has been downloaded over 34,000 times.

License

NotificationsYou must be signed in to change notification settings

opengsq/opengsq-python

Repository files navigation

Python PackageGitHub licensePyPI versionPython versionsDownloads

The OpenGSQ Python library provides a convenient way to query serversfrom applications written in the Python language.

Supported Protocols

The library supports a wide range of protocols. Here are some examples:

fromopengsq.protocolsimport (ASE,Battlefield,Doom3,EOS,FiveM,GameSpy1,GameSpy2,GameSpy3,GameSpy4,Kaillera,KillingFloor,Minecraft,Nadeo,Palworld,Quake1,Quake2,Quake3,RakNet,RenegadeX,Samp,Satisfactory,Scum,Source,TeamSpeak3,Toxikk,UDK,Unreal2,UT3,Vcmp,WON,)

Requirements

  • Python 3.7 or higher

Installation

The recommended installation method is usingpip:

pip install --upgrade opengsq

Usage

Here’s an example of how to query a server using the Source protocol:

importasynciofromopengsq.protocolsimportSourceasyncdefmain():source=Source(host='45.147.5.5',port=27015)info=awaitsource.get_info()print(info)asyncio.run(main())

You can also use the Source Remote Console:

importasynciofromopengsq.exceptionsimportAuthenticationExceptionfromopengsq.rcon_protocols.source_rconimportSourceRconasyncdefmain():withSourceRcon("123.123.123.123",27015)assource_rcon:try:awaitsource_rcon.authenticate("serverRconPassword")exceptAuthenticationException:print('Failed to authenticate')response=awaitsource_rcon.send_command("cvarlist")print(response)asyncio.run(main())

Command-line interface

This library additionally provides anopengsq command-line utilitywhich makes it easy to query game servers from your terminal. Runopengsq -h for usage.

# query server using source protocolopengsqsource --host 123.123.123.123 --port 27015 --function get_info

Tests and Results

You can find information about tests and results athttps://python.opengsq.com/tests/protocols

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

https://github.com/opengsq/opengsq-python/graphs/contributors

Stargazers over time

Stargazers over time

About

Python library designed for querying game servers. It supports 24 different query protocols and has been downloaded over 34,000 times.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp