Skip to main content

To install the library run

pip install valve-range-query

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']
        }

Release files for valve-range-query 1.0.4

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 1.0.4
File Size Uploaded
valve-range-query-1.0.4.tar.gz 5.2 kB Details

Release files / valve-range-query-1.0.4.tar.gz

Download URL valve-range-query-1.0.4.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
10c5f5c83c2af129fd6134c4bd6b94fbb4df9467f2cef103426027999661aea3
BLAKE2b-256 checksum
How to use checksums
43d67c6ec61ff7198f9cb02165ca98ee110f085ab39de8f18397fdeced8c7d5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

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