[Tool/Web/Other] SA-MP Query and RCON client library for Python
#1

Due to discontinued support/maintenance for sa-mp python client I decided to write my own from scratch.

My library is open-source, and I believe it to be easier to use and result in cleaner Python code. This library can be used to query information about SA-MP server on your website if you're using a Python framework such as Django or flask, or any Python script, inclusing raspberry Pi projects.

Source code is available on GitHub together with example script, and some examples in the readme file:
https://github.com/mick88/samp-client

To install, simply run:
Code:
pip install samp-client
The library implements context manager, so you can easily manage lifecycle of your connection without explicitly calling connect/disconnect:
Code:
with SampClient(address='localhost', port=7777, rcon_password='password') as client:
    print client.rcon_cmdlist()
Features:
  • Interface both Query and RCON API with a single class
  • Supports all Queries and RCON commands
  • Parses responses into python objects
  • Open source - licensed under MIT license, contributions are welcome
  • Supports Python 2.7
  • Platform-independent - works on windows, linux, raspberry pi etc
Reply
#2

The library is now updated to 2.0 - added support for Python 3
Reply
#3

Awesome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)