A Python client for controlling Shinobi (an open-source video management solution)
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f55ff94491dd37087240d9a03ba1baa401a84f650ae02f9ef13e4ff45c1f64 |
|
MD5 | fa076e26b8c0b18e219e9e1e9245fc42 |
|
BLAKE2b-256 | 0ff8ee9ce37f0c4e51d82159f2488a589e5dce7c508907fd37a121a2e80cf438 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b271495203c6c11fa2c0a9a9d7e050d6f8e61096689fc76c1c667b3511a340 |
|
MD5 | f2b403b9dc5c9b87bfdcf9d84b4af468 |
|
BLAKE2b-256 | 16a032225a2e671774d9120b3720e4c73165352b5945a85447cf3acb3ce33ac9 |