Skip to main content

Python library for Query of Valve Servers over a range of IPs

This is a Python 3 port of https://github.com/anshulshah96/valve-range-query. It should support all Valve Source Dedicated Servers (CS:GO, TF2, L4D2).

To install the library run

pip3 install valve-range-query-3

To scan servers in range “ <base_ipaddr> . <axlimits> . <aylimits> “

For example scan ‘172’.’25’.’0-34’.’0.254’

from valverangequery import *
axlimits = [0,35]
aylimits = [0,255]
base_ipaddr = "172.25"
scanner = SourceScanner(timeout = 20.0, axlimits = axlimits, aylimits = aylimits, base_ipaddr="172.25")
server_list = scanner.scan_servers()

To obtain player info from server having IP <ip>

from valverangequery import *
ip = "172.25.12.121"
player_query = PlayerQuery(ip)
player_list= player_query.player()

The respose of SourceScanner is a dictionary of list of servers

Each list entry “server_obj” will have following key-value pairs:

for server_obj in server_list:
        sample_new_dictionary = {
                        'map_name' : server_obj['map'],
                        'host' : server_obj['host_ip'],                         'num_players' : server_obj['numplayers'],
                        'max_players' : server_obj['maxplayers'],       'server_name' : server_obj['name'],
                        'game_name' : server_obj['game'],                       'folder' : server_obj['folder'],
                        'protocol' : server_obj['protocol'],            'num_bots' : server_obj['bots'],
                        'num_humans' : server_obj['numplayers'] - server_obj['bots']
        }

The respose of PlayerQuery is a dictionary of list of players

Each list entry “player_obj” will have following key-value pairs:

for player_obj in player_list:
        sample_new_dictionary = {
                        'score' : player_obj['score'], 'duration' : int(player_obj['duration']) ,
                        'name'  : player_obj['name']
        }

Metadata

Release files for valve-range-query-3 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for valve-range-query-3 2.0.0
File Size Uploaded Provenance Actions
valve-range-query-3-2.0.0.tar.gz 5.2 kB Without provenance Details for valve-range-query-3-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for valve-range-query-3 2.0.0
File Interpreter ABI Platform Actions
valve_range_query_3-2.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for valve_range_query_3-2.0.0-py2.py3-none-any.whl

Total release size: 12.5 kB

Release files / valve-range-query-3-2.0.0.tar.gz

Download URL valve-range-query-3-2.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
05e2bd6f15cac2cc90089f818d9625050510ae04ed5142fb25eba88c419dd7c5
BLAKE2b-256 checksum
How to use checksums
5b644795ba38556caccdfbb49f5d41964221aa1efae02721b2c684871fb28b2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

Release files / valve_range_query_3-2.0.0-py2.py3-none-any.whl

Download URL valve_range_query_3-2.0.0-py2.py3-none-any.whl
Size 7.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
373e163fa9cad917ad450856e830ada63be268836c580b939a2e0da59876473e
BLAKE2b-256 checksum
How to use checksums
e6322bf44d53b9d3a7abfd960496262cdc3a229251900e452707401314581313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

Security for valve-range-query-3 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page