Media Asset Management for Python
Python
Latest commit dbfaa3e Dec 31, 2016 @eseifert PillowProcessor.resize() and PillowProcessor.transpose() don't implic…
…itly convert to JPEG (resolves #70).
Permalink
Failed to load latest commit information.
doc
madam
tests
.coveragerc
.gitattributes
.gitignore
.travis.yml
LICENSE.AGPL
MANIFEST.in
README.rst
pytest.ini
setup.cfg
setup.py
tox.ini
versioneer.py

README.rst

MADAM

Multimedia Advanced Digital Asset Management

travis-badge coveralls-badge pypi-badge readthedocs-badge

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 >=0.9
  • libexiv2 >=0.20 (with header files)
  • boost.python >=1.48 (with header files)

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()

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:
...     madam.write(png_asset, file)