Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eseifert/madam
Media Asset Management for Python
https://github.com/eseifert/madam
hacktoberfest hacktoberfest2022 media-asset-management media-management media-processing python python3
Last synced: 4 months ago
JSON representation
Media Asset Management for Python
- Host: GitHub
- URL: https://github.com/eseifert/madam
- Owner: eseifert
- License: agpl-3.0
- Created: 2016-08-04T09:38:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-29T15:24:26.000Z (over 2 years ago)
- Last Synced: 2024-09-29T17:01:51.868Z (4 months ago)
- Topics: hacktoberfest, hacktoberfest2022, media-asset-management, media-management, media-processing, python, python3
- Language: Python
- Homepage: https://madam.readthedocs.io
- Size: 2.74 MB
- Stars: 24
- Watchers: 4
- Forks: 6
- Open Issues: 12
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.AGPL
Awesome Lists containing this project
- awesome-starred - eseifert/madam - Media Asset Management for Python (python3)
README
MADAM
#####Multimedia Advanced Digital Asset Management
|ci-badge|_ |codecov-badge|_ |pypi-badge|_ |readthedocs-badge|_
.. |ci-badge| image:: https://github.com/eseifert/madam/actions/workflows/ci.yml/badge.svg?
.. _ci-badge: https://github.com/eseifert/madam/actions/workflows/ci.yml
.. |codecov-badge| image:: https://codecov.io/gh/eseifert/madam/branch/master/graph/badge.svg?token=x0aF4xnSz5
.. _codecov-badge: https://codecov.io/gh/eseifert/madam
.. |pypi-badge| image:: https://img.shields.io/pypi/v/madam.svg?
.. _pypi-badge: https://pypi.python.org/pypi/MADAM
.. |readthedocs-badge| image:: https://readthedocs.org/projects/madam/badge/?version=latest
.. _readthedocs-badge: https://madam.readthedocs.io/en/latest/?badge=latestMADAM 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... quickstart_start
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:
.. code:: shell
pip install madam
Usage
=====Initialization:
.. code:: pycon
>>> from madam import Madam
>>> manager = Madam()Define settings for different file formats:
.. code:: pycon
>>> config = {
... 'image/jpeg': dict(
... quality=85,
... ),
... }
>>> manager = Madam(config)Reading a JPEG image and extracting metadata:
.. code:: pycon
>>> with open('path/to/file.jpg', 'rb') as file:
... asset = manager.read(file)
>>> asset.mime_type
'image/jpeg'
>>> asset.width
800
>>> asset.height
600Changing the size of an image asset:
.. code:: pycon
>>> 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
100Converting an image to a different file format and saving it to a file:
.. code:: pycon
>>> 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)