Skip to main content

A Python client for controlling Shinobi (an open-source video management solution)

Project description

Build Status Code Coverage

Shinobi Python Client

A Python client for controlling Shinobi (an open-source video management solution).

About

This package contains an (very incomplete) set of tools for interacting with Shinobi using Python.

This library tries to use the (rather unique) documented API but it also uses undocumented endpoints (which may not be stable).

Installation

Install from PyPi:

pip install shinobi-client

Install with ability to start a Shinobi installation:

pip install shinobi-client[shinobi-controller]

Install with CLI:

pip install shinobi-client[cli]

Usage

Python

User ORM

from shinobi_client import ShinobiUserOrm

user_orm = ShinobiUserOrm(host, port, super_user_token)

user = user_orm.get(email)

users = user_orm.get_all()

user = user_orm.create(email, password)

modified = user_orm.modify(email, password=new_password)

deleted = user_orm.delete(email)

Shinobi Controller

Starts/Stops a temporary containerised installation of Shinboi. Written for the purpose of testing but it is also installable as an extra. Requires Docker.

from shinobi_client import start_shinobi

with start_shinobi() as shinobi:
    print(shinobi.url)
    # Do things with a temporary Shinobi installation

or

from shinobi_client import ShinobiController

controller = ShinobiController()
shinobi = controller.start()
print(shinobi.url)
# Do things with a temporary Shinobi installation
controller.stop()

CLI

A basic auto-generated CLI is available if the package is installed with the cli extra:

PYTHONPATH=. python shinobi_client/user.py --host=HOST --port=PORT --super_user_token=SUPER_USER_TOKEN get example@

e.g.

$ PYTHONPATH=. python shinobi_client/user.py \
        --host='0.0.0.0' --port=50694 --super_user_token='26dd3352-73c4-4bbd-8b09-17f2aacbd7b9' \
    create 'user@example.com' 'password123'

Development

Install with dev-dependencies:

poetry install --no-root --extras "shinobi-controller"

Run tests with:

python -m unittest discover -v -s shinobi/tests

Legal

AGPL v3.0. Copyright 2020 Colin Nolan.

I am not affiliated to the development of Shinobi project in any way. This work is in no way related to the company that I work for.

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

shinobi-client-0.2.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

shinobi_client-0.2.1-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file shinobi-client-0.2.1.tar.gz.

File metadata

  • Download URL: shinobi-client-0.2.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Darwin/19.3.0

File hashes

Hashes for shinobi-client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e8f55ff94491dd37087240d9a03ba1baa401a84f650ae02f9ef13e4ff45c1f64
MD5 fa076e26b8c0b18e219e9e1e9245fc42
BLAKE2b-256 0ff8ee9ce37f0c4e51d82159f2488a589e5dce7c508907fd37a121a2e80cf438

See more details on using hashes here.

File details

Details for the file shinobi_client-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: shinobi_client-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Darwin/19.3.0

File hashes

Hashes for shinobi_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17b271495203c6c11fa2c0a9a9d7e050d6f8e61096689fc76c1c667b3511a340
MD5 f2b403b9dc5c9b87bfdcf9d84b4af468
BLAKE2b-256 16a032225a2e671774d9120b3720e4c73165352b5945a85447cf3acb3ce33ac9

See more details on using hashes here.

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