selectolax 0.3.27__cp313-cp313-musllinux_1_2_i686.whl → 0.3.29__cp313-cp313-musllinux_1_2_i686.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.

Potentially problematic release.


This version of selectolax might be problematic. Click here for more details.

selectolax/parser.pyi CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Any, Iterator, TypeVar, Literal, overload
1
+ from typing import Iterator, TypeVar, Literal, overload
2
2
 
3
3
  DefaultT = TypeVar("DefaultT")
4
4
 
@@ -53,14 +53,14 @@ class Selector:
53
53
  ) -> bool:
54
54
  """Returns True if any node in the current search scope contains specified text"""
55
55
  ...
56
- def attribute_long_than(
56
+ def attribute_longer_than(
57
57
  self, text: str, length: int, start: str | None = None
58
58
  ) -> Selector:
59
59
  """Filter all current matches by attribute length.
60
60
 
61
61
  Similar to string-length in XPath."""
62
62
  ...
63
- def any_attribute_long_than(
63
+ def any_attribute_longer_than(
64
64
  self, text: str, length: int, start: str | None = None
65
65
  ) -> bool:
66
66
  """Returns True any href attribute longer than a specified length.
@@ -146,17 +146,13 @@ class Node:
146
146
  ...
147
147
  @overload
148
148
  def css_first(
149
- self, query: str, default: Any = ..., strict: Literal[True] = ...
150
- ) -> Node: ...
151
- @overload
152
- def css_first(
153
- self, query: str, default: DefaultT, strict: bool = False
154
- ) -> Node | DefaultT: ...
149
+ self, query: str, default: DefaultT, strict: bool = False
150
+ ) -> Node | DefaultT:
151
+ ...
155
152
  @overload
156
153
  def css_first(
157
- self, query: str, default: None = ..., strict: bool = False
158
- ) -> Node | None:
159
- """Evaluate CSS selector against current node and its child nodes."""
154
+ self, query: str, default: None = None, strict: bool = False
155
+ ) -> Node | None | DefaultT:
160
156
  ...
161
157
  def decompose(self, recursive: bool = True) -> None:
162
158
  """Remove a Node from the tree."""
@@ -170,7 +166,7 @@ class Node:
170
166
  def strip_tags(self, tags: list[str], recursive: bool = False) -> None:
171
167
  """Remove specified tags from the HTML tree."""
172
168
  ...
173
- def unwrap_tags(self, tags: list[str]) -> None:
169
+ def unwrap_tags(self, tags: list[str], delete_empty: bool = False) -> None:
174
170
  """Unwraps specified tags from the HTML tree.
175
171
 
176
172
  Works the same as the unwrap method, but applied to a list of tags."""
@@ -236,18 +232,15 @@ class HTMLParser:
236
232
  Matches pattern query against HTML tree."""
237
233
  ...
238
234
  @overload
239
- def css_first(
240
- self, query: str, default: Any = ..., strict: Literal[True] = ...
241
- ) -> Node: ...
242
- @overload
243
235
  def css_first(
244
236
  self, query: str, default: DefaultT, strict: bool = False
245
- ) -> Node | DefaultT: ...
237
+ ) -> Node | DefaultT:
238
+ ...
239
+
246
240
  @overload
247
241
  def css_first(
248
- self, query: str, default: None = ..., strict: bool = False
249
- ) -> Node | None:
250
- """Same as css but returns only the first match."""
242
+ self, query: str, default: None = None, strict: bool = False
243
+ ) -> Node | None | DefaultT:
251
244
  ...
252
245
  @property
253
246
  def input_encoding(self) -> str:
@@ -274,7 +267,7 @@ class HTMLParser:
274
267
  """Returns the text of the node including text of all its child nodes."""
275
268
  ...
276
269
  def strip_tags(self, tags: list[str], recursive: bool = False) -> None: ...
