forkparser 2026.1.0__py3-none-any.whl
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.
- feedparser/__init__.py +66 -0
- feedparser/api.py +376 -0
- feedparser/datetimes/__init__.py +73 -0
- feedparser/datetimes/asctime.py +80 -0
- feedparser/datetimes/greek.py +90 -0
- feedparser/datetimes/hungarian.py +66 -0
- feedparser/datetimes/iso8601.py +160 -0
- feedparser/datetimes/korean.py +94 -0
- feedparser/datetimes/perforce.py +63 -0
- feedparser/datetimes/rfc822.py +179 -0
- feedparser/datetimes/w3dtf.py +128 -0
- feedparser/encodings.py +649 -0
- feedparser/exceptions.py +55 -0
- feedparser/html.py +350 -0
- feedparser/http.py +74 -0
- feedparser/mixin.py +838 -0
- feedparser/namespaces/__init__.py +0 -0
- feedparser/namespaces/_base.py +547 -0
- feedparser/namespaces/admin.py +53 -0
- feedparser/namespaces/cc.py +70 -0
- feedparser/namespaces/dc.py +138 -0
- feedparser/namespaces/georss.py +682 -0
- feedparser/namespaces/itunes.py +113 -0
- feedparser/namespaces/mediarss.py +142 -0
- feedparser/namespaces/psc.py +74 -0
- feedparser/parsers/__init__.py +0 -0
- feedparser/parsers/json.py +135 -0
- feedparser/parsers/loose.py +75 -0
- feedparser/parsers/strict.py +141 -0
- feedparser/py.typed +0 -0
- feedparser/sanitizer.py +978 -0
- feedparser/sgml.py +98 -0
- feedparser/urls.py +233 -0
- feedparser/util.py +157 -0
- forkparser-2026.1.0.dist-info/METADATA +75 -0
- forkparser-2026.1.0.dist-info/RECORD +38 -0
- forkparser-2026.1.0.dist-info/WHEEL +4 -0
- forkparser-2026.1.0.dist-info/licenses/LICENSE +65 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Support for the Dublin Core metadata extensions
|
|
2
|
+
# Copyright 2010-2025 Kurt McKee <contactme@kurtmckee.org>
|
|
3
|
+
# Copyright 2002-2008 Mark Pilgrim
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
#
|
|
6
|
+
# This file is a part of feedparser.
|
|
7
|
+
#
|
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
|
10
|
+
#
|
|
11
|
+
# * Redistributions of source code must retain the above copyright notice,
|
|
12
|
+
# this list of conditions and the following disclaimer.
|
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
# and/or other materials provided with the distribution.
|
|
16
|
+
#
|
|
17
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
|
|
18
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
21
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
from ..datetimes import _parse_date
|
|
30
|
+
from ..util import FeedParserDict
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Namespace:
|
|
34
|
+
supported_namespaces = {
|
|
35
|
+
"http://purl.org/dc/elements/1.1/": "dc",
|
|
36
|
+
"http://purl.org/dc/terms/": "dcterms",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
def _end_dc_author(self):
|
|
40
|
+
self._end_author()
|
|
41
|
+
|
|
42
|
+
def _end_dc_creator(self):
|
|
43
|
+
self._end_author()
|
|
44
|
+
|
|
45
|
+
def _end_dc_date(self):
|
|
46
|
+
self._end_updated()
|
|
47
|
+
|
|
48
|
+
def _end_dc_description(self):
|
|
49
|
+
self._end_description()
|
|
50
|
+
|
|
51
|
+
def _end_dc_language(self):
|
|
52
|
+
self._end_language()
|
|
53
|
+
|
|
54
|
+
def _end_dc_publisher(self):
|
|
55
|
+
self._end_webmaster()
|
|
56
|
+
|
|
57
|
+
def _end_dc_rights(self):
|
|
58
|
+
self._end_rights()
|
|
59
|
+
|
|
60
|
+
def _end_dc_subject(self):
|
|
61
|
+
self._end_category()
|
|
62
|
+
|
|
63
|
+
def _end_dc_title(self):
|
|
64
|
+
self._end_title()
|
|
65
|
+
|
|
66
|
+
def _end_dcterms_created(self):
|
|
67
|
+
self._end_created()
|
|
68
|
+
|
|
69
|
+
def _end_dcterms_issued(self):
|
|
70
|
+
self._end_published()
|
|
71
|
+
|
|
72
|
+
def _end_dcterms_modified(self):
|
|
73
|
+
self._end_updated()
|
|
74
|
+
|
|
75
|
+
def _start_dc_author(self, attrs_d):
|
|
76
|
+
self._start_author(attrs_d)
|
|
77
|
+
|
|
78
|
+
def _start_dc_creator(self, attrs_d):
|
|
79
|
+
self._start_author(attrs_d)
|
|
80
|
+
|
|
81
|
+
def _start_dc_date(self, attrs_d):
|
|
82
|
+
self._start_updated(attrs_d)
|
|
83
|
+
|
|
84
|
+
def _start_dc_description(self, attrs_d):
|
|
85
|
+
self._start_description(attrs_d)
|
|
86
|
+
|
|
87
|
+
def _start_dc_language(self, attrs_d):
|
|
88
|
+
self._start_language(attrs_d)
|
|
89
|
+
|
|
90
|
+
def _start_dc_publisher(self, attrs_d):
|
|
91
|
+
self._start_webmaster(attrs_d)
|
|
92
|
+
|
|
93
|
+
def _start_dc_rights(self, attrs_d):
|
|
94
|
+
self._start_rights(attrs_d)
|
|
95
|
+
|
|
96
|
+
def _start_dc_subject(self, attrs_d):
|
|
97
|
+
self._start_category(attrs_d)
|
|
98
|
+
|
|
99
|
+
def _start_dc_title(self, attrs_d):
|
|
100
|
+
self._start_title(attrs_d)
|
|
101
|
+
|
|
102
|
+
def _start_dcterms_created(self, attrs_d):
|
|
103
|
+
self._start_created(attrs_d)
|
|
104
|
+
|
|
105
|
+
def _start_dcterms_issued(self, attrs_d):
|
|
106
|
+
self._start_published(attrs_d)
|
|
107
|
+
|
|
108
|
+
def _start_dcterms_modified(self, attrs_d):
|
|
109
|
+
self._start_updated(attrs_d)
|
|
110
|
+
|
|
111
|
+
def _start_dcterms_valid(self, attrs_d):
|
|
112
|
+
self.push("validity", 1)
|
|
113
|
+
|
|
114
|
+
def _end_dcterms_valid(self):
|
|
115
|
+
for validity_detail in self.pop("validity").split(";"):
|
|
116
|
+
if "=" in validity_detail:
|
|
117
|
+
key, value = validity_detail.split("=", 1)
|
|
118
|
+
if key == "start":
|
|
119
|
+
self._save("validity_start", value, overwrite=True)
|
|
120
|
+
self._save(
|
|
121
|
+
"validity_start_parsed", _parse_date(value), overwrite=True
|
|
122
|
+
)
|
|
123
|
+
elif key == "end":
|
|
124
|
+
self._save("validity_end", value, overwrite=True)
|
|
125
|
+
self._save(
|
|
126
|
+
"validity_end_parsed", _parse_date(value), overwrite=True
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
def _start_dc_contributor(self, attrs_d):
|
|
130
|
+
self.incontributor = 1
|
|
131
|
+
context = self._get_context()
|
|
132
|
+
context.setdefault("contributors", [])
|
|
133
|
+
context["contributors"].append(FeedParserDict())
|
|
134
|
+
self.push("name", 0)
|
|
135
|
+
|
|
136
|
+
def _end_dc_contributor(self):
|
|
137
|
+
self._end_name()
|
|
138
|
+
self.incontributor = 0
|