python-mediamosa
mediamosa is a python wrapper for accessing a mediamosa (http://www.mediamosa.org) api.
Installation
Install mediamosa as follows:
pip install mediamosa
Getting Started
Start by creating a connection to a mediamosa api.
>>> from mediamosa.api import MediaMosaAPI
>>> api = MediaMosaAPI('http://apivideo.ugent.be')
>>> api.authenticate('USERNAME', 'PASSWORD')
True
the .authentication() method returns a boolean indicating if the username and password were accepted by the server.
You can now query your assets
>>> api.asset_list()
[<mediamosa.resources.Asset GAKkgcmMPaIZdMl3dczqUESA>,
<mediamosa.resources.Asset KWdqPljZge6ESLWbPdEEcG0j>,
<mediamosa.resources.Asset d1bbGsmEjXmeSfM8PGT5uRjB>,
<mediamosa.resources.Asset uKgRwHGTidLLiTiSUQu26buN>,
<mediamosa.resources.Asset x2XRGwefXfNvoRNYLJjfWS5O>,
<mediamosa.resources.Asset ONZDQiGfhTf8OcsKumKISpOy>,
<mediamosa.resources.Asset A1lkCZclpXaWSLE9RPK4Pthk>,
<mediamosa.resources.Asset A2TmfbWMcMU6r8jWHOS2JEsf>,
<mediamosa.resources.Asset B7zsZXLvnnLCCIyJOrCQxxRl>,
<mediamosa.resources.Asset C2VNSEfaeMc7ToOeirEqiztz>, ...]
Each direct child of an <item> can be accessed as an attribute:
>>> asset = api.asset_list()[0]
>>> asset.dublin_core.get('title')
u'big buck bunny '
You can also indiviually request specific assets by querying the api object:
>>> api.asset('ONZDQiGfhTf8OcsKumKISpOy')
<mediamosa.resources.Asset ONZDQiGfhTf8OcsKumKISpOy>
Mediafiles connected to the asset can also be queried:
>>> asset.list_mediafiles()
[<mediamosa.resources.Mediafile (mp4) Yb8peCXknRXIhimONUUzkuBT>]
>>> mediafile = asset.list_mediafiles()[0]
>>> mediafile.filename
u'bigbuckbunny30sec.mp4'
>>> mediafile.is_downloadable
True
You can also individually request mediafiles by querying the api object:
>>> api.mediafile('Yb8peCXknRXIhimONUUzkuBT')
<mediamosa.resources.Mediafile (mp4) Yb8peCXknRXIhimONUUzkuBT>
Playing a mediafile is done as follows:
>>> mediafile.play()
u'<script type="text/javascript">...'
This will by default return javascript code necessary to play the mediafile.
Errors
If anything goes wrong with executing the queries, the API will throw a mediamosa.api.ApiException.
Bugs and Feature requests
For help, issues and feature requests, please go to http://www.github.com/UGentPortaal/python-mediamosa.
Contributing
Pull requests may be submitted to the develop branch at our github project. Make sure the code and functionality are sufficiently documented.
Metadata
Release files for mediamosa 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mediamosa-0.0.5.tar.gz | 13.0 kB | Without provenance | Details for mediamosa-0.0.5.tar.gz |
Release files / mediamosa-0.0.5.tar.gz
| Download URL | mediamosa-0.0.5.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a3ce8642cb1b66901a852263468fce29fd37cc8c02b81c15bdd815807ebecb7
|
|
BLAKE2b-256 checksum How to use checksums |
2f741bc381d8239f67b3dac14c5c152e030ba519b8b9e72e2a14645e995e6e69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mediamosa 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.