277
- def unwrap_tags(self, tags: list[str]) -> None:
270
+ def unwrap_tags(self, tags: list[str], delete_empty: bool = False) -> None:
278
271
  """Unwraps specified tags from the HTML tree.
279
272
 
280
273
  Works the same as th unwrap method, but applied to a list of tags."""
selectolax/parser.pyx CHANGED
@@ -269,7 +269,7 @@ cdef class HTMLParser:
269
269
  myhtml_collection_destroy(collection)
270
270
 
271
271
 
272
- def unwrap_tags(self, list tags):
272
+ def unwrap_tags(self, list tags, delete_empty : bool = False):
273
273
  """Unwraps specified tags from the HTML tree.
274
274
 
275
275
  Works the same as th `unwrap` method, but applied to a list of tags.
@@ -278,6 +278,8 @@ cdef class HTMLParser:
278
278
  ----------
279
279
  tags : list
280
280
  List of tags to remove.
281
+ delete_empty : bool, default False
282
+ If True, removes empty tags.
281
283
 
282
284
  Examples
283
285
  --------
@@ -288,7 +290,7 @@ cdef class HTMLParser:
288
290
  '<body><div>Hello world!</div></body>'
289
291
  """
290
292
  if self.root is not None:
291
- self.root.unwrap_tags(tags)
293
+ self.root.unwrap_tags(tags, delete_empty=delete_empty)
292
294
 
293
295
  @property
294
296
  def html(self):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: selectolax
3
- Version: 0.3.27
3
+ Version: 0.3.29
4
4
  Summary: Fast HTML5 parser with CSS selectors.
5
5
  Home-page: https://github.com/rushter/selectolax
6
6
  Author: Artem Golubin
@@ -26,6 +26,17 @@ Classifier: Programming Language :: Python :: 3.13
26
26
  License-File: LICENSE
27
27
  Provides-Extra: cython
28
28
  Requires-Dist: Cython==3.0.11; extra == "cython"
29
+ Dynamic: author
30
+ Dynamic: author-email
31
+ Dynamic: classifier
32
+ Dynamic: description
33
+ Dynamic: home-page
34
+ Dynamic: keywords
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: project-url
38
+ Dynamic: provides-extra
39
+ Dynamic: summary
29
40
 
30
41
  .. image:: docs/logo.png
31
42
  :alt: selectolax logo
@@ -75,6 +86,10 @@ How to compile selectolax while developing:
75
86
  Basic examples
76
87
  --------------
77
88
 
89
+ Here are some basic examples to get you started with selectolax:
90
+
91
+ Parsing HTML and extracting text:
92
+
78
93
  .. code:: python
79
94
 
80
95
  In [1]: from selectolax.parser import HTMLParser
