Skip to main content

Digital asset management library

Project description

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 can be installed by grabbing the latest release from PyPI:

pip install MADAM

External requirements

The base installation bundles as much functionality as possible. However, support for audio and video data requires FFmpeg v0.9 or higher to be installed on the system.

Usage

Initialization:

>>> from madam import Madam
>>> madam = Madam()

Reading a JPEG image and extracting metadata:

>>> with open('path/to/file.jpg', 'rb') as file:
...     asset = madam.read(file)
>>> asset.mime_type
'image/jpeg'
>>> asset.width
800
>>> asset.height
600

Changing the size of an image asset:

>>> from madam.image import PillowProcessor
>>> pillow_processor = PillowProcessor()
>>> make_thumbnail = pillow_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 = pillow_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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MADAM-0.2.tar.gz (27.1 kB view hashes)

Uploaded Source

Built Distribution

MADAM-0.2-py3.5.egg (31.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page