New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mpd-parser

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mpd-parser

lxml based parser for DASH manifests (mpd files)

pipPyPI
Version
0.1.6
Maintainers
1

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 tags
    • periods
    • adapt-sets
    • segment bases
    • segment lists
    • segment templates
    • asset ids
    • event streams
    • subsets
  • create package locally
  • test it
  • complete readme
    • installation
    • usage
    • Benchmarks
    • contributing
  • push to github
  • push package to pypi
  • add github actions
    • pylint
    • pytest
    • build package
    • push package
  • complete unit-tests
  • refactor tags to multiple files
  • Parsing:
    • parsing from string
    • parsing from file
    • parsing from URL
  • save mpd object:
    • object to string
    • object to file

Keywords

parser

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts