Code Monkey home page Code Monkey logo

python-ts3's Introduction

python-ts3

python-ts3 is a abstraction library around the Teamspeak 3 ServerQuery API. It allows native access to the ServerQuery API with most of the formatting headaches avoided.

Build Status

Python Support

python-ts3 is targeted at Python 2.6/2.7/3.2/3.3 support, along with PyPy support.

Install

Download the most recent sourcecode and install it::

git clone git://github.com/nikdoof/python-ts3.git
cd python-ts3
python setup.py install

A stable version of python-ts3 is available on PyPi. Active development is done in the develop branch with release version merged into master

Example Usage

Example showing how to create a channel and sub-channel for it using python-ts3 library::

import ts3

server = ts3.TS3Server('127.0.0.1', 10011)
server.login('serveradmin', 'secretpassword')

# choose virtual server
server.use(1)

# create a channel
response = server.send_command('channelcreate', keys={'channel_name': 'Just some channel'})

# id of the newly created channel
channel_id = response.data[0]['cid']

# create a sub-channel
server.send_command('channelcreate', keys={'channel_name': 'Just some sub-channel', 'cpid': channel_id})

python-ts3's People

Contributors

czarnota avatar kjagiello avatar nikdoof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-ts3's Issues

TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'

hello,

am trying to test this API but am stuck with this error full output:

D:\DEV\py341\python.exe D:/DEV/workspace/py/hellow/main.py
Traceback (most recent call last):
File "D:/DEV/workspace/py/hellow/main.py", line 4, in
server.login('user', 'pass')
File "D:\DEV\py341\lib\site-packages\python_ts3-0.1-py3.4.egg\ts3\server.py", line 64, in login
File "D:\DEV\py341\lib\site-packages\python_ts3-0.1-py3.4.egg\ts3\protocol.py", line 129, in send_command
TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'

Process finished with exit code 1

Feature Request: Error Handler

Would it be possible to have some type of Exception type that parses the response. In the event of a "error", make it available?

Thanks,

Release 0.2

PyPi has v0.1, which is very old and contains a few breaking bugs and race conditions for I/O. A new release needs to be produced and pushed to PyPi.

Pypi build has syntax error on py2

File "ts3/commands.py", line 79
def banadd(self, *, ip=None, name=None, uid=None, time=None, banreason=None):
                  ^
SyntaxError: invalid syntax

On connection fail, make error message available

If you get banned by the server, it would be nice to be able to get the error message.

Example:
$ telnet somehost 10011 Trying 1.2.3.4... Connected to somehost. Escape character is '^]'. TS3 Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command. error id=3329 msg=connection\sfailed,\syou\sare\sbanned extra_msg=you\smay\sretry\sin\s226\sseconds\n\rConnection closed by foreign host.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.