Digital asset management library
Project description
Multimedia Advanced Digital Asset Management
MADAM is a digital asset management library. It aims to facilitate the handling of image, audio, and video files by helping out with several tasks, like storing, organizing, and transforming asset data.
Installation
MADAM makes use of other software, which needs to be installed on your system. Make sure you have the following packages installed:
FFmpeg >=3.3 for video processing
After you installed these, MADAM can be installed by grabbing the latest release from PyPI:
pip install madam
Usage
Initialization:
>>> from madam import Madam
>>> manager = Madam()
Define settings for different file formats:
>>> config = {
... 'image/jpeg': dict(
... quality=85,
... ),
... }
>>> manager = Madam(config)
Reading a JPEG image and extracting metadata:
>>> with open('path/to/file.jpg', 'rb') as file:
... asset = manager.read(file)
>>> asset.mime_type
'image/jpeg'
>>> asset.width
800
>>> asset.height
600
Changing the size of an image asset:
>>> processor = manager.get_processor(asset.essence)
>>> make_thumbnail = processor.resize(width=100, height=100)
>>> resized_asset = make_thumbnail(asset)
>>> resized_asset.width
100
>>> resized_asset.height
100
Converting an image to a different file format and saving it to a file:
>>> convert_to_png = processor.convert(mime_type='image/png')
>>> png_asset = convert_to_png(asset)
>>> with open('path/to/file.png', 'wb') as file:
... manager.write(png_asset, file)
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 MADAM-0.21.2.tar.gz
.
File metadata
- Download URL: MADAM-0.21.2.tar.gz
- Upload date:
- Size: 53.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d47725cf9fe0f55af1a6c8d5f4f97885ded841acfd2aed8716f1ad90b108a178 |
|
MD5 | b876de7b59a003636b68ae521b45c957 |
|
BLAKE2b-256 | c1e1bfef631e6697b38d80dc9ec767be346aed77d026e0f0538548fcb9e14f5f |
File details
Details for the file MADAM-0.21.2-py3-none-any.whl
.
File metadata
- Download URL: MADAM-0.21.2-py3-none-any.whl
- Upload date:
- Size: 40.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cee169bf55d24ad7c0af419dbe63027190ed77f98372e53c37e37a5841adaa7 |
|
MD5 | 1a5d60977273a0f7c110649eabb1e9bc |
|
BLAKE2b-256 | 316afdc46c64c948999589ed69f059956056d383078188f922b5b915a9d3ec42 |