Skip to main content

A better and fixed SA:MP Query Client written in Python

Project description

SA:MP Query

a better and fixed SA:MP Query Client written in Python

Contents

Installation

You can install the package using:

pip install sampquery

Usage

from trio import run
from sampquery import SAMPQuery_Client

async def main():
    server = SAMPQuery_Client(
        ip='127.0.0.1',
        port=7777,
        rcon_password=None
    )

    server_details = await server.info()
    print(f"Server name: {server_details.name}, Gamemode: {server_details.gamemode}")

run(main)

Examples

Here you can find a collection of some examples

Listing players in a server

from trio import run
from sampquery import SAMPQuery_Client

async def main():
    server = SAMPQuery_Client(
        ip='144.217.174.214',
        port=6969,
        rcon_password=None
    )

    players = await server.players()

    for player in players.players:
        print(player.name)

run(main)

Getting server details

from trio import run
from sampquery import SAMPQuery_Client

async def main():
    server = SAMPQuery_Client(
        ip='144.217.174.214',
        port=6969,
        rcon_password=None
    )

    server_details = await server.info()

    print(f"Server name: {server_details.name}, Gamemode: {server_details.gamemode}, Players: {server_details.players}")

run(main)

Thanks for using SA:MP Query, you can report any issues or suggestions here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_sampquery-0.0.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_sampquery-0.0.2-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file py_sampquery-0.0.2.tar.gz.

File metadata

  • Download URL: py_sampquery-0.0.2.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for py_sampquery-0.0.2.tar.gz
Algorithm Hash digest
SHA256 647a5477552a0b0f83860ca887247d7d423e1074a5d24b67326074d791b034cc
MD5 9c9623a853c103be250133a28f69527f
BLAKE2b-256 a8939dce71843c08d85ec471083229665c3cf19eda7f8b277c48044f57aa15d3

See more details on using hashes here.

File details

Details for the file py_sampquery-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: py_sampquery-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for py_sampquery-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f31d77c8b094f71d97dde4a77d78c8d69e0bb38846335611fbb112f2dfda936
MD5 26d199d5311abd132e6d8a176ad7245c
BLAKE2b-256 db51594e831c37bca5f7e31bbea1dfe2a583ed6fe88669e0efbce0a6184abc93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page