medialoopster API wrapper for Python
Project description
medialoopster
medialoopster API wrapper for Python
medialoopster is a wrapper library for the HTTP API of the medialoopster Media Asset Management System.
Installation
pip install medialoopster
Features
- Connect to medialoopster API with authentication
- Retrieve and manage productions
- Get, create, update, and delete assets (video, audio, image, project)
- Search for assets by metadata
- Archive and restore assets
- Manage asset approval status
- Handle shots and sequences for video assets
Usage Examples
Basic Connection
from medialoopster import Medialoopster
# Initialize the client
client = Medialoopster(
url="https://medialoopster.example.com/api/",
user="username",
password="password",
verify=True # Set to False to disable SSL verification
)
# Check if the API is reachable
if client.ping():
print("Connected to medialoopster API!")
else:
print("Failed to connect to medialoopster API")
Working with Productions
# Get all productions
productions = client.productions()
for production in productions:
print(f"Production: {production.name} (ID: {production.id})")
# Get a specific production by ID
production = client.production(production_id=123)
# Get a specific production by name
production = client.production(production_name="My Production")
Working with Assets
# Get video assets for a production
assets = client.get_videoassets(production_id=123)
for asset in assets:
print(f"Asset: {asset.get('name')} (ID: {asset.get('id')})")
# Get a specific asset
asset = client.get_asset(asset_id=456)
# Import a new asset
asset_id = client.asset_import(
production="My Production",
asset_type="video",
name="My Video",
path_file="/path/to/file.mp4",
meta_field_store={"key": "value"}
)
# Approve an asset
client.approve_asset(asset_id=456)
# Delete an asset
client.delete_asset(asset_id=456)
Error Handling
from medialoopster import Medialoopster
from medialoopster.exceptions import (
MedialoopsterError,
MedialoopsterConnectionError,
MedialoopsterAuthenticationError,
MedialoopsterNotFoundError
)
client = Medialoopster(url="https://medialoopster.example.com/api/")
try:
asset = client.get_asset(asset_id=999999)
except MedialoopsterNotFoundError:
print("Asset not found")
except MedialoopsterConnectionError:
print("Connection error")
except MedialoopsterError as e:
print(f"An error occurred: {e}")
Documentation
For more detailed documentation, please refer to the docstrings in the code or visit the medialoopster API documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file medialoopster-0.3.1.tar.gz.
File metadata
- Download URL: medialoopster-0.3.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
046322be171757fd6a22fecd70df04b14686db4925b9bd3f0a134d45845fb34f
|
|
| MD5 |
e2978b72e07df9779d0cdfe41ec1063d
|
|
| BLAKE2b-256 |
a55b7e709c0f0efe10781a2ef8dd1960a9bb3bf2495e8e2e05a49be3ccefd963
|
File details
Details for the file medialoopster-0.3.1-py3-none-any.whl.
File metadata
- Download URL: medialoopster-0.3.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
453e8490b5c55678dc83420ef5892d9b04bdd0471411de0a202d11315a4e3015
|
|
| MD5 |
5960f017e8aad738fff2d44e375667d3
|
|
| BLAKE2b-256 |
1741fe7a8129861ebe150eeac979e7875c409cb379597938bddee0303556d4c9
|