python-didl-lite 1.4.1__tar.gz → 1.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/PKG-INFO +23 -10
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/README.rst +13 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/didl_lite/__init__.py +2 -1
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/didl_lite/didl_lite.py +49 -44
- python_didl_lite-1.5.1/pyproject.toml +94 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/python_didl_lite.egg-info/PKG-INFO +23 -10
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/python_didl_lite.egg-info/SOURCES.txt +1 -2
- python_didl_lite-1.5.1/python_didl_lite.egg-info/requires.txt +4 -0
- python_didl_lite-1.5.1/setup.cfg +14 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/tests/test_didl_lite.py +129 -16
- python_didl_lite-1.4.1/LICENSE.md +0 -194
- python_didl_lite-1.4.1/python_didl_lite.egg-info/requires.txt +0 -1
- python_didl_lite-1.4.1/setup.cfg +0 -26
- python_didl_lite-1.4.1/setup.py +0 -52
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/didl_lite/py.typed +0 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/didl_lite/utils.py +0 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/python_didl_lite.egg-info/dependency_links.txt +0 -0
- {python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/python_didl_lite.egg-info/top_level.txt +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-didl-lite
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.1
|
|
4
4
|
Summary: DIDL-Lite (Digital Item Declaration Language) tools for Python
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Author-email: Steven Looman <steven.looman@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: GitHub: repo, https://github.com/StevenLooman/python-didl-lite
|
|
8
|
+
Keywords: DIDL,DIDL-lite
|
|
8
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: >=3.10
|
|
19
18
|
Description-Content-Type: text/x-rst
|
|
20
|
-
License-File: LICENSE.md
|
|
21
19
|
Requires-Dist: defusedxml>=0.6.0
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Requires-Dist: pytest==9.1.1; extra == "test"
|
|
22
22
|
|
|
23
23
|
DIDL-Lite (Digital Item Declaration Language) tools for Python
|
|
24
24
|
==============================================================
|
|
@@ -42,3 +42,16 @@ DIDL-Lite resources and documents:
|
|
|
42
42
|
* `UPnP-av-ContentDirectory-v2-Service <http://upnp.org/specs/av/UPnP-av-ContentDirectory-v2-Service.pdf>`_
|
|
43
43
|
* `didl-lite-v2.xsd <http://www.upnp.org/schemas/av/didl-lite-v2.xsd>`_
|
|
44
44
|
* `mpeg21-didl <http://xml.coverpages.org/mpeg21-didl.html>`_
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Releasing
|
|
48
|
+
---------
|
|
49
|
+
|
|
50
|
+
Steps for releasing:
|
|
51
|
+
|
|
52
|
+
- Switch to master: ``git checkout master``
|
|
53
|
+
- Do a pull: ``git pull``
|
|
54
|
+
- Run towncrier: ``towncrier build --version <version>``
|
|
55
|
+
- Commit towncrier results: ``git commit -m "Towncrier"``
|
|
56
|
+
- Run bump2version (note that this creates a new commit + tag): ``bump2version --tag major/minor/patch``
|
|
57
|
+
- Push to github: ``git push && git push --tags``
|
|
@@ -20,3 +20,16 @@ DIDL-Lite resources and documents:
|
|
|
20
20
|
* `UPnP-av-ContentDirectory-v2-Service <http://upnp.org/specs/av/UPnP-av-ContentDirectory-v2-Service.pdf>`_
|
|
21
21
|
* `didl-lite-v2.xsd <http://www.upnp.org/schemas/av/didl-lite-v2.xsd>`_
|
|
22
22
|
* `mpeg21-didl <http://xml.coverpages.org/mpeg21-didl.html>`_
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Releasing
|
|
26
|
+
---------
|
|
27
|
+
|
|
28
|
+
Steps for releasing:
|
|
29
|
+
|
|
30
|
+
- Switch to master: ``git checkout master``
|
|
31
|
+
- Do a pull: ``git pull``
|
|
32
|
+
- Run towncrier: ``towncrier build --version <version>``
|
|
33
|
+
- Commit towncrier results: ``git commit -m "Towncrier"``
|
|
34
|
+
- Run bump2version (note that this creates a new commit + tag): ``bump2version --tag major/minor/patch``
|
|
35
|
+
- Push to github: ``git push && git push --tags``
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""DIDL-Lite (Digital Item Declaration Language) tools for Python."""
|
|
3
2
|
# pylint: disable=too-many-lines
|
|
4
3
|
|
|
4
|
+
import re
|
|
5
5
|
from typing import (
|
|
6
6
|
Any,
|
|
7
7
|
Dict,
|
|
@@ -86,7 +86,7 @@ class DidlObject:
|
|
|
86
86
|
**properties: Any,
|
|
87
87
|
) -> None:
|
|
88
88
|
"""Initialize."""
|
|
89
|
-
# pylint: disable=invalid-name,redefined-builtin,too-many-arguments
|
|
89
|
+
# pylint: disable=invalid-name,redefined-builtin,too-many-arguments,too-many-positional-arguments
|
|
90
90
|
properties["id"] = id
|
|
91
91
|
properties["parent_id"] = parent_id
|
|
92
92
|
properties["class"] = self.upnp_class
|
|
@@ -100,9 +100,7 @@ class DidlObject:
|
|
|
100
100
|
self.xml_el = xml_el
|
|
101
101
|
self.descriptors = descriptors if descriptors else []
|
|
102
102
|
|
|
103
|
-
def _ensure_required_properties(
|
|
104
|
-
self, strict: bool, properties: Mapping[str, Any]
|
|
105
|
-
) -> None:
|
|
103
|
+
def _ensure_required_properties(self, strict: bool, properties: Mapping[str, Any]) -> None:
|
|
106
104
|
"""Check if all required properties are given."""
|
|
107
105
|
if not strict:
|
|
108
106
|
return
|
|
@@ -183,9 +181,7 @@ class DidlObject:
|
|
|
183
181
|
continue
|
|
184
182
|
key = didl_property_def_key(property_def)
|
|
185
183
|
|
|
186
|
-
if (
|
|
187
|
-
getattr(self, key) is None or key == "res"
|
|
188
|
-
): # no resources, handled later on
|
|
184
|
+
if getattr(self, key) is None or key == "res": # no resources, handled later on
|
|
189
185
|
continue
|
|
190
186
|
|
|
191
187
|
tag = property_def[0] + ":" + property_def[1]
|
|
@@ -244,11 +240,7 @@ class DidlObject:
|
|
|
244
240
|
def __repr__(self) -> str:
|
|
245
241
|
"""Evaluatable string representation of this object."""
|
|
246
242
|
class_name = type(self).__name__
|
|
247
|
-
attr = ", ".join(
|
|
248
|
-
f"{key}={val!r}"
|
|
249
|
-
for key, val in self.__dict__.items()
|
|
250
|
-
if key not in ("class", "xml_el")
|
|
251
|
-
)
|
|
243
|
+
attr = ", ".join(f"{key}={val!r}" for key, val in self.__dict__.items() if key not in ("class", "xml_el"))
|
|
252
244
|
return f"{class_name}({attr})"
|
|
253
245
|
|
|
254
246
|
|
|
@@ -320,6 +312,7 @@ class MusicTrack(AudioItem):
|
|
|
320
312
|
didl_properties_defs = AudioItem.didl_properties_defs + [
|
|
321
313
|
("upnp", "artist", "O"),
|
|
322
314
|
("upnp", "album", "O"),
|
|
315
|
+
("upnp", "albumArtURI", "O"),
|
|
323
316
|
("upnp", "originalTrackNumber", "O"),
|
|
324
317
|
("upnp", "playlist", "O"),
|
|
325
318
|
("upnp", "storageMedium", "O"),
|
|
@@ -627,7 +620,7 @@ class Container(DidlObject, list):
|
|
|
627
620
|
**properties: Any,
|
|
628
621
|
) -> None:
|
|
629
622
|
"""Initialize."""
|
|
630
|
-
# pylint: disable=redefined-builtin,too-many-arguments
|
|
623
|
+
# pylint: disable=redefined-builtin,too-many-arguments,too-many-positional-arguments
|
|
631
624
|
super().__init__(id, parent_id, descriptors, xml_el, strict, **properties)
|
|
632
625
|
self.extend(children)
|
|
633
626
|
|
|
@@ -659,11 +652,7 @@ class Container(DidlObject, list):
|
|
|
659
652
|
def __repr__(self) -> str:
|
|
660
653
|
"""Evaluatable string representation of this object."""
|
|
661
654
|
class_name = type(self).__name__
|
|
662
|
-
attr = ", ".join(
|
|
663
|
-
f"{key}={val!r}"
|
|
664
|
-
for key, val in self.__dict__.items()
|
|
665
|
-
if key not in ("class", "xml_el")
|
|
666
|
-
)
|
|
655
|
+
attr = ", ".join(f"{key}={val!r}" for key, val in self.__dict__.items() if key not in ("class", "xml_el"))
|
|
667
656
|
children_repr = ", ".join(repr(child) for child in self)
|
|
668
657
|
return f"{class_name}({attr}, children=[{children_repr}])"
|
|
669
658
|
|
|
@@ -929,7 +918,7 @@ class Resource:
|
|
|
929
918
|
xml_el: Optional[ET.Element] = None,
|
|
930
919
|
) -> None:
|
|
931
920
|
"""Initialize."""
|
|
932
|
-
# pylint: disable=too-many-arguments
|
|
921
|
+
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
|
933
922
|
self.uri = uri
|
|
934
923
|
self.protocol_info = protocol_info
|
|
935
924
|
self.import_uri = import_uri
|
|
@@ -987,11 +976,7 @@ class Resource:
|
|
|
987
976
|
def __repr__(self) -> str:
|
|
988
977
|
"""Evaluatable string representation of this object."""
|
|
989
978
|
class_name = type(self).__name__
|
|
990
|
-
attr = ", ".join(
|
|
991
|
-
f"{key}={val!r}"
|
|
992
|
-
for key, val in self.__dict__.items()
|
|
993
|
-
if val is not None and key != "xml_el"
|
|
994
|
-
)
|
|
979
|
+
attr = ", ".join(f"{key}={val!r}" for key, val in self.__dict__.items() if val is not None and key != "xml_el")
|
|
995
980
|
return f"{class_name}({attr})"
|
|
996
981
|
|
|
997
982
|
|
|
@@ -1007,7 +992,7 @@ class Descriptor:
|
|
|
1007
992
|
xml_el: Optional[ET.Element] = None,
|
|
1008
993
|
) -> None:
|
|
1009
994
|
"""Initialize."""
|
|
1010
|
-
# pylint: disable=invalid-name,redefined-builtin,too-many-arguments
|
|
995
|
+
# pylint: disable=invalid-name,redefined-builtin,too-many-arguments,too-many-positional-arguments
|
|
1011
996
|
self.id = id
|
|
1012
997
|
self.name_space = name_space
|
|
1013
998
|
self.type = type
|
|
@@ -1044,11 +1029,7 @@ class Descriptor:
|
|
|
1044
1029
|
def __repr__(self) -> str:
|
|
1045
1030
|
"""Evaluatable string representation of this object."""
|
|
1046
1031
|
class_name = type(self).__name__
|
|
1047
|
-
attr = ", ".join(
|
|
1048
|
-
f"{key}={val!r}"
|
|
1049
|
-
for key, val in self.__dict__.items()
|
|
1050
|
-
if val is not None and key != "xml_el"
|
|
1051
|
-
)
|
|
1032
|
+
attr = ", ".join(f"{key}={val!r}" for key, val in self.__dict__.items() if val is not None and key != "xml_el")
|
|
1052
1033
|
return f"{class_name}({attr})"
|
|
1053
1034
|
|
|
1054
1035
|
|
|
@@ -1070,25 +1051,51 @@ def to_xml_string(*objects: DidlObject) -> bytes:
|
|
|
1070
1051
|
return ET.tostring(root_el)
|
|
1071
1052
|
|
|
1072
1053
|
|
|
1073
|
-
def from_xml_string(
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1054
|
+
def from_xml_string(xml_string: str, strict: bool = True) -> List[Union[DidlObject, Descriptor]]:
|
|
1055
|
+
"""Parse DIDL-Lite XML string."""
|
|
1056
|
+
if not strict:
|
|
1057
|
+
# Find all prefixes used in tags, e.g., <prefix:tag ...>
|
|
1058
|
+
used_prefixes = set(re.findall(r"<([A-Za-z_][\w.-]*):", xml_string))
|
|
1059
|
+
|
|
1060
|
+
# Find all defined namespaces, e.g., xmlns:prefix=...
|
|
1061
|
+
defined_prefixes = set(re.findall(r"xmlns:([A-Za-z_][\w.-]*)=", xml_string))
|
|
1062
|
+
|
|
1063
|
+
# Identify prefixes used but not defined.
|
|
1064
|
+
missing_prefixes = used_prefixes - defined_prefixes - {"DIDL-Lite", "dc", "upnp", "dlna"}
|
|
1065
|
+
|
|
1066
|
+
if missing_prefixes:
|
|
1067
|
+
# Inject temporary namespace declarations into the DIDL-Lite root
|
|
1068
|
+
# opening tag. Anchoring on the root element (always present in
|
|
1069
|
+
# valid DIDL-Lite documents) instead of an optional `xmlns:dlna`
|
|
1070
|
+
# allows us to recover XML from devices that omit the dlna
|
|
1071
|
+
# namespace declaration entirely (observed on JBL Authentics and
|
|
1072
|
+
# WiiM/LinkPlay players sending `<song:*>` without `xmlns:dlna`).
|
|
1073
|
+
# The root itself may carry a prefix, as in `<didl:DIDL-Lite>`, so
|
|
1074
|
+
# the match is captured and written back unchanged.
|
|
1075
|
+
injections = " ".join(
|
|
1076
|
+
f'xmlns:{prefix}="http://tempuri.org/{prefix}/"' for prefix in sorted(missing_prefixes)
|
|
1077
|
+
)
|
|
1078
|
+
xml_string = re.sub(
|
|
1079
|
+
r"<((?:[A-Za-z_][\w.-]*:)?DIDL-Lite)\b",
|
|
1080
|
+
lambda match: f"<{match.group(1)} {injections}",
|
|
1081
|
+
xml_string,
|
|
1082
|
+
count=1,
|
|
1083
|
+
)
|
|
1084
|
+
|
|
1085
|
+
# Proceed with parsing using the (potentially) patched xml_string
|
|
1077
1086
|
xml_el = defusedxml.ElementTree.fromstring(xml_string)
|
|
1078
1087
|
return from_xml_el(xml_el, strict)
|
|
1079
1088
|
|
|
1080
1089
|
|
|
1081
|
-
def from_xml_el(
|
|
1082
|
-
xml_el: ET.Element, strict: bool = True
|
|
1083
|
-
) -> List[Union[DidlObject, Descriptor]]:
|
|
1090
|
+
def from_xml_el(xml_el: ET.Element, strict: bool = True) -> List[Union[DidlObject, Descriptor]]:
|
|
1084
1091
|
"""Convert XML Element to DIDL Objects."""
|
|
1085
1092
|
didl_objects = [] # type: List[Union[DidlObject, Descriptor]]
|
|
1086
1093
|
|
|
1087
1094
|
# items and containers, in order
|
|
1088
1095
|
for child_el in xml_el:
|
|
1089
|
-
if child_el.tag != expand_namespace_tag(
|
|
1090
|
-
"didl_lite:
|
|
1091
|
-
)
|
|
1096
|
+
if child_el.tag != expand_namespace_tag("didl_lite:item") and child_el.tag != expand_namespace_tag(
|
|
1097
|
+
"didl_lite:container"
|
|
1098
|
+
):
|
|
1092
1099
|
continue
|
|
1093
1100
|
|
|
1094
1101
|
# construct item
|
|
@@ -1118,9 +1125,7 @@ def from_xml_el(
|
|
|
1118
1125
|
|
|
1119
1126
|
|
|
1120
1127
|
# upnp_class to python type mapping
|
|
1121
|
-
def type_by_upnp_class(
|
|
1122
|
-
upnp_class: str, strict: bool = True
|
|
1123
|
-
) -> Optional[Type[DidlObject]]:
|
|
1128
|
+
def type_by_upnp_class(upnp_class: str, strict: bool = True) -> Optional[Type[DidlObject]]:
|
|
1124
1129
|
"""Get DidlObject-type by upnp_class.
|
|
1125
1130
|
|
|
1126
1131
|
When strict is False, the upnp_class lookup will be done ignoring string
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "setuptools.build_meta"
|
|
3
|
+
requires = ["setuptools>=77.0"]
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "python-didl-lite"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
license-files = ["LICENSE.txt"]
|
|
9
|
+
description = "DIDL-Lite (Digital Item Declaration Language) tools for Python"
|
|
10
|
+
readme = "README.rst"
|
|
11
|
+
authors = [{ name = "Steven Looman", email = "steven.looman@gmail.com" }]
|
|
12
|
+
keywords = [
|
|
13
|
+
"DIDL",
|
|
14
|
+
"DIDL-lite"
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
]
|
|
26
|
+
requires-python = ">=3.10"
|
|
27
|
+
dependencies = [
|
|
28
|
+
"defusedxml>=0.6.0",
|
|
29
|
+
]
|
|
30
|
+
dynamic = ["version"]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
"GitHub: repo" = "https://github.com/StevenLooman/python-didl-lite"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
test = [
|
|
37
|
+
"pytest==9.1.1",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[tool.setuptools]
|
|
41
|
+
packages = ["didl_lite"]
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.dynamic]
|
|
44
|
+
version = { attr = "didl_lite.__version__" }
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.package-data]
|
|
47
|
+
didl_lite = ["py.typed"]
|
|
48
|
+
|
|
49
|
+
[tool.mypy]
|
|
50
|
+
check_untyped_defs = true
|
|
51
|
+
disallow_untyped_calls = true
|
|
52
|
+
disallow_untyped_defs = true
|
|
53
|
+
disallow_incomplete_defs = true
|
|
54
|
+
disallow_untyped_decorators = true
|
|
55
|
+
no_implicit_optional = true
|
|
56
|
+
warn_incomplete_stub = true
|
|
57
|
+
warn_redundant_casts = true
|
|
58
|
+
warn_return_any = true
|
|
59
|
+
warn_unused_configs = true
|
|
60
|
+
warn_unused_ignores = true
|
|
61
|
+
|
|
62
|
+
[tool.ruff]
|
|
63
|
+
line-length = 119
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["C901", "D", "E", "F", "I", "W"]
|
|
67
|
+
ignore = ["D202"]
|
|
68
|
+
|
|
69
|
+
[tool.ruff.lint.mccabe]
|
|
70
|
+
max-complexity = 25
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint.pydocstyle]
|
|
73
|
+
convention = "pep257"
|
|
74
|
+
|
|
75
|
+
[tool.ruff.lint.isort]
|
|
76
|
+
known-first-party = ["didl_lite"]
|
|
77
|
+
|
|
78
|
+
[tool.deptry]
|
|
79
|
+
package_module_name_map = { "pytest" = "pytest" }
|
|
80
|
+
|
|
81
|
+
[tool.deptry.per_rule_ignores]
|
|
82
|
+
DEP002 = ["pytest"]
|
|
83
|
+
|
|
84
|
+
[tool.pylint.format]
|
|
85
|
+
max-line-length = 119
|
|
86
|
+
|
|
87
|
+
[tool.pylint.basic]
|
|
88
|
+
good-names = ["otherItem", "storageMedium"]
|
|
89
|
+
|
|
90
|
+
[tool.codespell]
|
|
91
|
+
ignore-words-list = "wan"
|
|
92
|
+
|
|
93
|
+
[tool.coverage.run]
|
|
94
|
+
source = ["didl_lite"]
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-didl-lite
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.1
|
|
4
4
|
Summary: DIDL-Lite (Digital Item Declaration Language) tools for Python
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Author-email: Steven Looman <steven.looman@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: GitHub: repo, https://github.com/StevenLooman/python-didl-lite
|
|
8
|
+
Keywords: DIDL,DIDL-lite
|
|
8
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: >=3.10
|
|
19
18
|
Description-Content-Type: text/x-rst
|
|
20
|
-
License-File: LICENSE.md
|
|
21
19
|
Requires-Dist: defusedxml>=0.6.0
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Requires-Dist: pytest==9.1.1; extra == "test"
|
|
22
22
|
|
|
23
23
|
DIDL-Lite (Digital Item Declaration Language) tools for Python
|
|
24
24
|
==============================================================
|
|
@@ -42,3 +42,16 @@ DIDL-Lite resources and documents:
|
|
|
42
42
|
* `UPnP-av-ContentDirectory-v2-Service <http://upnp.org/specs/av/UPnP-av-ContentDirectory-v2-Service.pdf>`_
|
|
43
43
|
* `didl-lite-v2.xsd <http://www.upnp.org/schemas/av/didl-lite-v2.xsd>`_
|
|
44
44
|
* `mpeg21-didl <http://xml.coverpages.org/mpeg21-didl.html>`_
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Releasing
|
|
48
|
+
---------
|
|
49
|
+
|
|
50
|
+
Steps for releasing:
|
|
51
|
+
|
|
52
|
+
- Switch to master: ``git checkout master``
|
|
53
|
+
- Do a pull: ``git pull``
|
|
54
|
+
- Run towncrier: ``towncrier build --version <version>``
|
|
55
|
+
- Commit towncrier results: ``git commit -m "Towncrier"``
|
|
56
|
+
- Run bump2version (note that this creates a new commit + tag): ``bump2version --tag major/minor/patch``
|
|
57
|
+
- Push to github: ``git push && git push --tags``
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[bumpversion]
|
|
2
|
+
current_version = 1.5.1
|
|
3
|
+
commit = True
|
|
4
|
+
tag = False
|
|
5
|
+
tag_name = {new_version}
|
|
6
|
+
|
|
7
|
+
[bumpversion:file:didl_lite/__init__.py]
|
|
8
|
+
search = __version__ = "{current_version}"
|
|
9
|
+
replace = __version__ = "{new_version}"
|
|
10
|
+
|
|
11
|
+
[egg_info]
|
|
12
|
+
tag_build =
|
|
13
|
+
tag_date = 0
|
|
14
|
+
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""Unit tests for didl_lite."""
|
|
3
2
|
|
|
4
3
|
import pytest
|
|
@@ -234,9 +233,7 @@ class TestDidlLite:
|
|
|
234
233
|
|
|
235
234
|
def test_container_to_xml(self) -> None:
|
|
236
235
|
"""Test container to XML."""
|
|
237
|
-
container = didl_lite.Album(
|
|
238
|
-
id="0", parent_id="0", title="Audio Item Title", restricted="1"
|
|
239
|
-
)
|
|
236
|
+
container = didl_lite.Album(id="0", parent_id="0", title="Audio Item Title", restricted="1")
|
|
240
237
|
resource = didl_lite.Resource("url", "protocol_info")
|
|
241
238
|
item = didl_lite.AudioItem(
|
|
242
239
|
id="0",
|
|
@@ -285,9 +282,7 @@ class TestDidlLite:
|
|
|
285
282
|
# pylint: disable=import-outside-toplevel
|
|
286
283
|
from didl_lite.didl_lite import Album, AudioItem, Resource
|
|
287
284
|
|
|
288
|
-
container = Album(
|
|
289
|
-
id="0", parent_id="0", title="Audio Item Title", restricted="1"
|
|
290
|
-
)
|
|
285
|
+
container = Album(id="0", parent_id="0", title="Audio Item Title", restricted="1")
|
|
291
286
|
resource = Resource("url", "protocol_info")
|
|
292
287
|
item = AudioItem(
|
|
293
288
|
id="0",
|
|
@@ -427,9 +422,7 @@ class TestDidlLite:
|
|
|
427
422
|
|
|
428
423
|
def test_descriptor_to_xml(self) -> None:
|
|
429
424
|
"""Test descriptor to XML."""
|
|
430
|
-
descriptor = didl_lite.Descriptor(
|
|
431
|
-
id="1", name_space="ns", type="type", text="Text"
|
|
432
|
-
)
|
|
425
|
+
descriptor = didl_lite.Descriptor(id="1", name_space="ns", type="type", text="Text")
|
|
433
426
|
item = didl_lite.AudioItem(
|
|
434
427
|
id="0",
|
|
435
428
|
parent_id="0",
|
|
@@ -468,9 +461,7 @@ class TestDidlLite:
|
|
|
468
461
|
|
|
469
462
|
descriptor_repr = repr(descriptor)
|
|
470
463
|
descriptor_remade = eval(descriptor_repr) # pylint: disable=eval-used
|
|
471
|
-
assert ET.tostring(descriptor.to_xml()) == ET.tostring(
|
|
472
|
-
descriptor_remade.to_xml()
|
|
473
|
-
)
|
|
464
|
+
assert ET.tostring(descriptor.to_xml()) == ET.tostring(descriptor_remade.to_xml())
|
|
474
465
|
|
|
475
466
|
def test_item_order(self) -> None:
|
|
476
467
|
"""Test item ordering."""
|
|
@@ -608,9 +599,7 @@ class TestDidlLite:
|
|
|
608
599
|
|
|
609
600
|
def test_default_properties_set(self) -> None:
|
|
610
601
|
"""Test defaults for item properties."""
|
|
611
|
-
item = didl_lite.VideoItem(
|
|
612
|
-
id="0", parent_id="0", title="Video Item Title", restricted="1"
|
|
613
|
-
)
|
|
602
|
+
item = didl_lite.VideoItem(id="0", parent_id="0", title="Video Item Title", restricted="1")
|
|
614
603
|
assert hasattr(item, "genre_type") # property is set
|
|
615
604
|
|
|
616
605
|
def test_property_case(self) -> None:
|
|
@@ -680,3 +669,127 @@ class TestDidlLite:
|
|
|
680
669
|
|
|
681
670
|
item = items[0]
|
|
682
671
|
assert isinstance(item, didl_lite.MusicTrack)
|
|
672
|
+
|
|
673
|
+
def test_from_xml_string_unbound_prefix(self) -> None:
|
|
674
|
+
"""Test from_xml_string with unbound namespace prefix."""
|
|
675
|
+
# The key fix is adding: xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
|
|
676
|
+
broken_xml = (
|
|
677
|
+
'<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" '
|
|
678
|
+
'xmlns:dc="http://purl.org/dc/elements/1.1/" '
|
|
679
|
+
'xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" '
|
|
680
|
+
'xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">'
|
|
681
|
+
'<item id="1" parentID="0" restricted="1">'
|
|
682
|
+
"<dc:title>Test Title</dc:title>"
|
|
683
|
+
"<song:subTitle>Test Subtitle</song:subTitle>"
|
|
684
|
+
"<upnp:class>object.item.audioItem.musicTrack</upnp:class>"
|
|
685
|
+
"</item>"
|
|
686
|
+
"</DIDL-Lite>"
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
# This call should not throw ParseError when strict=False.
|
|
690
|
+
objs = didl_lite.from_xml_string(broken_xml, strict=False)
|
|
691
|
+
|
|
692
|
+
assert len(objs) == 1
|
|
693
|
+
assert objs[0].title == "Test Title"
|
|
694
|
+
# Check that the temporary namespace is correctly assigned.
|
|
695
|
+
assert "sub_title" in objs[0].__dict__
|
|
696
|
+
assert objs[0].sub_title == "Test Subtitle"
|
|
697
|
+
assert isinstance(objs[0], didl_lite.MusicTrack)
|
|
698
|
+
|
|
699
|
+
def test_from_xml_string_unbound_prefix_without_dlna_namespace(self) -> None:
|
|
700
|
+
"""Test unbound prefix recovery when xmlns:dlna is absent.
|
|
701
|
+
|
|
702
|
+
Regression: the previous implementation anchored the namespace
|
|
703
|
+
injection on an existing `xmlns:dlna` declaration. Devices such as
|
|
704
|
+
JBL Authentics and WiiM/LinkPlay players emit `<song:*>` tags
|
|
705
|
+
without declaring `xmlns:dlna`, leaving the unbound prefix in place
|
|
706
|
+
and breaking parsing even with strict=False.
|
|
707
|
+
"""
|
|
708
|
+
broken_xml = (
|
|
709
|
+
'<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" '
|
|
710
|
+
'xmlns:dc="http://purl.org/dc/elements/1.1/" '
|
|
711
|
+
'xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">'
|
|
712
|
+
'<item id="1" parentID="0" restricted="1">'
|
|
713
|
+
"<dc:title>Test Title</dc:title>"
|
|
714
|
+
"<song:subTitle>Test Subtitle</song:subTitle>"
|
|
715
|
+
"<upnp:class>object.item.audioItem.musicTrack</upnp:class>"
|
|
716
|
+
"</item>"
|
|
717
|
+
"</DIDL-Lite>"
|
|
718
|
+
)
|
|
719
|
+
|
|
720
|
+
objs = didl_lite.from_xml_string(broken_xml, strict=False)
|
|
721
|
+
|
|
722
|
+
assert len(objs) == 1
|
|
723
|
+
assert objs[0].title == "Test Title"
|
|
724
|
+
assert "sub_title" in objs[0].__dict__
|
|
725
|
+
assert objs[0].sub_title == "Test Subtitle"
|
|
726
|
+
assert isinstance(objs[0], didl_lite.MusicTrack)
|
|
727
|
+
|
|
728
|
+
def test_from_xml_string_unbound_prefix_with_prefixed_root(self) -> None:
|
|
729
|
+
"""Test unbound prefix recovery when the root element carries a prefix.
|
|
730
|
+
|
|
731
|
+
The DIDL-Lite root may be written as `<didl:DIDL-Lite>` rather than
|
|
732
|
+
`<DIDL-Lite>`. The namespace injection has to recognise that form and
|
|
733
|
+
write the matched name back unchanged, otherwise the opening tag no
|
|
734
|
+
longer matches its closing tag.
|
|
735
|
+
"""
|
|
736
|
+
broken_xml = (
|
|
737
|
+
'<didl:DIDL-Lite xmlns:didl="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" '
|
|
738
|
+
'xmlns:dc="http://purl.org/dc/elements/1.1/" '
|
|
739
|
+
'xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">'
|
|
740
|
+
'<didl:item id="1" parentID="0" restricted="1">'
|
|
741
|
+
"<dc:title>Test Title</dc:title>"
|
|
742
|
+
"<song:subTitle>Test Subtitle</song:subTitle>"
|
|
743
|
+
"<upnp:class>object.item.audioItem.musicTrack</upnp:class>"
|
|
744
|
+
"</didl:item>"
|
|
745
|
+
"</didl:DIDL-Lite>"
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
objs = didl_lite.from_xml_string(broken_xml, strict=False)
|
|
749
|
+
|
|
750
|
+
assert len(objs) == 1
|
|
751
|
+
assert objs[0].title == "Test Title"
|
|
752
|
+
assert objs[0].sub_title == "Test Subtitle"
|
|
753
|
+
assert isinstance(objs[0], didl_lite.MusicTrack)
|
|
754
|
+
|
|
755
|
+
def test_from_xml_string_unbound_prefix_with_ncname_characters(self) -> None:
|
|
756
|
+
"""Test unbound prefix recovery for prefixes holding '-', '.' or '_'.
|
|
757
|
+
|
|
758
|
+
An XML namespace prefix is an NCName, so it may contain a hyphen, a
|
|
759
|
+
period or an underscore after its first character. Recovery has to
|
|
760
|
+
detect those prefixes as well, not only alphanumeric ones.
|
|
761
|
+
"""
|
|
762
|
+
for prefix in ("my-song", "my.song", "my_song"):
|
|
763
|
+
broken_xml = (
|
|
764
|
+
'<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" '
|
|
765
|
+
'xmlns:dc="http://purl.org/dc/elements/1.1/" '
|
|
766
|
+
'xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">'
|
|
767
|
+
'<item id="1" parentID="0" restricted="1">'
|
|
768
|
+
"<dc:title>Test Title</dc:title>"
|
|
769
|
+
f"<{prefix}:subTitle>Test Subtitle</{prefix}:subTitle>"
|
|
770
|
+
"<upnp:class>object.item.audioItem.musicTrack</upnp:class>"
|
|
771
|
+
"</item>"
|
|
772
|
+
"</DIDL-Lite>"
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
objs = didl_lite.from_xml_string(broken_xml, strict=False)
|
|
776
|
+
|
|
777
|
+
assert len(objs) == 1, f"prefix {prefix} was not recovered"
|
|
778
|
+
assert objs[0].title == "Test Title"
|
|
779
|
+
assert isinstance(objs[0], didl_lite.MusicTrack)
|
|
780
|
+
|
|
781
|
+
def test_music_track_artist_and_genre(self) -> None:
|
|
782
|
+
"""Test MusicTrack artist and genre properties."""
|
|
783
|
+
track = didl_lite.MusicTrack(
|
|
784
|
+
id="1",
|
|
785
|
+
parent_id="0",
|
|
786
|
+
title="Test",
|
|
787
|
+
restricted="0",
|
|
788
|
+
artist="My Artist",
|
|
789
|
+
genre="My Genre",
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
xml = didl_lite.to_xml_string(track)
|
|
793
|
+
|
|
794
|
+
assert b"<upnp:artist>My Artist</upnp:artist>" in xml
|
|
795
|
+
assert b"<upnp:genre>My Genre</upnp:genre>" in xml
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
==============
|
|
3
|
-
|
|
4
|
-
_Version 2.0, January 2004_
|
|
5
|
-
_<<http://www.apache.org/licenses/>>_
|
|
6
|
-
|
|
7
|
-
### Terms and Conditions for use, reproduction, and distribution
|
|
8
|
-
|
|
9
|
-
#### 1. Definitions
|
|
10
|
-
|
|
11
|
-
“License” shall mean the terms and conditions for use, reproduction, and
|
|
12
|
-
distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
-
|
|
14
|
-
“Licensor” shall mean the copyright owner or entity authorized by the copyright
|
|
15
|
-
owner that is granting the License.
|
|
16
|
-
|
|
17
|
-
“Legal Entity” shall mean the union of the acting entity and all other entities
|
|
18
|
-
that control, are controlled by, or are under common control with that entity.
|
|
19
|
-
For the purposes of this definition, “control” means **(i)** the power, direct or
|
|
20
|
-
indirect, to cause the direction or management of such entity, whether by
|
|
21
|
-
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or **(iii)** beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
“You” (or “Your”) shall mean an individual or Legal Entity exercising
|
|
25
|
-
permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
“Source” form shall mean the preferred form for making modifications, including
|
|
28
|
-
but not limited to software source code, documentation source, and configuration
|
|
29
|
-
files.
|
|
30
|
-
|
|
31
|
-
“Object” form shall mean any form resulting from mechanical transformation or
|
|
32
|
-
translation of a Source form, including but not limited to compiled object code,
|
|
33
|
-
generated documentation, and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
“Work” shall mean the work of authorship, whether in Source or Object form, made
|
|
36
|
-
available under the License, as indicated by a copyright notice that is included
|
|
37
|
-
in or attached to the work (an example is provided in the Appendix below).
|
|
38
|
-
|
|
39
|
-
“Derivative Works” shall mean any work, whether in Source or Object form, that
|
|
40
|
-
is based on (or derived from) the Work and for which the editorial revisions,
|
|
41
|
-
annotations, elaborations, or other modifications represent, as a whole, an
|
|
42
|
-
original work of authorship. For the purposes of this License, Derivative Works
|
|
43
|
-
shall not include works that remain separable from, or merely link (or bind by
|
|
44
|
-
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
45
|
-
|
|
46
|
-
“Contribution” shall mean any work of authorship, including the original version
|
|
47
|
-
of the Work and any modifications or additions to that Work or Derivative Works
|
|
48
|
-
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
49
|
-
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
50
|
-
on behalf of the copyright owner. For the purposes of this definition,
|
|
51
|
-
“submitted” means any form of electronic, verbal, or written communication sent
|
|
52
|
-
to the Licensor or its representatives, including but not limited to
|
|
53
|
-
communication on electronic mailing lists, source code control systems, and
|
|
54
|
-
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
55
|
-
the purpose of discussing and improving the Work, but excluding communication
|
|
56
|
-
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
57
|
-
owner as “Not a Contribution.”
|
|
58
|
-
|
|
59
|
-
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
|
|
60
|
-
of whom a Contribution has been received by Licensor and subsequently
|
|
61
|
-
incorporated within the Work.
|
|
62
|
-
|
|
63
|
-
#### 2. Grant of Copyright License
|
|
64
|
-
|
|
65
|
-
Subject to the terms and conditions of this License, each Contributor hereby
|
|
66
|
-
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
67
|
-
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
|
68
|
-
publicly display, publicly perform, sublicense, and distribute the Work and such
|
|
69
|
-
Derivative Works in Source or Object form.
|
|
70
|
-
|
|
71
|
-
#### 3. Grant of Patent License
|
|
72
|
-
|
|
73
|
-
Subject to the terms and conditions of this License, each Contributor hereby
|
|
74
|
-
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
75
|
-
irrevocable (except as stated in this section) patent license to make, have
|
|
76
|
-
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
|
77
|
-
such license applies only to those patent claims licensable by such Contributor
|
|
78
|
-
that are necessarily infringed by their Contribution(s) alone or by combination
|
|
79
|
-
of their Contribution(s) with the Work to which such Contribution(s) was
|
|
80
|
-
submitted. If You institute patent litigation against any entity (including a
|
|
81
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
|
82
|
-
Contribution incorporated within the Work constitutes direct or contributory
|
|
83
|
-
patent infringement, then any patent licenses granted to You under this License
|
|
84
|
-
for that Work shall terminate as of the date such litigation is filed.
|
|
85
|
-
|
|
86
|
-
#### 4. Redistribution
|
|
87
|
-
|
|
88
|
-
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
|
89
|
-
in any medium, with or without modifications, and in Source or Object form,
|
|
90
|
-
provided that You meet the following conditions:
|
|
91
|
-
|
|
92
|
-
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
|
|
93
|
-
this License; and
|
|
94
|
-
* **(b)** You must cause any modified files to carry prominent notices stating that You
|
|
95
|
-
changed the files; and
|
|
96
|
-
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
|
|
97
|
-
all copyright, patent, trademark, and attribution notices from the Source form
|
|
98
|
-
of the Work, excluding those notices that do not pertain to any part of the
|
|
99
|
-
Derivative Works; and
|
|
100
|
-
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
|
|
101
|
-
Derivative Works that You distribute must include a readable copy of the
|
|
102
|
-
attribution notices contained within such NOTICE file, excluding those notices
|
|
103
|
-
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
104
|
-
following places: within a NOTICE text file distributed as part of the
|
|
105
|
-
Derivative Works; within the Source form or documentation, if provided along
|
|
106
|
-
with the Derivative Works; or, within a display generated by the Derivative
|
|
107
|
-
Works, if and wherever such third-party notices normally appear. The contents of
|
|
108
|
-
the NOTICE file are for informational purposes only and do not modify the
|
|
109
|
-
License. You may add Your own attribution notices within Derivative Works that
|
|
110
|
-
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
111
|
-
provided that such additional attribution notices cannot be construed as
|
|
112
|
-
modifying the License.
|
|
113
|
-
|
|
114
|
-
You may add Your own copyright statement to Your modifications and may provide
|
|
115
|
-
additional or different license terms and conditions for use, reproduction, or
|
|
116
|
-
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
117
|
-
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
118
|
-
with the conditions stated in this License.
|
|
119
|
-
|
|
120
|
-
#### 5. Submission of Contributions
|
|
121
|
-
|
|
122
|
-
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
|
123
|
-
for inclusion in the Work by You to the Licensor shall be under the terms and
|
|
124
|
-
conditions of this License, without any additional terms or conditions.
|
|
125
|
-
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
|
126
|
-
any separate license agreement you may have executed with Licensor regarding
|
|
127
|
-
such Contributions.
|
|
128
|
-
|
|
129
|
-
#### 6. Trademarks
|
|
130
|
-
|
|
131
|
-
This License does not grant permission to use the trade names, trademarks,
|
|
132
|
-
service marks, or product names of the Licensor, except as required for
|
|
133
|
-
reasonable and customary use in describing the origin of the Work and
|
|
134
|
-
reproducing the content of the NOTICE file.
|
|
135
|
-
|
|
136
|
-
#### 7. Disclaimer of Warranty
|
|
137
|
-
|
|
138
|
-
Unless required by applicable law or agreed to in writing, Licensor provides the
|
|
139
|
-
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
|
|
140
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
|
141
|
-
including, without limitation, any warranties or conditions of TITLE,
|
|
142
|
-
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
|
143
|
-
solely responsible for determining the appropriateness of using or
|
|
144
|
-
redistributing the Work and assume any risks associated with Your exercise of
|
|
145
|
-
permissions under this License.
|
|
146
|
-
|
|
147
|
-
#### 8. Limitation of Liability
|
|
148
|
-
|
|
149
|
-
In no event and under no legal theory, whether in tort (including negligence),
|
|
150
|
-
contract, or otherwise, unless required by applicable law (such as deliberate
|
|
151
|
-
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
|
152
|
-
liable to You for damages, including any direct, indirect, special, incidental,
|
|
153
|
-
or consequential damages of any character arising as a result of this License or
|
|
154
|
-
out of the use or inability to use the Work (including but not limited to
|
|
155
|
-
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
|
156
|
-
any and all other commercial damages or losses), even if such Contributor has
|
|
157
|
-
been advised of the possibility of such damages.
|
|
158
|
-
|
|
159
|
-
#### 9. Accepting Warranty or Additional Liability
|
|
160
|
-
|
|
161
|
-
While redistributing the Work or Derivative Works thereof, You may choose to
|
|
162
|
-
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
|
163
|
-
other liability obligations and/or rights consistent with this License. However,
|
|
164
|
-
in accepting such obligations, You may act only on Your own behalf and on Your
|
|
165
|
-
sole responsibility, not on behalf of any other Contributor, and only if You
|
|
166
|
-
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
|
167
|
-
incurred by, or claims asserted against, such Contributor by reason of your
|
|
168
|
-
accepting any such warranty or additional liability.
|
|
169
|
-
|
|
170
|
-
_END OF TERMS AND CONDITIONS_
|
|
171
|
-
|
|
172
|
-
### APPENDIX: How to apply the Apache License to your work
|
|
173
|
-
|
|
174
|
-
To apply the Apache License to your work, attach the following boilerplate
|
|
175
|
-
notice, with the fields enclosed by brackets `[]` replaced with your own
|
|
176
|
-
identifying information. (Don't include the brackets!) The text should be
|
|
177
|
-
enclosed in the appropriate comment syntax for the file format. We also
|
|
178
|
-
recommend that a file or class name and description of purpose be included on
|
|
179
|
-
the same “printed page” as the copyright notice for easier identification within
|
|
180
|
-
third-party archives.
|
|
181
|
-
|
|
182
|
-
Copyright [yyyy] [name of copyright owner]
|
|
183
|
-
|
|
184
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
185
|
-
you may not use this file except in compliance with the License.
|
|
186
|
-
You may obtain a copy of the License at
|
|
187
|
-
|
|
188
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
189
|
-
|
|
190
|
-
Unless required by applicable law or agreed to in writing, software
|
|
191
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
192
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
193
|
-
See the License for the specific language governing permissions and
|
|
194
|
-
limitations under the License.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
defusedxml>=0.6.0
|
python_didl_lite-1.4.1/setup.cfg
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[bdist_wheel]
|
|
2
|
-
python-tag = py3
|
|
3
|
-
|
|
4
|
-
[metadata]
|
|
5
|
-
license_file = LICENSE.md
|
|
6
|
-
|
|
7
|
-
[flake8]
|
|
8
|
-
max-line-length = 99
|
|
9
|
-
|
|
10
|
-
[mypy]
|
|
11
|
-
check_untyped_defs = true
|
|
12
|
-
disallow_untyped_calls = true
|
|
13
|
-
disallow_untyped_defs = true
|
|
14
|
-
disallow_incomplete_defs = true
|
|
15
|
-
disallow_untyped_decorators = true
|
|
16
|
-
no_implicit_optional = true
|
|
17
|
-
warn_incomplete_stub = true
|
|
18
|
-
warn_redundant_casts = true
|
|
19
|
-
warn_return_any = true
|
|
20
|
-
warn_unused_configs = true
|
|
21
|
-
warn_unused_ignores = true
|
|
22
|
-
|
|
23
|
-
[egg_info]
|
|
24
|
-
tag_build =
|
|
25
|
-
tag_date = 0
|
|
26
|
-
|
python_didl_lite-1.4.1/setup.py
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"""Setup."""
|
|
2
|
-
|
|
3
|
-
import os.path
|
|
4
|
-
|
|
5
|
-
from setuptools import setup
|
|
6
|
-
|
|
7
|
-
here = os.path.abspath(os.path.dirname(__file__))
|
|
8
|
-
with open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
|
|
9
|
-
LONG_DESCRIPTION = f.read()
|
|
10
|
-
with open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
|
|
11
|
-
DESCRIPTION = f.readline().strip()
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
INSTALL_REQUIRES = [
|
|
15
|
-
"defusedxml>=0.6.0",
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
TEST_REQUIRES = [
|
|
20
|
-
"pytest~=7.4.3",
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setup(
|
|
25
|
-
name="python-didl-lite",
|
|
26
|
-
version="1.4.1",
|
|
27
|
-
description=DESCRIPTION,
|
|
28
|
-
long_description=LONG_DESCRIPTION,
|
|
29
|
-
long_description_content_type="text/x-rst",
|
|
30
|
-
url="https://github.com/StevenLooman/python-didl-lite",
|
|
31
|
-
author="Steven Looman",
|
|
32
|
-
author_email="steven.looman@gmail.com",
|
|
33
|
-
classifiers=[
|
|
34
|
-
"Development Status :: 5 - Production/Stable",
|
|
35
|
-
"Intended Audience :: Developers",
|
|
36
|
-
"License :: OSI Approved :: Apache Software License",
|
|
37
|
-
"Programming Language :: Python",
|
|
38
|
-
"Programming Language :: Python :: 3.8",
|
|
39
|
-
"Programming Language :: Python :: 3.9",
|
|
40
|
-
"Programming Language :: Python :: 3.10",
|
|
41
|
-
"Programming Language :: Python :: 3.11",
|
|
42
|
-
"Programming Language :: Python :: 3.12",
|
|
43
|
-
"Programming Language :: Python :: 3.13",
|
|
44
|
-
],
|
|
45
|
-
packages=["didl_lite"],
|
|
46
|
-
package_data={
|
|
47
|
-
"didl_lite": ["py.typed"],
|
|
48
|
-
},
|
|
49
|
-
python_requires=">=3.8",
|
|
50
|
-
install_requires=INSTALL_REQUIRES,
|
|
51
|
-
tests_require=TEST_REQUIRES,
|
|
52
|
-
)
|
|
File without changes
|
|
File without changes
|
{python_didl_lite-1.4.1 → python_didl_lite-1.5.1}/python_didl_lite.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|