Skip to main content

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:

  1. lxml is faster then minidom
  2. lxml mimics the ElementTree API which is a more pythonic approach to XMLs

mpegdash package has two distinct advantages over this package:

  1. it does not require third party libraries.
  2. 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

  1. tags
  2. attribute parsers
  3. 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

  1. finish working on periods and sub tags
    1. periods
    2. adapt-sets
    3. segment bases
    4. segment lists
    5. segment templates
    6. asset ids
    7. event streams
    8. subsets
  2. create package locally
  3. test it
  4. complete readme
    1. installation
    2. usage
    3. Benchmarks
    4. contributing
  5. push to github
  6. push package to pypi
  7. add github actions
    1. pylint
    2. pytest
    3. build package
    4. push package
      1. add tokens to secrets
      2. build+push to test-pypi first
      3. build+push to pypi if test success
  8. complete unit-tests
  9. refactor tags to multiple files
  10. add parsing from file
  11. add parsing from URL

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

mpd-parser-0.0.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpd_parser-0.0.5-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file mpd-parser-0.0.5.tar.gz.

File metadata

  • Download URL: mpd-parser-0.0.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mpd-parser-0.0.5.tar.gz
Algorithm Hash digest
SHA256 729d8a171fcc9e5dcf5151a1f25bb79fa9e7f16e7d652ffd5ad6edb84e18986d
MD5 cf2a058f08182be52957dea02ab5801a
BLAKE2b-256 085f30a55eed1dd49b1da64a3463ccbd9016c03b22f0e65d7be0d17ab4a589ec

See more details on using hashes here.

File details

Details for the file mpd_parser-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: mpd_parser-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mpd_parser-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7668235d5a75e989846ddc9dafc50a996439a46edadc916b8cab5d00e494b76b
MD5 d9159572604426e1c5dd0d7a59b8e33e
BLAKE2b-256 a3f7eb573fd747f016d74e14fdac4cf126f38547a98e465af71b316ecaff1a0f

See more details on using hashes here.

Supported by

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