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.3.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.3-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_sampquery-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 f8408196acb462fa1ab944a47156ead344e15005d5a1f21a619c2ce21baf4e18
MD5 2ffecb1828ba4ca8cf090c96d75c411a
BLAKE2b-256 48f683d5d56a38983852e2fbf4849af210b974cdc915455c3f997e8a1f247c84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_sampquery-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 683bd87337f924ab60e43304a40895de192cebe6860870db7cb9e18d86982945
MD5 176e12020ca8dd3de151615ffbd8a839
BLAKE2b-256 d01dc57c27f604d77050491340279c90a51357a328f935cebc19974c80601eb9

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