Skip to main content

Python module to simplify using the BrightSign BSN/BSNEE API.

Project description

pybrightsign

Python module to simplify using the BrightSign BSN/BSNEE API.

NOTE: this is early work in progress - interfaces subject to radical changes

Install with pip as usual:

pip install pybrightsign

Introduction

This library abstracts away authorization details and Upload API details, leaving the developer free to use the APIs directly and at as low a level as one would if using just the requests library without a bunch of boilerplate code.

Here is an example of using the Devices endpoint to show a list the names of all devices in a network:

from pybrightsign import Server

creds = {
    'network': 'My BSN Network',
    'username': 'user@example.org',
    'password': 'swordfish'
}

bsnee = Server('brightsign.example.com')
bsnee.authorize(creds)

devices = bsnee.requests.get('/devices').json()['items']

for device in devices:
    print(device['name'])

Even more powerful is the abstraction of the Upload endpoint, for example uploading a video, an image (to a particular folder), then uploading a web site (including the index.html and all css, js, images, etc. in the same folder):

from pybrightsign import Server

creds = {
    'network': 'My BSN Network',
    'username': 'user@example.org',
    'password': 'swordfish'
}

bsnee = Server('brightsign.example.com')
bsnee.authorize(creds)

bsnee.upload_file('promo.mp4')
bsnee.upload_file('logo.png', r'\Shared\Images')
bsnee.upload_web_folder('./website/index.html')

...more to come...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybrightsign-0.1.6.tar.gz (25.7 kB view hashes)

Uploaded Source

Built Distribution

pybrightsign-0.1.6-py3-none-any.whl (35.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page