GTA SA-MP client
RCON and query client library for Python
A modern Python library for querying and managing SA-MP servers.
Supported Python version 2.7, 3.4, 3.5 and 3.6
Installation
pip install samp-client-es
Usage
The library can be easily interfaced using a single SampClient class:
from samp_client.client import SampClient
with SampClient(address='localhost', port=7777) as client:
print client.get_server_info()
The library also allows you to run RCON commands as well as queries:
from samp_client.client import SampClient
with SampClient(address='localhost', port=7777, rcon_password='password') as client:
client.rcon_cmdlist()
Query and RCON responses are parsed into native Python structures:
from samp_client.client import SampClient
with SampClient(address='localhost', port=7777, rcon_password='password') as client:
info = client.get_server_info()
print info
# ServerInfo(password=True, players=9, max_players=100, hostname='Convoy Trucking', gamemode='Convoy Trucking 3.1.1', language='English')
print info.gamemode
# 'Convoy Trucking 3.1.1'
print client.rcon_get_hostname()
# ServerVar(name='hostname', value='Convoy Trucking', read_only=False)
print client.rcon_players()[0].ping
# 26
Examples
Folder example/ contains usage example of the library
Running tests
To run tests:
python -m unittest discover -v
Release files for query-client-silverbullet-s 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| query-client-silverbullet-s-1.0.3.tar.gz | 7.0 kB | Details |
Release files / query-client-silverbullet-s-1.0.3.tar.gz
| Download URL | query-client-silverbullet-s-1.0.3.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f47d20d39d719fda08687120eca6bd65a3fc1b91f54ce4ec0f145d95ccc9fef
|
|
BLAKE2b-256 checksum How to use checksums |
ed2908d407a5d55aeb47513366b9e36bd4a276acf16d63907b994bcc372b46f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
|