mpd-parser


Namempd-parser JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/avishaycohen/mpd-parser
Summarylxml based parser for DASH manifests (mpd files)
upload_time2022-07-07 04:13:53
maintainer
docs_urlNone
authorAvishay Cohen
requires_python>=3.7
licenseMIT License Copyright (c) 2022 avishaycohen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords parser dash manifest video files
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mpd-parser

## Installation
```shell
$ python -m pip install mpd-parser
```

## Usage
### Importing

```python
from mpd_parser.parser import Parser
```
### parse from string
```python
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](https://github.com/sangwonl/python-mpegdash) 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
```shell
python -m build
```
### Run pylint locally
I try to keep the pylint score above 9.
```shell
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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/avishaycohen/mpd-parser",
    "name": "mpd-parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "parser,DASH,manifest,video,files",
    "author": "Avishay Cohen",
    "author_email": "Avishay Cohen <avishay.c@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/dc/ff/9e84a275d79080ab9a93b3ff86547a546efb69c852dc2d9933b3bc200595/mpd-parser-0.0.4.tar.gz",
    "platform": null,
    "description": "# mpd-parser\n\n## Installation\n```shell\n$ python -m pip install mpd-parser\n```\n\n## Usage\n### Importing\n\n```python\nfrom mpd_parser.parser import Parser\n```\n### parse from string\n```python\nwith open(\"path/to/file.mpd\", mode=\"r\") as manifest_file:\n    mpd_string = manifest_file.read()\n    parsed_mpd = Parser.from_string(mpd_string)\n```\n\n## Overview\nA utility to parse mpeg dash mpd files quickly\nThis package is heavily inspired by [mpegdash package](https://github.com/sangwonl/python-mpegdash) the main difference is that I choose to relay on lxml for parsing, and not the standard xml library.\n\nThe decision to implement it with lxml is for two reasons:\n1. lxml is faster then minidom\n2. lxml mimics the ElementTree API which is a more pythonic approach to XMLs\n\nmpegdash package has two distinct advantages over this package:\n1. it does not require third party libraries.\n2. it uses the classic DOM approach to parsing XML files. it is a well known standard.\n\nCurrently, the package supports parsing only, not the creation or object->string conversion.\n\n## Benchmarks\nTBA\n\n## Example manifests\nTaken from https://ottverse.com/free-mpeg-dash-mpd-manifest-example-test-urls/\nThese are what I used to test and benchmark the package.\n\n## Missing unit-tests\n1. tags\n2. attribute parsers\n3. full manifest testing\n\n## Contributing\nTBA\n\n### Build locally\n```shell\npython -m build\n```\n### Run pylint locally\nI try to keep the pylint score above 9.\n```shell\npython -m pylint ./mpd_parser/\n```\n\n## TODO\n1. ~~finish working on periods and sub tags~~\n   1. ~~periods~~\n   2. ~~adapt-sets~~\n   3. ~~segment bases~~\n   4. ~~segment lists~~\n   5. ~~segment templates~~\n   6. ~~asset ids~~\n   7. ~~event streams~~\n   8. ~~subsets~~\n2. ~~create package locally~~\n3. ~~test it~~\n4. complete readme\n   1. ~~installation~~\n   2. ~~usage~~\n   3. Benchmarks\n   4. contributing\n5. ~~push to github~~\n6. ~~push package to pypi~~\n7. add github actions\n   1. ~~pylint~~\n   2. pytest\n   3. build package\n   4. push package\n      1. add tokens to secrets\n      2. build+push to test-pypi first\n      3. build+push to pypi if test success\n8. complete unit-tests\n9. refactor tags to multiple files\n10. add parsing from file\n11. add parsing from URL\n",
    "bugtrack_url": null,
    "license": "MIT License Copyright (c) 2022 avishaycohen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "lxml based parser for DASH manifests (mpd files)",
    "version": "0.0.4",
    "split_keywords": [
        "parser",
        "dash",
        "manifest",
        "video",
        "files"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c50010a2c281b4b5741b8244c699ce45",
                "sha256": "2949aedb7ec57664f933edb90d582f8ce4a387b2b41b53b067ca0e9b633a45f2"
            },
            "downloads": -1,
            "filename": "mpd_parser-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c50010a2c281b4b5741b8244c699ce45",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9381,
            "upload_time": "2022-07-07T04:13:51",
            "upload_time_iso_8601": "2022-07-07T04:13:51.671898Z",
            "url": "https://files.pythonhosted.org/packages/cd/68/eca78d41ccb1db9a4e472d674365b92adbe7bdfc82c2e580a5fcc46c425b/mpd_parser-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a625e11e2a44ac2c302e3f6a3cbb0655",
                "sha256": "448255c52c7dd14475cc7958d694c65a98d4830720dd461a2a1370ef21de301c"
            },
            "downloads": -1,
            "filename": "mpd-parser-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a625e11e2a44ac2c302e3f6a3cbb0655",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10023,
            "upload_time": "2022-07-07T04:13:53",
            "upload_time_iso_8601": "2022-07-07T04:13:53.640036Z",
            "url": "https://files.pythonhosted.org/packages/dc/ff/9e84a275d79080ab9a93b3ff86547a546efb69c852dc2d9933b3bc200595/mpd-parser-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-07-07 04:13:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "avishaycohen",
    "github_project": "mpd-parser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "mpd-parser"
}
        
Elapsed time: 0.41156s