SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 12/06/2017, 08:07 PM   #1
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 170
Reputation: 32
Cool SA-MP Query and RCON client library for Python

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
mick88 is offline   Reply With Quote
Old 02/07/2017, 08:47 PM   #2
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 170
Reputation: 32
Default Re: SA-MP Query and RCON client library for Python

The library is now updated to 2.0 - added support for Python 3
mick88 is offline   Reply With Quote
Old 02/07/2017, 10:42 PM   #3
Dayvison_
High-roller
 
Dayvison_'s Avatar
 
Join Date: Nov 2013
Posts: 1,317
Reputation: 200
Default Re: SA-MP Query and RCON client library for Python

Awesome
__________________


Dayvison_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] [Python] Query and RCON API (23/06/2012) StatusRed Tools and Files 22 02/07/2017 08:49 PM
[Tool/Web/Other] [PHP] Query and RCON API (30/06/2012) StatusRed Tools and Files 60 11/02/2017 04:48 PM
Python Scripting ( HOW TO SCRIPT WITH PYTHON??) janko1223 Scripting Help 2 26/09/2016 04:48 PM
samp client query ports? blackturbo Client Support 7 18/08/2015 02:50 AM
UDP server queries: client query limitations dusk General 2 08/12/2014 07:22 PM


All times are GMT. The time now is 05:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.