mvs-86 / spotware_connect

A python client for the publicly available protobuf-based API developed by Spotware
GNU General Public License v3.0
9 stars 6 forks source link

==================== spotware_connect

.. image:: https://img.shields.io/pypi/v/spotware_connect.svg :target: https://pypi.python.org/pypi/spotware_connect

.. image:: https://img.shields.io/travis/marcus-santos/spotware_connect.svg :target: https://travis-ci.org/marcus-santos/spotware_connect

.. image:: https://coveralls.io/repos/github/marcus-santos/spotware_connect/badge.svg :target: https://coveralls.io/github/marcus-santos/spotware_connect

.. image:: https://readthedocs.org/projects/spotware_connect/badge/?version=latest :target: https://spotware_connect.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/github/license/marcus-santos/spotware_connect :alt: License

A python client wraper for Spotware Open API 2 https://connect.spotware.com/docs/open_api_2

Deprecated

Repo is archived, use the official Spotware OpenApi Python client https://github.com/spotware/OpenApiPy

Quickstart

Install with pip::

$ pip install spotware-connect

A sample to request server version::

import spotware_connect as sc

c = sc.Client(live=False) # Demo connection

@c.event
def connect():
    c.emit("VersionReq")

@c.message(msgtype="VersionRes")
def version(msg, payload, version, **kargs):
    print("Server version: ", version)
    c.stop()

c.start(timeout=5) # optional timeout in seconds

See the usage in docs for a complete example with App Authorization.

.. _usage: https://spotware-connect.readthedocs.io/en/latest/usage.html .. _docs: https://spotware-connect.readthedocs.io/en/latest/

Features

.. _here: https://connect.spotware.com/docs/frequently-asked-questions

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Using twisted_ for network layer

.. Cookiecutter: https://github.com/audreyr/cookiecutter .. audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage .. _twisted: https://github.com/twisted/twisted