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 py-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.4.tar.gz (18.1 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.4-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_sampquery-0.0.4.tar.gz
  • Upload date:
  • Size: 18.1 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.4.tar.gz
Algorithm Hash digest
SHA256 62f61572db7d28b471b3f9b662023cd6710c9f0b2f04128cb87704fe2e064a94
MD5 50b375bb610c68e40b34c0fe137e83a2
BLAKE2b-256 9b626dd02edae2ce0094271eeee486bf1917ba2a6035899e08bae3aa6c633631

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_sampquery-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f562bccc8c9c8267eeeeaa303a5617b9accaba72556b235bd867135ce96eb91b
MD5 6522284e3903c3b676ba113b4f1b2683
BLAKE2b-256 f772cab5d1242574d903f5d4fa7832f1cc6ea564e59d47d91d94c5d30552b2a4

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