A module to parse, analyze and validate MPEG-DASH MPD
Project description
mpd-parser
Installation
$ python -m pip install mpd-parser
Usage
Importing
from mpd_parser.parser import Parser
parse from string
with open("path/to/file.mpd", mode="r") as manifest_file:
mpd_string = manifest_file.read()
parsed_mpd = Parser.from_string(mpd_string)
parse from file
input_file = "path/to/file.mpd"
mpd = Parser.from_file(input_file)
convert back to string
mpd_as_xml_string = Parser.to_string(parsed_mpd)
Overview
A utility to parse mpeg dash mpd files quickly This package is heavily inspired by mpegdash package the main difference is that I choose to relay on lxml for parsing, and not the standard xml library.
The decision to implement it with lxml is for two reasons:
- lxml is faster then minidom
- lxml mimics the ElementTree API which is a more pythonic approach to XMLs
mpegdash package has two distinct advantages over this package:
- it does not require third party libraries.
- it uses the classic DOM approach to parsing XML files. it is a well known standard.
Benchmarks
TBA
Example manifests
Taken from https://ottverse.com/free-mpeg-dash-mpd-manifest-example-test-urls/ These are what I used to test and benchmark the package.
Missing unit-tests
- tags
- attribute parsers
- full manifest testing
Contributing
TBA
Build locally
python -m build
Run pylint locally
I try to keep the pylint score above 9.
python -m pylint ./mpd_parser/
TODO
finish working on periods and sub tagsperiodsadapt-setssegment basessegment listssegment templatesasset idsevent streamssubsets
create package locallytest it- complete readme
installationusage- Benchmarks
- contributing
push to githubpush package to pypi- add github actions
pylintpytestbuild packagepush package
- complete unit-tests
- refactor tags to multiple files
- Parsing:
parsing from stringparsing from file- parsing from URL
- save mpd object:
object to string- object to 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
Built Distribution
File details
Details for the file mpd_inspector-0.1.0.tar.gz
.
File metadata
- Download URL: mpd_inspector-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11ee7b94a3c9c595b0feb16d6547f4343a5f329d845fd095a76d540a5278f17 |
|
MD5 | 150ca603b0dde1dfb0639e04695c129b |
|
BLAKE2b-256 | 96706b0c7ffd4dedd651487ae6973a6ebe65e2b6ba4cae1e48bd959c124d9931 |
Provenance
File details
Details for the file mpd_inspector-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mpd_inspector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40cc4b9f0207e204b64cbc895a6aee30e276e03d0fdbe020309b741721d81ebf |
|
MD5 | 14ad880619e25b44e84742c463afa2c7 |
|
BLAKE2b-256 | cb343a35659b838607da614e3d346081eee03bc87b3ae3a3377f2dc84b48daa1 |