rapp 0.1.0__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.
- rapp-0.1.0/Cargo.lock +343 -0
- rapp-0.1.0/Cargo.toml +19 -0
- rapp-0.1.0/LICENSE +22 -0
- rapp-0.1.0/PKG-INFO +234 -0
- rapp-0.1.0/README.md +203 -0
- rapp-0.1.0/crates/rapp-core/Cargo.toml +17 -0
- rapp-0.1.0/crates/rapp-core/src/atom.rs +553 -0
- rapp-0.1.0/crates/rapp-core/src/date.rs +215 -0
- rapp-0.1.0/crates/rapp-core/src/error.rs +24 -0
- rapp-0.1.0/crates/rapp-core/src/json_feed.rs +135 -0
- rapp-0.1.0/crates/rapp-core/src/lib.rs +192 -0
- rapp-0.1.0/crates/rapp-core/src/model.rs +87 -0
- rapp-0.1.0/crates/rapp-core/src/preprocess.rs +339 -0
- rapp-0.1.0/crates/rapp-core/src/rdf.rs +271 -0
- rapp-0.1.0/crates/rapp-core/src/rss.rs +839 -0
- rapp-0.1.0/crates/rapp-core/src/xml_util.rs +41 -0
- rapp-0.1.0/crates/rapp-py/Cargo.toml +18 -0
- rapp-0.1.0/crates/rapp-py/src/lib.rs +294 -0
- rapp-0.1.0/pyproject.toml +53 -0
- rapp-0.1.0/src/rapp/__init__.py +16 -0
- rapp-0.1.0/src/rapp/_rapp.pyi +119 -0
- rapp-0.1.0/src/rapp/py.typed +0 -0
rapp-0.1.0/Cargo.lock
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 3
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "aho-corasick"
|
|
7
|
+
version = "1.1.4"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"memchr",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "autocfg"
|
|
16
|
+
version = "1.5.0"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "cfg-if"
|
|
22
|
+
version = "1.0.4"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "chrono"
|
|
28
|
+
version = "0.4.44"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"num-traits",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "crossbeam-deque"
|
|
37
|
+
version = "0.8.6"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"crossbeam-epoch",
|
|
42
|
+
"crossbeam-utils",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[[package]]
|
|
46
|
+
name = "crossbeam-epoch"
|
|
47
|
+
version = "0.9.18"
|
|
48
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
49
|
+
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
|
50
|
+
dependencies = [
|
|
51
|
+
"crossbeam-utils",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[[package]]
|
|
55
|
+
name = "crossbeam-utils"
|
|
56
|
+
version = "0.8.21"
|
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
58
|
+
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
59
|
+
|
|
60
|
+
[[package]]
|
|
61
|
+
name = "either"
|
|
62
|
+
version = "1.15.0"
|
|
63
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
64
|
+
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
|
65
|
+
|
|
66
|
+
[[package]]
|
|
67
|
+
name = "encoding_rs"
|
|
68
|
+
version = "0.8.35"
|
|
69
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
70
|
+
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
|
|
71
|
+
dependencies = [
|
|
72
|
+
"cfg-if",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[[package]]
|
|
76
|
+
name = "heck"
|
|
77
|
+
version = "0.5.0"
|
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
79
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
80
|
+
|
|
81
|
+
[[package]]
|
|
82
|
+
name = "itoa"
|
|
83
|
+
version = "1.0.18"
|
|
84
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
85
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
86
|
+
|
|
87
|
+
[[package]]
|
|
88
|
+
name = "libc"
|
|
89
|
+
version = "0.2.186"
|
|
90
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
91
|
+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
92
|
+
|
|
93
|
+
[[package]]
|
|
94
|
+
name = "memchr"
|
|
95
|
+
version = "2.8.0"
|
|
96
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
+
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "num-traits"
|
|
101
|
+
version = "0.2.19"
|
|
102
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
|
104
|
+
dependencies = [
|
|
105
|
+
"autocfg",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "once_cell"
|
|
110
|
+
version = "1.21.4"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "portable-atomic"
|
|
116
|
+
version = "1.13.1"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
119
|
+
|
|
120
|
+
[[package]]
|
|
121
|
+
name = "proc-macro2"
|
|
122
|
+
version = "1.0.106"
|
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
124
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
125
|
+
dependencies = [
|
|
126
|
+
"unicode-ident",
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
[[package]]
|
|
130
|
+
name = "pyo3"
|
|
131
|
+
version = "0.29.0"
|
|
132
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
133
|
+
checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
|
|
134
|
+
dependencies = [
|
|
135
|
+
"libc",
|
|
136
|
+
"once_cell",
|
|
137
|
+
"portable-atomic",
|
|
138
|
+
"pyo3-build-config",
|
|
139
|
+
"pyo3-ffi",
|
|
140
|
+
"pyo3-macros",
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "pyo3-build-config"
|
|
145
|
+
version = "0.29.0"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
|
|
148
|
+
dependencies = [
|
|
149
|
+
"target-lexicon",
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
[[package]]
|
|
153
|
+
name = "pyo3-ffi"
|
|
154
|
+
version = "0.29.0"
|
|
155
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
156
|
+
checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
|
|
157
|
+
dependencies = [
|
|
158
|
+
"libc",
|
|
159
|
+
"pyo3-build-config",
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
[[package]]
|
|
163
|
+
name = "pyo3-macros"
|
|
164
|
+
version = "0.29.0"
|
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
166
|
+
checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
|
|
167
|
+
dependencies = [
|
|
168
|
+
"proc-macro2",
|
|
169
|
+
"pyo3-macros-backend",
|
|
170
|
+
"quote",
|
|
171
|
+
"syn",
|
|
172
|
+
]
|
|
173
|
+
|
|
174
|
+
[[package]]
|
|
175
|
+
name = "pyo3-macros-backend"
|
|
176
|
+
version = "0.29.0"
|
|
177
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
178
|
+
checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
|
|
179
|
+
dependencies = [
|
|
180
|
+
"heck",
|
|
181
|
+
"proc-macro2",
|
|
182
|
+
"quote",
|
|
183
|
+
"syn",
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
[[package]]
|
|
187
|
+
name = "quick-xml"
|
|
188
|
+
version = "0.36.2"
|
|
189
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
190
|
+
checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
|
|
191
|
+
dependencies = [
|
|
192
|
+
"memchr",
|
|
193
|
+
]
|
|
194
|
+
|
|
195
|
+
[[package]]
|
|
196
|
+
name = "quote"
|
|
197
|
+
version = "1.0.45"
|
|
198
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
199
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
200
|
+
dependencies = [
|
|
201
|
+
"proc-macro2",
|
|
202
|
+
]
|
|
203
|
+
|
|
204
|
+
[[package]]
|
|
205
|
+
name = "rapp-core"
|
|
206
|
+
version = "0.1.0"
|
|
207
|
+
dependencies = [
|
|
208
|
+
"chrono",
|
|
209
|
+
"encoding_rs",
|
|
210
|
+
"once_cell",
|
|
211
|
+
"quick-xml",
|
|
212
|
+
"regex",
|
|
213
|
+
"serde_json",
|
|
214
|
+
]
|
|
215
|
+
|
|
216
|
+
[[package]]
|
|
217
|
+
name = "rapp-py"
|
|
218
|
+
version = "0.1.0"
|
|
219
|
+
dependencies = [
|
|
220
|
+
"pyo3",
|
|
221
|
+
"rapp-core",
|
|
222
|
+
"rayon",
|
|
223
|
+
]
|
|
224
|
+
|
|
225
|
+
[[package]]
|
|
226
|
+
name = "rayon"
|
|
227
|
+
version = "1.12.0"
|
|
228
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
229
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
230
|
+
dependencies = [
|
|
231
|
+
"either",
|
|
232
|
+
"rayon-core",
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
[[package]]
|
|
236
|
+
name = "rayon-core"
|
|
237
|
+
version = "1.13.0"
|
|
238
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
239
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
240
|
+
dependencies = [
|
|
241
|
+
"crossbeam-deque",
|
|
242
|
+
"crossbeam-utils",
|
|
243
|
+
]
|
|
244
|
+
|
|
245
|
+
[[package]]
|
|
246
|
+
name = "regex"
|
|
247
|
+
version = "1.12.3"
|
|
248
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
+
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
|
250
|
+
dependencies = [
|
|
251
|
+
"aho-corasick",
|
|
252
|
+
"memchr",
|
|
253
|
+
"regex-automata",
|
|
254
|
+
"regex-syntax",
|
|
255
|
+
]
|
|
256
|
+
|
|
257
|
+
[[package]]
|
|
258
|
+
name = "regex-automata"
|
|
259
|
+
version = "0.4.14"
|
|
260
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
+
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
|
262
|
+
dependencies = [
|
|
263
|
+
"aho-corasick",
|
|
264
|
+
"memchr",
|
|
265
|
+
"regex-syntax",
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
[[package]]
|
|
269
|
+
name = "regex-syntax"
|
|
270
|
+
version = "0.8.10"
|
|
271
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
272
|
+
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
273
|
+
|
|
274
|
+
[[package]]
|
|
275
|
+
name = "serde"
|
|
276
|
+
version = "1.0.228"
|
|
277
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
278
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
279
|
+
dependencies = [
|
|
280
|
+
"serde_core",
|
|
281
|
+
]
|
|
282
|
+
|
|
283
|
+
[[package]]
|
|
284
|
+
name = "serde_core"
|
|
285
|
+
version = "1.0.228"
|
|
286
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
287
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
288
|
+
dependencies = [
|
|
289
|
+
"serde_derive",
|
|
290
|
+
]
|
|
291
|
+
|
|
292
|
+
[[package]]
|
|
293
|
+
name = "serde_derive"
|
|
294
|
+
version = "1.0.228"
|
|
295
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
297
|
+
dependencies = [
|
|
298
|
+
"proc-macro2",
|
|
299
|
+
"quote",
|
|
300
|
+
"syn",
|
|
301
|
+
]
|
|
302
|
+
|
|
303
|
+
[[package]]
|
|
304
|
+
name = "serde_json"
|
|
305
|
+
version = "1.0.149"
|
|
306
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
307
|
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
|
308
|
+
dependencies = [
|
|
309
|
+
"itoa",
|
|
310
|
+
"memchr",
|
|
311
|
+
"serde",
|
|
312
|
+
"serde_core",
|
|
313
|
+
"zmij",
|
|
314
|
+
]
|
|
315
|
+
|
|
316
|
+
[[package]]
|
|
317
|
+
name = "syn"
|
|
318
|
+
version = "2.0.117"
|
|
319
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
320
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
321
|
+
dependencies = [
|
|
322
|
+
"proc-macro2",
|
|
323
|
+
"quote",
|
|
324
|
+
"unicode-ident",
|
|
325
|
+
]
|
|
326
|
+
|
|
327
|
+
[[package]]
|
|
328
|
+
name = "target-lexicon"
|
|
329
|
+
version = "0.13.5"
|
|
330
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
331
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
332
|
+
|
|
333
|
+
[[package]]
|
|
334
|
+
name = "unicode-ident"
|
|
335
|
+
version = "1.0.24"
|
|
336
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
337
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
338
|
+
|
|
339
|
+
[[package]]
|
|
340
|
+
name = "zmij"
|
|
341
|
+
version = "1.0.21"
|
|
342
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
343
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
rapp-0.1.0/Cargo.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
resolver = "2"
|
|
3
|
+
members = ["crates/rapp-core", "crates/rapp-py"]
|
|
4
|
+
|
|
5
|
+
[workspace.package]
|
|
6
|
+
version = "0.1.0"
|
|
7
|
+
edition = "2021"
|
|
8
|
+
rust-version = "1.74"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
repository = "https://github.com/u840903/rapp"
|
|
11
|
+
homepage = "https://github.com/u840903/rapp"
|
|
12
|
+
publish = false
|
|
13
|
+
|
|
14
|
+
[workspace.dependencies]
|
|
15
|
+
quick-xml = { version = "0.36", features = ["escape-html"] }
|
|
16
|
+
|
|
17
|
+
[profile.release]
|
|
18
|
+
lto = "fat"
|
|
19
|
+
codegen-units = 1
|
rapp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jan K. Griffioen-Järfalk
|
|
4
|
+
Copyright (c) 2024 Kagi Search
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
rapp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rapp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Rust
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Summary: Fast, forgiving RSS, Atom, RDF and JSON Feed parser for Python, written in Rust
|
|
21
|
+
Keywords: rss,atom,rdf,json-feed,feed,parser,podcast,rust
|
|
22
|
+
Author: Jan K. Griffioen-Järfalk
|
|
23
|
+
License: MIT
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
26
|
+
Project-URL: Changelog, https://github.com/u840903/rapp/blob/main/CHANGELOG.md
|
|
27
|
+
Project-URL: Homepage, https://github.com/u840903/rapp
|
|
28
|
+
Project-URL: Issues, https://github.com/u840903/rapp/issues
|
|
29
|
+
Project-URL: Repository, https://github.com/u840903/rapp
|
|
30
|
+
|
|
31
|
+
# rapp
|
|
32
|
+
|
|
33
|
+
[](https://github.com/u840903/rapp/actions/workflows/ci.yml)
|
|
34
|
+
[](LICENSE)
|
|
35
|
+
[](https://pypi.org/project/rapp/)
|
|
36
|
+
[](https://pypi.org/project/rapp/)
|
|
37
|
+
|
|
38
|
+
A fast, forgiving RSS, Atom, RDF and JSON Feed parser for Python, written in Rust.
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import rapp
|
|
42
|
+
|
|
43
|
+
feed = rapp.parse(data) # bytes in, Feed out
|
|
44
|
+
print(feed.title)
|
|
45
|
+
for entry in feed.entries:
|
|
46
|
+
print(entry.published, entry.title, entry.link)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- **Fast.** About 4,300 feeds a second on one core and 18,000 with
|
|
50
|
+
`parse_many`, 135 to 570 times faster than `feedparser`
|
|
51
|
+
([benchmark](#benchmark)).
|
|
52
|
+
- **Forgiving.** Real feeds are broken in all sorts of ways. rapp reads
|
|
53
|
+
truncated downloads, wrong encodings, HTML entities, unquoted attributes and
|
|
54
|
+
unclosed tags, and returns what it can instead of giving up
|
|
55
|
+
([details](#what-it-copes-with)).
|
|
56
|
+
- **Podcast-aware.** Enclosures, Media RSS and `itunes:image` /
|
|
57
|
+
`itunes:duration` come out as structured fields.
|
|
58
|
+
- **Typed.** Ships type stubs, including `TypedDict`s for `to_dict()`.
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install rapp
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Wheels cover Python 3.10 and later on Linux (x86_64 and ARM, glibc and musl),
|
|
67
|
+
macOS (Intel and Apple Silicon) and Windows. Anywhere else pip builds from
|
|
68
|
+
source, which needs a [Rust toolchain](https://rustup.rs).
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
rapp parses; it doesn't fetch. Download feeds with the HTTP client you
|
|
73
|
+
already use and pass the body as bytes:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import httpx
|
|
77
|
+
import rapp
|
|
78
|
+
|
|
79
|
+
data = httpx.get("https://example.com/feed.xml").content
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
feed = rapp.parse(data)
|
|
83
|
+
except rapp.FeedParseError as e: # an HTML page, a sitemap, empty input...
|
|
84
|
+
print("not a feed:", e)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Common fields are attributes. Everything, including authors, categories,
|
|
88
|
+
enclosures and media, is in `to_dict()`:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
feed.title, feed.link, feed.language, feed.updated
|
|
92
|
+
|
|
93
|
+
entry = feed.entries[0]
|
|
94
|
+
entry.title, entry.link, entry.published, entry.content
|
|
95
|
+
|
|
96
|
+
d = feed.to_dict() # {"feed": {...}, "entries": [{...}, ...]}
|
|
97
|
+
d["entries"][0]["enclosures"] # [{"url": ..., "length": ..., "type": ...}]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Many feeds at once
|
|
101
|
+
|
|
102
|
+
`parse_many` parses a batch across all cores, outside the GIL, and returns the
|
|
103
|
+
feeds in input order:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
feeds = rapp.parse_many(list_of_bytes)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
If any feed in the batch fails, `parse_many` raises `FeedParseError` and you
|
|
110
|
+
get no results for the rest. When a batch may contain non-feeds, call
|
|
111
|
+
`parse` per item instead, or split the batch.
|
|
112
|
+
|
|
113
|
+
## API
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
rapp.parse(data: bytes) -> rapp.Feed
|
|
117
|
+
rapp.parse_many(blobs: list[bytes]) -> list[rapp.Feed]
|
|
118
|
+
rapp.FeedParseError # the same class as ValueError
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
| `Feed` | `Entry` |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `title` | `title` |
|
|
124
|
+
| `link` | `link` |
|
|
125
|
+
| `description` | `description` |
|
|
126
|
+
| `language` | `content` |
|
|
127
|
+
| `generator` | `published` |
|
|
128
|
+
| `updated` | `updated` |
|
|
129
|
+
| `id` | `id` |
|
|
130
|
+
| `icon`, `logo` | |
|
|
131
|
+
| `entries` | |
|
|
132
|
+
| `to_dict()` | `to_dict()` |
|
|
133
|
+
|
|
134
|
+
Every attribute except `entries` is `str | None`. `Feed` and `Entry` are
|
|
135
|
+
read-only and safe to share between threads.
|
|
136
|
+
|
|
137
|
+
`to_dict()` adds the fields that have no attribute:
|
|
138
|
+
|
|
139
|
+
- **feed:** `links`, `image` (`url`, `title`, `link`, `width`, `height`),
|
|
140
|
+
`itunes_image`, `authors`, `categories`
|
|
141
|
+
- **entry:** `links`, `itunes_image`, `itunes_duration` (as written in the
|
|
142
|
+
feed), `authors`, `categories`, `enclosures`, `media`
|
|
143
|
+
|
|
144
|
+
Every key is always present: a missing value is `None` or an empty list. See
|
|
145
|
+
[`src/rapp/_rapp.pyi`](src/rapp/_rapp.pyi) for the full schema.
|
|
146
|
+
|
|
147
|
+
### Formats
|
|
148
|
+
|
|
149
|
+
- RSS 2.0, with the content, Dublin Core, Media RSS, iTunes and `atom:link`
|
|
150
|
+
extensions
|
|
151
|
+
- Atom 1.0, including `type="xhtml"` content
|
|
152
|
+
- RDF / RSS 1.0, with Dublin Core
|
|
153
|
+
- JSON Feed 1.0 and 1.1
|
|
154
|
+
|
|
155
|
+
The format is detected from the content, not from headers or file names.
|
|
156
|
+
|
|
157
|
+
### Output conventions
|
|
158
|
+
|
|
159
|
+
- Dates are UTC ISO 8601: `2006-01-02T13:04:05+00:00`. A date rapp can't
|
|
160
|
+
parse is passed through as written.
|
|
161
|
+
- HTML in descriptions and content is returned as it is, not sanitized.
|
|
162
|
+
Sanitize it before you render it.
|
|
163
|
+
|
|
164
|
+
## What it copes with
|
|
165
|
+
|
|
166
|
+
Each of these comes from a feed that broke a parser in production:
|
|
167
|
+
|
|
168
|
+
| The feed has | rapp |
|
|
169
|
+
|---|---|
|
|
170
|
+
| A download cut off mid-tag or mid-CDATA | Returns every entry that was complete |
|
|
171
|
+
| A UTF-16 BOM, a wrong encoding declaration, or invalid UTF-8 | Detects the encoding; invalid bytes become `�` |
|
|
172
|
+
| HTML entities such as ` ` or `’`, which XML doesn't define | Decodes them |
|
|
173
|
+
| Unescaped HTML (`<b>`, `<br>`) inside a description | Keeps it as markup |
|
|
174
|
+
| Unquoted attributes (`<link href=x>`) | Quotes them without touching text such as `E=mc2` |
|
|
175
|
+
| An unclosed tag inside Atom XHTML content | Keeps the entries that follow |
|
|
176
|
+
| A doubled `<?xml ?>` declaration | Repairs it |
|
|
177
|
+
| `24:00` as a time | Rolls over to `00:00` the next day |
|
|
178
|
+
| RDF's `<image>` beside `<channel>` | Reads it as the feed image |
|
|
179
|
+
|
|
180
|
+
## Benchmark
|
|
181
|
+
|
|
182
|
+
Parsing the bundled corpus of 200 real-world feeds (45 MB, 6,600 entries) on
|
|
183
|
+
an Apple M4 Pro (14 cores), Python 3.14.7, fastest of five runs:
|
|
184
|
+
|
|
185
|
+
| Parser | Time | Feeds/s | vs feedparser |
|
|
186
|
+
|---|---:|---:|---:|
|
|
187
|
+
| `rapp.parse` | 46 ms | 4,351 | 135× |
|
|
188
|
+
| `rapp.parse_many` | 11 ms | 18,304 | 568× |
|
|
189
|
+
| fastfeedparser 0.6.5 | 65 ms | 3,070 | 95× |
|
|
190
|
+
| feedparser 6.0.14 | 6,204 ms | 32 | 1× |
|
|
191
|
+
|
|
192
|
+
To run it yourself:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
pip install . feedparser fastfeedparser
|
|
196
|
+
python benchmark/benchmark.py
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Development
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cargo test # Rust tests
|
|
203
|
+
pip install -e . pytest # build the extension, then
|
|
204
|
+
pytest # Python tests
|
|
205
|
+
cargo fmt && cargo clippy # Rust style and lints
|
|
206
|
+
ruff check . && ruff format . # Python style and lints
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The Rust parser lives in `crates/rapp-core` and has no Python dependency.
|
|
210
|
+
`crates/rapp-py` holds the pyo3 bindings and `src/rapp` the Python package.
|
|
211
|
+
Snapshot tests compare every feed in `tests/feeds/` with the expected JSON
|
|
212
|
+
next to it; see [`tests/test_snapshots.py`](tests/test_snapshots.py) for how
|
|
213
|
+
to add one.
|
|
214
|
+
|
|
215
|
+
To release: bump `version` in `Cargo.toml` (the only place it lives), move
|
|
216
|
+
the changelog's "Unreleased" notes under the new version, merge, then publish
|
|
217
|
+
a GitHub release tagged `vX.Y.Z`. The release workflow builds the wheels, tests
|
|
218
|
+
them on every platform and uploads them to PyPI.
|
|
219
|
+
|
|
220
|
+
Bugs and ideas are welcome as [issues](https://github.com/u840903/rapp/issues).
|
|
221
|
+
A feed that rapp gets wrong is the most useful report there is. To report a
|
|
222
|
+
security issue, see [SECURITY.md](SECURITY.md).
|
|
223
|
+
|
|
224
|
+
## Background
|
|
225
|
+
|
|
226
|
+
rapp started as a fork of Kagi's
|
|
227
|
+
[fastfeedparser](https://github.com/kagisearch/fastfeedparser), took
|
|
228
|
+
inspiration from it, and became its own parser, written from scratch in Rust.
|
|
229
|
+
The test and benchmark feeds come from fastfeedparser.
|
|
230
|
+
|
|
231
|
+
## License
|
|
232
|
+
|
|
233
|
+
MIT. See [LICENSE](LICENSE).
|
|
234
|
+
|