@@ -97,6 +112,8 @@ Basic examples
97
112
  ['Lorem Ipsum is simply dummy text of the printing and typesetting industry. ',
98
113
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit.']
99
114
 
115
+ Using advanced CSS selectors:
116
+
100
117
  .. code:: python
101
118
 
102
119
  In [1]: html = "<div><p id=p1><p id=p2><p id=p3><a>link</a><p id=p4><p id=p5>text<p id=p6></div>"
@@ -0,0 +1,26 @@
1
+ selectolax-0.3.29.dist-info/top_level.txt,sha256=e5MuEM2PrQzoDlWetkFli9uXSlxa_ktW5jJEihhaI1c,11
2
+ selectolax-0.3.29.dist-info/METADATA,sha256=W9MZJLC7K1nm3KaLnrhao5WKLXbyEO4U9IUUBAxxtYI,6277
3
+ selectolax-0.3.29.dist-info/RECORD,,
4
+ selectolax-0.3.29.dist-info/WHEEL,sha256=jtyaHWw_tmPrVjB99pXdXXehh8jBCU6KlaulC_DhmdU,110
5
+ selectolax-0.3.29.dist-info/licenses/LICENSE,sha256=MYCcM-Cv_rC2-lQiwDumin0E-rMXAhK-qIGGA29434Y,1077
6
+ selectolax/utils.pxi,sha256=uB0-0naFQPy1JpR2DiIlKnyLyC76yWLnUHSuH11xg6s,3459
7
+ selectolax/lexbor.pyi,sha256=WFfpFEmhmvUc3qRJJ4mZxiXAePqdg2_Ud35eQ4jlaqU,6610
8
+ selectolax/base.pxi,sha256=eiPKlY9gG3l49qJoRQVLl1Ljza6z1k0A-met6sDPcqE,89
9
+ selectolax/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ selectolax/parser.cpython-313-i386-linux-musl.so,sha256=5-KtXCh5bjZJTdZAOQe0bAOsEdskjkAITzyMOkLxpAg,6181724
11
+ selectolax/parser.pxd,sha256=zZlg1vHUg6o4MXaiwKAo5S5hO_DqBGc4_E10qJ2EcM4,24564
12
+ selectolax/parser.c,sha256=Xl4naiO53VdzRcVWqws6koZNRRqpErvTy09qHIrvbtQ,2224633
13
+ selectolax/lexbor.pyx,sha256=EnFRvKRVoRhxg6r4vcQ89eWYUDFRlCRDm4cBRlQZnDY,11002
14
+ selectolax/lexbor.pxd,sha256=PwygBdb1blWAQcxXubZS5uffhgcXaqgySNMPFMT02-c,20958
15
+ selectolax/lexbor.cpython-313-i386-linux-musl.so,sha256=08cvccDzvf5E_73rcJzKo9BZ4sizyypwEDxqiIXxHxo,8345824
16
+ selectolax/lexbor.c,sha256=nmcIPSc9LZpbSFQLylDDVTDVU0uy0xHp4NiS_n6NM3k,2368108
17
+ selectolax/parser.pyx,sha256=GCdlRtpNKgCYsRS6iOnjKr_5GhZNcAaFMBQZSWLye8A,13093
18
+ selectolax/parser.pyi,sha256=6S9RKAevzv9zBYL1v12qQojkMst35yzy3TnD3HtZZo4,11275
19
+ selectolax/__init__.py,sha256=J5aFJ2fot0JTvAyn1K0rx3Ux6jaDJXJF1Uo4Zct_1Jw,175
20
+ selectolax/modest/selection.pxi,sha256=S55MMxEW2B1oPExB_DRwPM46WoWZU73J3rFRZU1URuQ,6393
21
+ selectolax/modest/node.pxi,sha256=8lX5cmGbX_X4Z9OuPpZ-P-5jne5k_-ck1hU-152e20Y,33315
22
+ selectolax/modest/util.pxi,sha256=aX9UnRNTITImHVBTlIs9efOd3EyugLq_Lwuo0zVTiuQ,551
23
+ selectolax/lexbor/selection.pxi,sha256=FA6npHtXjJjvS8H2_e_LS53i5zbpGYgb5zTh5Tf_XQY,6571
24
+ selectolax/lexbor/attrs.pxi,sha256=Ol2RNzXZAcWaqJdDBUe0ChOCcA8HC990Hjncj98XAkw,3138
25
+ selectolax/lexbor/node.pxi,sha256=_-zlshCku6gmCcpIuxfbkqZHVyihReyDmEK3QgYLVdg,29884
26
+ selectolax/lexbor/util.pxi,sha256=Zq7S-zlyU3wOo49wGHQHnmmhpbkrcJm59ZCTPENcZQA,563
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-musllinux_1_2_i686
5
5
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  MIT License
3
3
 
4
- Copyright (c) 2018-2023, Artem Golubin
4
+ Copyright (c) 2018-2025, Artem Golubin
5
5
 
6
6
  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:
7
7
 
@@ -1,26 +0,0 @@
1
- selectolax/lexbor.pyi,sha256=X2PMQR2XLd2rOPliKSpeFZ_VEf6mOQFTcFm0ChQbzsQ,6544
2
- selectolax/parser.pxd,sha256=zZlg1vHUg6o4MXaiwKAo5S5hO_DqBGc4_E10qJ2EcM4,24564
3
- selectolax/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- selectolax/lexbor.c,sha256=7SRJXN6hy0mWsjF76dgRDMk__7EFx01O2D9mfaH8DK4,2353665
5
- selectolax/lexbor.pyx,sha256=ffEzBnZjGTsI-H5qck7bfjVRE9vteOhQnDp6RjVD7G0,10750
6
- selectolax/__init__.py,sha256=c_YcZI0XHUarueRv6JL0z5WjcrLiV5ygw8PGIGFQiKs,175
7
- selectolax/parser.pyi,sha256=kbR5eWvkJEy-9Hx3L_4JmGy3caIl0ki4SiagWz-fnhw,11557
8
- selectolax/base.pxi,sha256=eiPKlY9gG3l49qJoRQVLl1Ljza6z1k0A-met6sDPcqE,89
9
- selectolax/utils.pxi,sha256=uB0-0naFQPy1JpR2DiIlKnyLyC76yWLnUHSuH11xg6s,3459
10
- selectolax/lexbor.pxd,sha256=PwygBdb1blWAQcxXubZS5uffhgcXaqgySNMPFMT02-c,20958
11
- selectolax/parser.c,sha256=TWYQCHK9KIL7277qgc5OEtzCcok8rJJJsmG39f5PCsg,2214825
12
- selectolax/parser.pyx,sha256=o1HkYE_nQr3TS7EPlldJx2-ygU9B5FI2uWYFzdF-VaI,12953
13
- selectolax/parser.cpython-313-i386-linux-musl.so,sha256=84koGQs272Jpz1tzOz5QriCdqUoR6BJZDNbVYD97ssU,6160880
14
- selectolax/lexbor.cpython-313-i386-linux-musl.so,sha256=F8DPsmJwRDB70q5u7y2Z6blk1co1dwiBCjBAtO5JE1w,16821856
15
- selectolax/lexbor/selection.pxi,sha256=PqjvpL6H9uFcmcQWVGfML8FDsTO7tGoZujpA00g9pWk,6444
16
- selectolax/lexbor/attrs.pxi,sha256=-518D5v70GgMJhtsxWrWcgIMnXg8afECpUubzq8kqqs,3102
17
- selectolax/lexbor/util.pxi,sha256=Zq7S-zlyU3wOo49wGHQHnmmhpbkrcJm59ZCTPENcZQA,563
18
- selectolax/lexbor/node.pxi,sha256=1XNzUwCbTYXy4D6rZtHxMpoJ9M-xoprB9wjdsiaWhr0,29346
19
- selectolax/modest/selection.pxi,sha256=S55MMxEW2B1oPExB_DRwPM46WoWZU73J3rFRZU1URuQ,6393
20
- selectolax/modest/util.pxi,sha256=aX9UnRNTITImHVBTlIs9efOd3EyugLq_Lwuo0zVTiuQ,551
21
- selectolax/modest/node.pxi,sha256=NrMzJnQJDCmgTHpUxpMHDyAfQ_AS_n_Cr_2ryEKjyL0,32550
22
- selectolax-0.3.27.dist-info/METADATA,sha256=QwBuZChcMfcqnAmJByM0BzfEPHvJXT2wIA4Acp_6DVU,5928
23
- selectolax-0.3.27.dist-info/RECORD,,
24
- selectolax-0.3.27.dist-info/top_level.txt,sha256=e5MuEM2PrQzoDlWetkFli9uXSlxa_ktW5jJEihhaI1c,11
25
- selectolax-0.3.27.dist-info/WHEEL,sha256=YnLCwhzAibpPa4I2wVby4cQOpj8-JkNAXziWbX6BFBk,110
26
- selectolax-0.3.27.dist-info/LICENSE,sha256=kYggm2ZJzBgL79x1gCsYsx8rFIYP2IE-BdXRV3Rm0NU,1077