lxml based parser for DASH manifests (mpd files)
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)
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.
Currently, the package supports parsing only, not the creation or object->string conversion.
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
- add parsing from file
- add parsing from URL
Project details
Release history Release notifications | RSS feed
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
Hashes for mpd_parser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b4d23e00dac6b1c86d737a5b235231d39ee18811abd5bc2eea0e72450569e61 |
|
MD5 | e455e1159d3a9e5f8c85fc23a62af057 |
|
BLAKE2b-256 | 27e32d5a040a6393633200647c60ac594adea8133ccc600c5144111a2fcfc7d3 |