Python class to return a list of local media files from a folder with metadata of the files
Requirements
Python 3
Modules
pymediainfo
click
Dependencies
MediaInfo (for pymediainfo module)
get_media_files.__main__
Description: Returns list of files with data & file path of each file in its own list sorted by creation/metadata change time (oldest to newest (ascending order)) by default
Input: path to media files
Output: list of lists each containing media info of each media file
Usage
Use as CLI app such as python -m get_media_files my_path/Pictures or use it as an API and import via from get_media_files import GetMediaFiles.
Example
Suppose I have 2 image files, test2.jpg and test3.jpg, 1 text file, and 1 folder in the following path and
run the following code:
from get_media_files import GetMediaFiles path = '/home/j/Documents/_Github-Projects/MediaToVideo/temp-imgs' media = GetMediaFiles(path) info = media.get_info(path, track_types=['Image','Video']) print(info)
printed output:
[['/home/j/Documents/_Github-Projects/MediaToVideo/temp-imgs/test2.jpg',
{'Image':
{'duration': None, 'format': 'JPEG', 'size': (1920, 1080)}},
'Image',
1473055449.7858396],
['/home/j/Documents/_Github-Projects/MediaToVideo/temp-imgs/test3.jpg',
{'Image':
{'duration': None, 'format': 'JPEG', 'size': (291, 1080)}},
'Image',
1473055449.921839]]
Metadata
Release files for get-media-files 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| get_media_files-0.2.0.tar.gz | 935.8 kB | Without provenance | Details for get_media_files-0.2.0.tar.gz |
Release files / get_media_files-0.2.0.tar.gz
| Download URL | get_media_files-0.2.0.tar.gz |
|---|---|
| Size | 935.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ba15a2fa212051c0a2e3cb93eab49039b642fb2fd076d6186c6885a2eaf38a3
|
|
BLAKE2b-256 checksum How to use checksums |
a5f95c552aedc33285d2698676afddf4178145417b94115e28b430ea3acecf1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.2
|
Security for get-media-files 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.