Name | mpd-parser JSON |
Version |
0.1.4
JSON |
| download |
home_page | https://github.com/avishaycohen/mpd-parser |
Summary | lxml based parser for DASH manifests (mpd files) |
upload_time | 2024-11-15 15:17:03 |
maintainer | None |
docs_url | None |
author | Avishay Cohen |
requires_python | >=3.8 |
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. |
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)
```
### parse from file
```python
input_file = "path/to/file.mpd"
mpd = Parser.from_file(input_file)
```
### convert back to string
```python
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](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.
## 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~~
8. complete unit-tests
9. refactor tags to multiple files
10. Parsing:
1. ~~parsing from string~~
2. ~~parsing from file~~
3. parsing from URL
11. save mpd object:
1. ~~object to string~~
2. object to file
Raw data
{
"_id": null,
"home_page": "https://github.com/avishaycohen/mpd-parser",
"name": "mpd-parser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "parser, DASH, manifest, video, files",
"author": "Avishay Cohen",
"author_email": "Avishay Cohen <avishay.c@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f7/1b/42204347364a3423cfcfdaccb5414e745a19eeaf4309059029e6261e5985/mpd_parser-0.1.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### parse from file\n```python\ninput_file = \"path/to/file.mpd\"\nmpd = Parser.from_file(input_file)\n```\n\n### convert back to string\n```python\nmpd_as_xml_string = Parser.to_string(parsed_mpd)\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\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~~\n8. complete unit-tests\n9. refactor tags to multiple files\n10. Parsing:\n 1. ~~parsing from string~~\n 2. ~~parsing from file~~\n 3. parsing from URL\n11. save mpd object:\n 1. ~~object to string~~\n 2. object to file\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.1.4",
"project_urls": {
"Homepage": "https://github.com/avishaycohen/mpd-parser"
},
"split_keywords": [
"parser",
" dash",
" manifest",
" video",
" files"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e415e7858a61392952cf90826d07eaf5d0b3142acb9c2c46ec44de5017ffa5b7",
"md5": "5cd31bd0bd2fea3972ef68ce7a513a7b",
"sha256": "0039607097efdf3d8fb515cd3ce65dd66a1b17ef53e2e5d5e6d1d69becbeb60c"
},
"downloads": -1,
"filename": "mpd_parser-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5cd31bd0bd2fea3972ef68ce7a513a7b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 12326,
"upload_time": "2024-11-15T15:17:02",
"upload_time_iso_8601": "2024-11-15T15:17:02.275461Z",
"url": "https://files.pythonhosted.org/packages/e4/15/e7858a61392952cf90826d07eaf5d0b3142acb9c2c46ec44de5017ffa5b7/mpd_parser-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f71b42204347364a3423cfcfdaccb5414e745a19eeaf4309059029e6261e5985",
"md5": "aadd7b0ebc0d3b2560b5140a46c5c658",
"sha256": "276436c5295954af9a0819932bcb9409952e6f6cc6e795bbd46de348620e0b0b"
},
"downloads": -1,
"filename": "mpd_parser-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "aadd7b0ebc0d3b2560b5140a46c5c658",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 15575,
"upload_time": "2024-11-15T15:17:03",
"upload_time_iso_8601": "2024-11-15T15:17:03.787474Z",
"url": "https://files.pythonhosted.org/packages/f7/1b/42204347364a3423cfcfdaccb5414e745a19eeaf4309059029e6261e5985/mpd_parser-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 15:17:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "avishaycohen",
"github_project": "mpd-parser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "mpd-parser"
}