brewdoc-linux-x64-glibc 0.0.0-stage → 0.3.2

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.
Files changed (576) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -2
  3. package/binary/_internal/PIL/_avif.cpython-312-x86_64-linux-gnu.so +0 -0
  4. package/binary/_internal/PIL/_imaging.cpython-312-x86_64-linux-gnu.so +0 -0
  5. package/binary/_internal/PIL/_imagingcms.cpython-312-x86_64-linux-gnu.so +0 -0
  6. package/binary/_internal/PIL/_imagingft.cpython-312-x86_64-linux-gnu.so +0 -0
  7. package/binary/_internal/PIL/_imagingmath.cpython-312-x86_64-linux-gnu.so +0 -0
  8. package/binary/_internal/PIL/_imagingtk.cpython-312-x86_64-linux-gnu.so +0 -0
  9. package/binary/_internal/PIL/_webp.cpython-312-x86_64-linux-gnu.so +0 -0
  10. package/binary/_internal/_cffi_backend.cpython-312-x86_64-linux-gnu.so +0 -0
  11. package/binary/_internal/_quickjs.abi3.so +0 -0
  12. package/binary/_internal/base_library.zip +0 -0
  13. package/binary/_internal/brewdoc/_urljs/glue.js +858 -0
  14. package/binary/_internal/brewdoc/_vendor/THIRD_PARTY_NOTICES.txt +342 -0
  15. package/binary/_internal/brewdoc/_vendor/linkedom-worker.js +12650 -0
  16. package/binary/_internal/brewdoc-0.3.2.dist-info/INSTALLER +1 -0
  17. package/binary/_internal/brewdoc-0.3.2.dist-info/METADATA +157 -0
  18. package/binary/_internal/brewdoc-0.3.2.dist-info/RECORD +30 -0
  19. package/binary/_internal/brewdoc-0.3.2.dist-info/REQUESTED +0 -0
  20. package/binary/_internal/brewdoc-0.3.2.dist-info/WHEEL +4 -0
  21. package/binary/_internal/brewdoc-0.3.2.dist-info/direct_url.json +1 -0
  22. package/binary/_internal/brewdoc-0.3.2.dist-info/entry_points.txt +2 -0
  23. package/binary/_internal/brewdoc-0.3.2.dist-info/licenses/LICENSE +21 -0
  24. package/binary/_internal/brewdoc-0.3.2.dist-info/uv_cache.json +1 -0
  25. package/binary/_internal/cffi-2.1.1.dist-info/INSTALLER +1 -0
  26. package/binary/_internal/cffi-2.1.1.dist-info/METADATA +67 -0
  27. package/binary/_internal/cffi-2.1.1.dist-info/RECORD +34 -0
  28. package/binary/_internal/cffi-2.1.1.dist-info/REQUESTED +0 -0
  29. package/binary/_internal/cffi-2.1.1.dist-info/WHEEL +6 -0
  30. package/binary/_internal/cffi-2.1.1.dist-info/entry_points.txt +5 -0
  31. package/binary/_internal/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
  32. package/binary/_internal/cffi-2.1.1.dist-info/top_level.txt +2 -0
  33. package/binary/_internal/charset_normalizer/cd.cpython-312-x86_64-linux-gnu.so +0 -0
  34. package/binary/_internal/charset_normalizer/md.cpython-312-x86_64-linux-gnu.so +0 -0
  35. package/binary/_internal/charset_normalizer-3.5.2.dist-info/INSTALLER +1 -0
  36. package/binary/_internal/charset_normalizer-3.5.2.dist-info/METADATA +892 -0
  37. package/binary/_internal/charset_normalizer-3.5.2.dist-info/RECORD +24 -0
  38. package/binary/_internal/charset_normalizer-3.5.2.dist-info/REQUESTED +0 -0
  39. package/binary/_internal/charset_normalizer-3.5.2.dist-info/WHEEL +7 -0
  40. package/binary/_internal/charset_normalizer-3.5.2.dist-info/entry_points.txt +2 -0
  41. package/binary/_internal/charset_normalizer-3.5.2.dist-info/licenses/LICENSE +21 -0
  42. package/binary/_internal/charset_normalizer-3.5.2.dist-info/top_level.txt +1 -0
  43. package/binary/_internal/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  44. package/binary/_internal/cryptography-50.0.2.dist-info/INSTALLER +1 -0
  45. package/binary/_internal/cryptography-50.0.2.dist-info/METADATA +111 -0
  46. package/binary/_internal/cryptography-50.0.2.dist-info/RECORD +122 -0
  47. package/binary/_internal/cryptography-50.0.2.dist-info/REQUESTED +0 -0
  48. package/binary/_internal/cryptography-50.0.2.dist-info/WHEEL +5 -0
  49. package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
  50. package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE.APACHE +202 -0
  51. package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE.BSD +27 -0
  52. package/binary/_internal/cryptography-50.0.2.dist-info/sboms/cryptography-rust.cyclonedx.json +1365 -0
  53. package/binary/_internal/cryptography-50.0.2.dist-info/sboms/sbom.json +43 -0
  54. package/binary/_internal/libXau-154567c4.so.6.0.0 +0 -0
  55. package/binary/_internal/libavif-8a7f9d56.so.16.4.2 +0 -0
  56. package/binary/_internal/libbrotlicommon-53534446.so.1.2.0 +0 -0
  57. package/binary/_internal/libbrotlidec-7e5462ba.so.1.2.0 +0 -0
  58. package/binary/_internal/libfreetype-9fc94c80.so.6.20.6 +0 -0
  59. package/binary/_internal/libgcc_s.so.1 +0 -0
  60. package/binary/_internal/libharfbuzz-172d1f63.so.0.61421.0 +0 -0
  61. package/binary/_internal/libjpeg-31e2ca52.so.62.4.0 +0 -0
  62. package/binary/_internal/liblcms2-dade1fbf.so.2.0.19 +0 -0
  63. package/binary/_internal/liblzma-2be87c3e.so.5.8.3 +0 -0
  64. package/binary/_internal/libopenjp2-b07f72ad.so.2.5.4 +0 -0
  65. package/binary/_internal/libpng16-abb096d5.so.16.58.0 +0 -0
  66. package/binary/_internal/libpython3.12.so.1.0 +0 -0
  67. package/binary/_internal/libsharpyuv-0066295b.so.0.1.2 +0 -0
  68. package/binary/_internal/libstdc++.so.6 +0 -0
  69. package/binary/_internal/libtiff-fc87e79d.so.6.2.0 +0 -0
  70. package/binary/_internal/libwebp-51b0b3f7.so.7.2.0 +0 -0
  71. package/binary/_internal/libwebpdemux-9fe2abcc.so.2.0.17 +0 -0
  72. package/binary/_internal/libwebpmux-8fb1c9f6.so.3.1.2 +0 -0
  73. package/binary/_internal/libxcb-ad31f5a3.so.1.1.0 +0 -0
  74. package/binary/_internal/libz.so.1 +0 -0
  75. package/binary/_internal/libzstd-44be1190.so.1.5.7 +0 -0
  76. package/binary/_internal/pdfminer/cmap/78-EUC-H.json.gz +0 -0
  77. package/binary/_internal/pdfminer/cmap/78-EUC-V.json.gz +0 -0
  78. package/binary/_internal/pdfminer/cmap/78-H.json.gz +0 -0
  79. package/binary/_internal/pdfminer/cmap/78-RKSJ-H.json.gz +0 -0
  80. package/binary/_internal/pdfminer/cmap/78-RKSJ-V.json.gz +0 -0
  81. package/binary/_internal/pdfminer/cmap/78-V.json.gz +0 -0
  82. package/binary/_internal/pdfminer/cmap/78ms-RKSJ-H.json.gz +0 -0
  83. package/binary/_internal/pdfminer/cmap/78ms-RKSJ-V.json.gz +0 -0
  84. package/binary/_internal/pdfminer/cmap/83pv-RKSJ-H.json.gz +0 -0
  85. package/binary/_internal/pdfminer/cmap/83pv-RKSJ-V.json.gz +0 -0
  86. package/binary/_internal/pdfminer/cmap/90ms-RKSJ-H.json.gz +0 -0
  87. package/binary/_internal/pdfminer/cmap/90ms-RKSJ-V.json.gz +0 -0
  88. package/binary/_internal/pdfminer/cmap/90msp-RKSJ-H.json.gz +0 -0
  89. package/binary/_internal/pdfminer/cmap/90msp-RKSJ-V.json.gz +0 -0
  90. package/binary/_internal/pdfminer/cmap/90pv-RKSJ-H.json.gz +0 -0
  91. package/binary/_internal/pdfminer/cmap/90pv-RKSJ-V.json.gz +0 -0
  92. package/binary/_internal/pdfminer/cmap/Add-H.json.gz +0 -0
  93. package/binary/_internal/pdfminer/cmap/Add-RKSJ-H.json.gz +0 -0
  94. package/binary/_internal/pdfminer/cmap/Add-RKSJ-V.json.gz +0 -0
  95. package/binary/_internal/pdfminer/cmap/Add-V.json.gz +0 -0
  96. package/binary/_internal/pdfminer/cmap/B5-H.json.gz +0 -0
  97. package/binary/_internal/pdfminer/cmap/B5-V.json.gz +0 -0
  98. package/binary/_internal/pdfminer/cmap/B5pc-H.json.gz +0 -0
  99. package/binary/_internal/pdfminer/cmap/B5pc-V.json.gz +0 -0
  100. package/binary/_internal/pdfminer/cmap/CNS-EUC-H.json.gz +0 -0
  101. package/binary/_internal/pdfminer/cmap/CNS-EUC-V.json.gz +0 -0
  102. package/binary/_internal/pdfminer/cmap/CNS1-H.json.gz +0 -0
  103. package/binary/_internal/pdfminer/cmap/CNS1-V.json.gz +0 -0
  104. package/binary/_internal/pdfminer/cmap/CNS2-H.json.gz +0 -0
  105. package/binary/_internal/pdfminer/cmap/CNS2-V.json.gz +0 -0
  106. package/binary/_internal/pdfminer/cmap/ETHK-B5-H.json.gz +0 -0
  107. package/binary/_internal/pdfminer/cmap/ETHK-B5-V.json.gz +0 -0
  108. package/binary/_internal/pdfminer/cmap/ETen-B5-H.json.gz +0 -0
  109. package/binary/_internal/pdfminer/cmap/ETen-B5-V.json.gz +0 -0
  110. package/binary/_internal/pdfminer/cmap/ETenms-B5-H.json.gz +0 -0
  111. package/binary/_internal/pdfminer/cmap/ETenms-B5-V.json.gz +0 -0
  112. package/binary/_internal/pdfminer/cmap/EUC-H.json.gz +0 -0
  113. package/binary/_internal/pdfminer/cmap/EUC-V.json.gz +0 -0
  114. package/binary/_internal/pdfminer/cmap/Ext-H.json.gz +0 -0
  115. package/binary/_internal/pdfminer/cmap/Ext-RKSJ-H.json.gz +0 -0
  116. package/binary/_internal/pdfminer/cmap/Ext-RKSJ-V.json.gz +0 -0
  117. package/binary/_internal/pdfminer/cmap/Ext-V.json.gz +0 -0
  118. package/binary/_internal/pdfminer/cmap/GB-EUC-H.json.gz +0 -0
  119. package/binary/_internal/pdfminer/cmap/GB-EUC-V.json.gz +0 -0
  120. package/binary/_internal/pdfminer/cmap/GB-H.json.gz +0 -0
  121. package/binary/_internal/pdfminer/cmap/GB-V.json.gz +0 -0
  122. package/binary/_internal/pdfminer/cmap/GBK-EUC-H.json.gz +0 -0
  123. package/binary/_internal/pdfminer/cmap/GBK-EUC-V.json.gz +0 -0
  124. package/binary/_internal/pdfminer/cmap/GBK2K-H.json.gz +0 -0
  125. package/binary/_internal/pdfminer/cmap/GBK2K-V.json.gz +0 -0
  126. package/binary/_internal/pdfminer/cmap/GBKp-EUC-H.json.gz +0 -0
  127. package/binary/_internal/pdfminer/cmap/GBKp-EUC-V.json.gz +0 -0
  128. package/binary/_internal/pdfminer/cmap/GBT-EUC-H.json.gz +0 -0
  129. package/binary/_internal/pdfminer/cmap/GBT-EUC-V.json.gz +0 -0
  130. package/binary/_internal/pdfminer/cmap/GBT-H.json.gz +0 -0
  131. package/binary/_internal/pdfminer/cmap/GBT-V.json.gz +0 -0
  132. package/binary/_internal/pdfminer/cmap/GBTpc-EUC-H.json.gz +0 -0
  133. package/binary/_internal/pdfminer/cmap/GBTpc-EUC-V.json.gz +0 -0
  134. package/binary/_internal/pdfminer/cmap/GBpc-EUC-H.json.gz +0 -0
  135. package/binary/_internal/pdfminer/cmap/GBpc-EUC-V.json.gz +0 -0
  136. package/binary/_internal/pdfminer/cmap/H.json.gz +0 -0
  137. package/binary/_internal/pdfminer/cmap/HKdla-B5-H.json.gz +0 -0
  138. package/binary/_internal/pdfminer/cmap/HKdla-B5-V.json.gz +0 -0
  139. package/binary/_internal/pdfminer/cmap/HKdlb-B5-H.json.gz +0 -0
  140. package/binary/_internal/pdfminer/cmap/HKdlb-B5-V.json.gz +0 -0
  141. package/binary/_internal/pdfminer/cmap/HKgccs-B5-H.json.gz +0 -0
  142. package/binary/_internal/pdfminer/cmap/HKgccs-B5-V.json.gz +0 -0
  143. package/binary/_internal/pdfminer/cmap/HKm314-B5-H.json.gz +0 -0
  144. package/binary/_internal/pdfminer/cmap/HKm314-B5-V.json.gz +0 -0
  145. package/binary/_internal/pdfminer/cmap/HKm471-B5-H.json.gz +0 -0
  146. package/binary/_internal/pdfminer/cmap/HKm471-B5-V.json.gz +0 -0
  147. package/binary/_internal/pdfminer/cmap/HKscs-B5-H.json.gz +0 -0
  148. package/binary/_internal/pdfminer/cmap/HKscs-B5-V.json.gz +0 -0
  149. package/binary/_internal/pdfminer/cmap/Hankaku-H.json.gz +0 -0
  150. package/binary/_internal/pdfminer/cmap/Hankaku-V.json.gz +0 -0
  151. package/binary/_internal/pdfminer/cmap/Hiragana-H.json.gz +0 -0
  152. package/binary/_internal/pdfminer/cmap/Hiragana-V.json.gz +0 -0
  153. package/binary/_internal/pdfminer/cmap/KSC-EUC-H.json.gz +0 -0
  154. package/binary/_internal/pdfminer/cmap/KSC-EUC-V.json.gz +0 -0
  155. package/binary/_internal/pdfminer/cmap/KSC-H.json.gz +0 -0
  156. package/binary/_internal/pdfminer/cmap/KSC-Johab-H.json.gz +0 -0
  157. package/binary/_internal/pdfminer/cmap/KSC-Johab-V.json.gz +0 -0
  158. package/binary/_internal/pdfminer/cmap/KSC-V.json.gz +0 -0
  159. package/binary/_internal/pdfminer/cmap/KSCms-UHC-H.json.gz +0 -0
  160. package/binary/_internal/pdfminer/cmap/KSCms-UHC-HW-H.json.gz +0 -0
  161. package/binary/_internal/pdfminer/cmap/KSCms-UHC-HW-V.json.gz +0 -0
  162. package/binary/_internal/pdfminer/cmap/KSCms-UHC-V.json.gz +0 -0
  163. package/binary/_internal/pdfminer/cmap/KSCpc-EUC-H.json.gz +0 -0
  164. package/binary/_internal/pdfminer/cmap/KSCpc-EUC-V.json.gz +0 -0
  165. package/binary/_internal/pdfminer/cmap/Katakana-H.json.gz +0 -0
  166. package/binary/_internal/pdfminer/cmap/Katakana-V.json.gz +0 -0
  167. package/binary/_internal/pdfminer/cmap/NWP-H.json.gz +0 -0
  168. package/binary/_internal/pdfminer/cmap/NWP-V.json.gz +0 -0
  169. package/binary/_internal/pdfminer/cmap/README.txt +79 -0
  170. package/binary/_internal/pdfminer/cmap/RKSJ-H.json.gz +0 -0
  171. package/binary/_internal/pdfminer/cmap/RKSJ-V.json.gz +0 -0
  172. package/binary/_internal/pdfminer/cmap/Roman-H.json.gz +0 -0
  173. package/binary/_internal/pdfminer/cmap/Roman-V.json.gz +0 -0
  174. package/binary/_internal/pdfminer/cmap/UniCNS-UCS2-H.json.gz +0 -0
  175. package/binary/_internal/pdfminer/cmap/UniCNS-UCS2-V.json.gz +0 -0
  176. package/binary/_internal/pdfminer/cmap/UniCNS-UTF16-H.json.gz +0 -0
  177. package/binary/_internal/pdfminer/cmap/UniCNS-UTF16-V.json.gz +0 -0
  178. package/binary/_internal/pdfminer/cmap/UniCNS-UTF32-H.json.gz +0 -0
  179. package/binary/_internal/pdfminer/cmap/UniCNS-UTF32-V.json.gz +0 -0
  180. package/binary/_internal/pdfminer/cmap/UniCNS-UTF8-H.json.gz +0 -0
  181. package/binary/_internal/pdfminer/cmap/UniCNS-UTF8-V.json.gz +0 -0
  182. package/binary/_internal/pdfminer/cmap/UniGB-UCS2-H.json.gz +0 -0
  183. package/binary/_internal/pdfminer/cmap/UniGB-UCS2-V.json.gz +0 -0
  184. package/binary/_internal/pdfminer/cmap/UniGB-UTF16-H.json.gz +0 -0
  185. package/binary/_internal/pdfminer/cmap/UniGB-UTF16-V.json.gz +0 -0
  186. package/binary/_internal/pdfminer/cmap/UniGB-UTF32-H.json.gz +0 -0
  187. package/binary/_internal/pdfminer/cmap/UniGB-UTF32-V.json.gz +0 -0
  188. package/binary/_internal/pdfminer/cmap/UniGB-UTF8-H.json.gz +0 -0
  189. package/binary/_internal/pdfminer/cmap/UniGB-UTF8-V.json.gz +0 -0
  190. package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-H.json.gz +0 -0
  191. package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-HW-H.json.gz +0 -0
  192. package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-HW-V.json.gz +0 -0
  193. package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-V.json.gz +0 -0
  194. package/binary/_internal/pdfminer/cmap/UniJIS-UTF16-H.json.gz +0 -0
  195. package/binary/_internal/pdfminer/cmap/UniJIS-UTF16-V.json.gz +0 -0
  196. package/binary/_internal/pdfminer/cmap/UniJIS-UTF32-H.json.gz +0 -0
  197. package/binary/_internal/pdfminer/cmap/UniJIS-UTF32-V.json.gz +0 -0
  198. package/binary/_internal/pdfminer/cmap/UniJIS-UTF8-H.json.gz +0 -0
  199. package/binary/_internal/pdfminer/cmap/UniJIS-UTF8-V.json.gz +0 -0
  200. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF16-H.json.gz +0 -0
  201. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF16-V.json.gz +0 -0
  202. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF32-H.json.gz +0 -0
  203. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF32-V.json.gz +0 -0
  204. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF8-H.json.gz +0 -0
  205. package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF8-V.json.gz +0 -0
  206. package/binary/_internal/pdfminer/cmap/UniJISX0213-UTF32-H.json.gz +0 -0
  207. package/binary/_internal/pdfminer/cmap/UniJISX0213-UTF32-V.json.gz +0 -0
  208. package/binary/_internal/pdfminer/cmap/UniJISX02132004-UTF32-H.json.gz +0 -0
  209. package/binary/_internal/pdfminer/cmap/UniJISX02132004-UTF32-V.json.gz +0 -0
  210. package/binary/_internal/pdfminer/cmap/UniKS-UCS2-H.json.gz +0 -0
  211. package/binary/_internal/pdfminer/cmap/UniKS-UCS2-V.json.gz +0 -0
  212. package/binary/_internal/pdfminer/cmap/UniKS-UTF16-H.json.gz +0 -0
  213. package/binary/_internal/pdfminer/cmap/UniKS-UTF16-V.json.gz +0 -0
  214. package/binary/_internal/pdfminer/cmap/UniKS-UTF32-H.json.gz +0 -0
  215. package/binary/_internal/pdfminer/cmap/UniKS-UTF32-V.json.gz +0 -0
  216. package/binary/_internal/pdfminer/cmap/UniKS-UTF8-H.json.gz +0 -0
  217. package/binary/_internal/pdfminer/cmap/UniKS-UTF8-V.json.gz +0 -0
  218. package/binary/_internal/pdfminer/cmap/V.json.gz +0 -0
  219. package/binary/_internal/pdfminer/cmap/WP-Symbol-H.json.gz +0 -0
  220. package/binary/_internal/pdfminer/cmap/WP-Symbol-V.json.gz +0 -0
  221. package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-CNS1.json.gz +0 -0
  222. package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-GB1.json.gz +0 -0
  223. package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-Japan1.json.gz +0 -0
  224. package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-Korea1.json.gz +0 -0
  225. package/binary/_internal/pdfminer/py.typed +0 -0
  226. package/binary/_internal/pdfminer_six-20260107.dist-info/INSTALLER +1 -0
  227. package/binary/_internal/pdfminer_six-20260107.dist-info/METADATA +110 -0
  228. package/binary/_internal/pdfminer_six-20260107.dist-info/RECORD +191 -0
  229. package/binary/_internal/pdfminer_six-20260107.dist-info/REQUESTED +0 -0
  230. package/binary/_internal/pdfminer_six-20260107.dist-info/WHEEL +5 -0
  231. package/binary/_internal/pdfminer_six-20260107.dist-info/licenses/LICENSE +22 -0
  232. package/binary/_internal/pdfminer_six-20260107.dist-info/top_level.txt +1 -0
  233. package/binary/_internal/pdfplumber-0.11.10.dist-info/INSTALLER +1 -0
  234. package/binary/_internal/pdfplumber-0.11.10.dist-info/METADATA +617 -0
  235. package/binary/_internal/pdfplumber-0.11.10.dist-info/RECORD +30 -0
  236. package/binary/_internal/pdfplumber-0.11.10.dist-info/REQUESTED +0 -0
  237. package/binary/_internal/pdfplumber-0.11.10.dist-info/WHEEL +5 -0
  238. package/binary/_internal/pdfplumber-0.11.10.dist-info/entry_points.txt +2 -0
  239. package/binary/_internal/pdfplumber-0.11.10.dist-info/licenses/LICENSE.txt +21 -0
  240. package/binary/_internal/pdfplumber-0.11.10.dist-info/top_level.txt +1 -0
  241. package/binary/_internal/pillow-12.3.0.dist-info/INSTALLER +1 -0
  242. package/binary/_internal/pillow-12.3.0.dist-info/METADATA +180 -0
  243. package/binary/_internal/pillow-12.3.0.dist-info/RECORD +142 -0
  244. package/binary/_internal/pillow-12.3.0.dist-info/REQUESTED +0 -0
  245. package/binary/_internal/pillow-12.3.0.dist-info/WHEEL +6 -0
  246. package/binary/_internal/pillow-12.3.0.dist-info/licenses/LICENSE +1574 -0
  247. package/binary/_internal/pillow-12.3.0.dist-info/sboms/auditwheel.cdx.json +1 -0
  248. package/binary/_internal/pillow-12.3.0.dist-info/sboms/pillow-12.3.0.cdx.json +721 -0
  249. package/binary/_internal/pillow-12.3.0.dist-info/top_level.txt +1 -0
  250. package/binary/_internal/pillow-12.3.0.dist-info/zip-safe +1 -0
  251. package/binary/_internal/pillow.libs/libXau-154567c4.so.6.0.0 +0 -0
  252. package/binary/_internal/pillow.libs/libavif-8a7f9d56.so.16.4.2 +0 -0
  253. package/binary/_internal/pillow.libs/libbrotlicommon-53534446.so.1.2.0 +0 -0
  254. package/binary/_internal/pillow.libs/libbrotlidec-7e5462ba.so.1.2.0 +0 -0
  255. package/binary/_internal/pillow.libs/libfreetype-9fc94c80.so.6.20.6 +0 -0
  256. package/binary/_internal/pillow.libs/libharfbuzz-172d1f63.so.0.61421.0 +0 -0
  257. package/binary/_internal/pillow.libs/libjpeg-31e2ca52.so.62.4.0 +0 -0
  258. package/binary/_internal/pillow.libs/liblcms2-dade1fbf.so.2.0.19 +0 -0
  259. package/binary/_internal/pillow.libs/liblzma-2be87c3e.so.5.8.3 +0 -0
  260. package/binary/_internal/pillow.libs/libopenjp2-b07f72ad.so.2.5.4 +0 -0
  261. package/binary/_internal/pillow.libs/libpng16-abb096d5.so.16.58.0 +0 -0
  262. package/binary/_internal/pillow.libs/libsharpyuv-0066295b.so.0.1.2 +0 -0
  263. package/binary/_internal/pillow.libs/libtiff-fc87e79d.so.6.2.0 +0 -0
  264. package/binary/_internal/pillow.libs/libwebp-51b0b3f7.so.7.2.0 +0 -0
  265. package/binary/_internal/pillow.libs/libwebpdemux-9fe2abcc.so.2.0.17 +0 -0
  266. package/binary/_internal/pillow.libs/libwebpmux-8fb1c9f6.so.3.1.2 +0 -0
  267. package/binary/_internal/pillow.libs/libxcb-ad31f5a3.so.1.1.0 +0 -0
  268. package/binary/_internal/pillow.libs/libzstd-44be1190.so.1.5.7 +0 -0
  269. package/binary/_internal/pycparser-3.0.dist-info/INSTALLER +1 -0
  270. package/binary/_internal/pycparser-3.0.dist-info/METADATA +244 -0
  271. package/binary/_internal/pycparser-3.0.dist-info/RECORD +15 -0
  272. package/binary/_internal/pycparser-3.0.dist-info/REQUESTED +0 -0
  273. package/binary/_internal/pycparser-3.0.dist-info/WHEEL +5 -0
  274. package/binary/_internal/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  275. package/binary/_internal/pycparser-3.0.dist-info/top_level.txt +1 -0
  276. package/binary/_internal/pypdfium2/version.json +11 -0
  277. package/binary/_internal/pypdfium2-5.13.0.dist-info/INSTALLER +1 -0
  278. package/binary/_internal/pypdfium2-5.13.0.dist-info/METADATA +1139 -0
  279. package/binary/_internal/pypdfium2-5.13.0.dist-info/RECORD +75 -0
  280. package/binary/_internal/pypdfium2-5.13.0.dist-info/REQUESTED +0 -0
  281. package/binary/_internal/pypdfium2-5.13.0.dist-info/WHEEL +6 -0
  282. package/binary/_internal/pypdfium2-5.13.0.dist-info/entry_points.txt +2 -0
  283. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/Apache-2.0.txt +202 -0
  284. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +26 -0
  285. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/CC-BY-4.0.txt +317 -0
  286. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/abseil.txt +203 -0
  287. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/agg23.txt +14 -0
  288. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/fast_float.txt +27 -0
  289. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/freetype.txt +169 -0
  290. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/icu.txt +568 -0
  291. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/lcms.txt +27 -0
  292. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.ijg +260 -0
  293. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.md +135 -0
  294. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libopenjpeg.txt +32 -0
  295. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libpng.txt +134 -0
  296. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libtiff.txt +21 -0
  297. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/llvm-libc.txt +278 -0
  298. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium-binaries.txt +9 -0
  299. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium.txt +230 -0
  300. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/simdutf.txt +18 -0
  301. package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/zlib.txt +29 -0
  302. package/binary/_internal/pypdfium2-5.13.0.dist-info/top_level.txt +4 -0
  303. package/binary/_internal/pypdfium2_raw/libpdfium.so +0 -0
  304. package/binary/_internal/pypdfium2_raw/version.json +10 -0
  305. package/binary/_internal/python_calamine/_python_calamine.cpython-312-x86_64-linux-gnu.so +0 -0
  306. package/binary/_internal/python_calamine-0.8.2.dist-info/INSTALLER +1 -0
  307. package/binary/_internal/python_calamine-0.8.2.dist-info/METADATA +94 -0
  308. package/binary/_internal/python_calamine-0.8.2.dist-info/RECORD +11 -0
  309. package/binary/_internal/python_calamine-0.8.2.dist-info/REQUESTED +0 -0
  310. package/binary/_internal/python_calamine-0.8.2.dist-info/WHEEL +5 -0
  311. package/binary/_internal/python_calamine-0.8.2.dist-info/licenses/LICENSE +21 -0
  312. package/binary/_internal/python_calamine-0.8.2.dist-info/sboms/python-calamine.cyclonedx.json +1615 -0
  313. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/INSTALLER +1 -0
  314. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/METADATA +161 -0
  315. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/RECORD +9 -0
  316. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/REQUESTED +0 -0
  317. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/WHEEL +7 -0
  318. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/licenses/LICENSE +21 -0
  319. package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/top_level.txt +2 -0
  320. package/binary/_internal/selectolax/base.pxi +4 -0
  321. package/binary/_internal/selectolax/lexbor/attrs.pxi +123 -0
  322. package/binary/_internal/selectolax/lexbor/fragment_lookup.pxi +52 -0
  323. package/binary/_internal/selectolax/lexbor/node.pxi +1355 -0
  324. package/binary/_internal/selectolax/lexbor/node_remove.pxi +29 -0
  325. package/binary/_internal/selectolax/lexbor/selection.pxi +251 -0
  326. package/binary/_internal/selectolax/lexbor/util.pxi +114 -0
  327. package/binary/_internal/selectolax/lexbor.c +66981 -0
  328. package/binary/_internal/selectolax/lexbor.cpython-312-x86_64-linux-gnu.so +0 -0
  329. package/binary/_internal/selectolax/lexbor.pxd +682 -0
  330. package/binary/_internal/selectolax/lexbor.pyi +1534 -0
  331. package/binary/_internal/selectolax/lexbor.pyx +1046 -0
  332. package/binary/_internal/selectolax/modest/node.pxi +976 -0
  333. package/binary/_internal/selectolax/modest/selection.pxi +199 -0
  334. package/binary/_internal/selectolax/modest/util.pxi +20 -0
  335. package/binary/_internal/selectolax/py.typed +0 -0
  336. package/binary/_internal/selectolax/utils.pxi +117 -0
  337. package/binary/_internal/selectolax-0.4.13.dist-info/INSTALLER +1 -0
  338. package/binary/_internal/selectolax-0.4.13.dist-info/METADATA +222 -0
  339. package/binary/_internal/selectolax-0.4.13.dist-info/RECORD +30 -0
  340. package/binary/_internal/selectolax-0.4.13.dist-info/REQUESTED +0 -0
  341. package/binary/_internal/selectolax-0.4.13.dist-info/WHEEL +7 -0
  342. package/binary/_internal/selectolax-0.4.13.dist-info/licenses/LICENSE +10 -0
  343. package/binary/_internal/selectolax-0.4.13.dist-info/top_level.txt +1 -0
  344. package/binary/brewdoc +0 -0
  345. package/binary/licenses/installed/brewdoc/brewdoc/_vendor/THIRD_PARTY_NOTICES.txt +342 -0
  346. package/binary/licenses/installed/brewdoc/brewdoc-0.3.2.dist-info/licenses/LICENSE +21 -0
  347. package/binary/licenses/installed/cffi/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
  348. package/binary/licenses/installed/charset-normalizer/charset_normalizer-3.5.2.dist-info/licenses/LICENSE +21 -0
  349. package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
  350. package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE.APACHE +202 -0
  351. package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE.BSD +27 -0
  352. package/binary/licenses/installed/interpreter/LICENSE.txt +279 -0
  353. package/binary/licenses/installed/native-runtime/GPL-3 +674 -0
  354. package/binary/licenses/installed/native-runtime/gcc-12-base-amd64-copyright +1512 -0
  355. package/binary/licenses/installed/pdfminer.six/pdfminer_six-20260107.dist-info/licenses/LICENSE +22 -0
  356. package/binary/licenses/installed/pdfplumber/pdfplumber-0.11.10.dist-info/licenses/LICENSE.txt +21 -0
  357. package/binary/licenses/installed/pillow/pillow-12.3.0.dist-info/licenses/LICENSE +1574 -0
  358. package/binary/licenses/installed/pycparser/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  359. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/Apache-2.0.txt +202 -0
  360. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +26 -0
  361. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/CC-BY-4.0.txt +317 -0
  362. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/abseil.txt +203 -0
  363. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/agg23.txt +14 -0
  364. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/fast_float.txt +27 -0
  365. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/freetype.txt +169 -0
  366. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/icu.txt +568 -0
  367. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/lcms.txt +27 -0
  368. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.ijg +260 -0
  369. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.md +135 -0
  370. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libopenjpeg.txt +32 -0
  371. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libpng.txt +134 -0
  372. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libtiff.txt +21 -0
  373. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/llvm-libc.txt +278 -0
  374. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium-binaries.txt +9 -0
  375. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium.txt +230 -0
  376. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/simdutf.txt +18 -0
  377. package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/zlib.txt +29 -0
  378. package/binary/licenses/installed/python-calamine/python_calamine-0.8.2.dist-info/licenses/LICENSE +21 -0
  379. package/binary/licenses/installed/quickjs-ng/quickjs_ng-0.17.0.1.dist-info/licenses/LICENSE +21 -0
  380. package/binary/licenses/installed/runtime-hooks/pyi_rth_cryptography_openssl.py +20 -0
  381. package/binary/licenses/installed/runtime-hooks/pyi_rth_inspect.py +99 -0
  382. package/binary/licenses/installed/runtime-hooks/pyi_rth_multiprocessing.py +88 -0
  383. package/binary/licenses/installed/runtime-hooks/pyi_rth_pkgutil.py +64 -0
  384. package/binary/licenses/installed/selectolax/selectolax-0.4.13.dist-info/licenses/LICENSE +10 -0
  385. package/binary/licenses/installed-manifest.json +202 -0
  386. package/binary/licenses/supplemental/openssl/3.5.9/README-copyright.txt +9 -0
  387. package/binary/licenses/supplemental/openssl/4.0.3/README-copyright.txt +9 -0
  388. package/binary/licenses/supplemental/provenance.json +2347 -0
  389. package/binary/licenses/supplemental/pyinstaller-6.22.3/COPYING.txt +648 -0
  390. package/binary/licenses/supplemental/pyinstaller-6.22.3/bootloader/waflib/LICENSE +25 -0
  391. package/binary/licenses/supplemental/pyinstaller-6.22.3/bootloader/zlib/LICENSE +22 -0
  392. package/binary/licenses/supplemental/pyinstaller-6.22.3/doc/license.rst +24 -0
  393. package/binary/licenses/supplemental/pyinstaller-hooks-contrib-2026.8/LICENSE +521 -0
  394. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE +373 -0
  395. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.bdb.txt +126 -0
  396. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.bzip2.txt +37 -0
  397. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.cpython.txt +771 -0
  398. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.expat.txt +21 -0
  399. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libX11.txt +942 -0
  400. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libXau.txt +21 -0
  401. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libedit.txt +29 -0
  402. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libffi.txt +21 -0
  403. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.liblzma.txt +13 -0
  404. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libuuid.txt +27 -0
  405. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libxcb.txt +30 -0
  406. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.mpdecimal.txt +24 -0
  407. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.ncurses.txt +29 -0
  408. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.openssl-1.1.txt +124 -0
  409. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.openssl-3.txt +177 -0
  410. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.sqlite.txt +23 -0
  411. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.tcl.txt +40 -0
  412. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.tix.txt +54 -0
  413. package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.zlib.txt +21 -0
  414. package/binary/licenses/supplemental/python-calamine-0.8.2/LICENSE +21 -0
  415. package/binary/licenses/supplemental/python-calamine-0.8.2/source-identity/Cargo.lock +620 -0
  416. package/binary/licenses/supplemental/python-calamine-0.8.2/source-identity/Cargo.toml +22 -0
  417. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/LICENSE +21 -0
  418. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/cutils.h.txt +24 -0
  419. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/dtoa.c.txt +23 -0
  420. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/dtoa.h.txt +23 -0
  421. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp-opcode.h.txt +23 -0
  422. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp.c.txt +23 -0
  423. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp.h.txt +23 -0
  424. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libunicode.c.txt +23 -0
  425. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libunicode.h.txt +23 -0
  426. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/list.h.txt +23 -0
  427. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs-atom.h.txt +24 -0
  428. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs-opcode.h.txt +24 -0
  429. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs.c.txt +26 -0
  430. package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs.h.txt +26 -0
  431. package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-0BSD +12 -0
  432. package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-APACHE +201 -0
  433. package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-MIT +23 -0
  434. package/binary/licenses/supplemental/rust-android_system_properties-0.1.5/LICENSE-APACHE +13 -0
  435. package/binary/licenses/supplemental/rust-android_system_properties-0.1.5/LICENSE-MIT +20 -0
  436. package/binary/licenses/supplemental/rust-atoi_simd-0.18.1/LICENSE-APACHE +201 -0
  437. package/binary/licenses/supplemental/rust-atoi_simd-0.18.1/LICENSE-MIT +25 -0
  438. package/binary/licenses/supplemental/rust-autocfg-1.5.1/LICENSE-APACHE +201 -0
  439. package/binary/licenses/supplemental/rust-autocfg-1.5.1/LICENSE-MIT +25 -0
  440. package/binary/licenses/supplemental/rust-bumpalo-3.20.3/LICENSE-APACHE +201 -0
  441. package/binary/licenses/supplemental/rust-bumpalo-3.20.3/LICENSE-MIT +25 -0
  442. package/binary/licenses/supplemental/rust-byteorder-1.5.0/COPYING +3 -0
  443. package/binary/licenses/supplemental/rust-byteorder-1.5.0/LICENSE-MIT +21 -0
  444. package/binary/licenses/supplemental/rust-calamine-0.36.0/LICENSE-MIT.md +23 -0
  445. package/binary/licenses/supplemental/rust-cc-1.2.64/LICENSE-APACHE +201 -0
  446. package/binary/licenses/supplemental/rust-cc-1.2.64/LICENSE-MIT +25 -0
  447. package/binary/licenses/supplemental/rust-cfg-if-1.0.4/LICENSE-APACHE +201 -0
  448. package/binary/licenses/supplemental/rust-cfg-if-1.0.4/LICENSE-MIT +25 -0
  449. package/binary/licenses/supplemental/rust-chrono-0.4.45/LICENSE.txt +240 -0
  450. package/binary/licenses/supplemental/rust-codepage-0.1.2/COPYRIGHT +9 -0
  451. package/binary/licenses/supplemental/rust-codepage-0.1.2/LICENSE-APACHE +202 -0
  452. package/binary/licenses/supplemental/rust-codepage-0.1.2/LICENSE-MIT +25 -0
  453. package/binary/licenses/supplemental/rust-core-foundation-sys-0.8.7/LICENSE-APACHE +201 -0
  454. package/binary/licenses/supplemental/rust-core-foundation-sys-0.8.7/LICENSE-MIT +25 -0
  455. package/binary/licenses/supplemental/rust-crc32fast-1.5.0/LICENSE-APACHE +202 -0
  456. package/binary/licenses/supplemental/rust-crc32fast-1.5.0/LICENSE-MIT +21 -0
  457. package/binary/licenses/supplemental/rust-debug_unsafe-0.1.4/LICENSE-APACHE +201 -0
  458. package/binary/licenses/supplemental/rust-debug_unsafe-0.1.4/LICENSE-MIT +25 -0
  459. package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/COPYRIGHT +17 -0
  460. package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-APACHE +202 -0
  461. package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-MIT +25 -0
  462. package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-WHATWG +26 -0
  463. package/binary/licenses/supplemental/rust-equivalent-1.0.2/LICENSE-APACHE +201 -0
  464. package/binary/licenses/supplemental/rust-equivalent-1.0.2/LICENSE-MIT +25 -0
  465. package/binary/licenses/supplemental/rust-fast-float2-0.2.3/LICENSE-APACHE +201 -0
  466. package/binary/licenses/supplemental/rust-fast-float2-0.2.3/LICENSE-MIT +23 -0
  467. package/binary/licenses/supplemental/rust-find-msvc-tools-0.1.9/LICENSE-APACHE +201 -0
  468. package/binary/licenses/supplemental/rust-find-msvc-tools-0.1.9/LICENSE-MIT +25 -0
  469. package/binary/licenses/supplemental/rust-flate2-1.1.9/LICENSE-APACHE +201 -0
  470. package/binary/licenses/supplemental/rust-flate2-1.1.9/LICENSE-MIT +25 -0
  471. package/binary/licenses/supplemental/rust-futures-core-0.3.32/LICENSE-APACHE +202 -0
  472. package/binary/licenses/supplemental/rust-futures-core-0.3.32/LICENSE-MIT +26 -0
  473. package/binary/licenses/supplemental/rust-futures-task-0.3.32/LICENSE-APACHE +202 -0
  474. package/binary/licenses/supplemental/rust-futures-task-0.3.32/LICENSE-MIT +26 -0
  475. package/binary/licenses/supplemental/rust-futures-util-0.3.32/LICENSE-APACHE +202 -0
  476. package/binary/licenses/supplemental/rust-futures-util-0.3.32/LICENSE-MIT +26 -0
  477. package/binary/licenses/supplemental/rust-hashbrown-0.17.1/LICENSE-APACHE +201 -0
  478. package/binary/licenses/supplemental/rust-hashbrown-0.17.1/LICENSE-MIT +25 -0
  479. package/binary/licenses/supplemental/rust-heck-0.5.0/LICENSE-APACHE +201 -0
  480. package/binary/licenses/supplemental/rust-heck-0.5.0/LICENSE-MIT +25 -0
  481. package/binary/licenses/supplemental/rust-iana-time-zone-0.1.65/LICENSE-APACHE +201 -0
  482. package/binary/licenses/supplemental/rust-iana-time-zone-0.1.65/LICENSE-MIT +25 -0
  483. package/binary/licenses/supplemental/rust-iana-time-zone-haiku-0.1.2/LICENSE-APACHE +201 -0
  484. package/binary/licenses/supplemental/rust-iana-time-zone-haiku-0.1.2/LICENSE-MIT +25 -0
  485. package/binary/licenses/supplemental/rust-indexmap-2.14.0/LICENSE-APACHE +201 -0
  486. package/binary/licenses/supplemental/rust-indexmap-2.14.0/LICENSE-MIT +25 -0
  487. package/binary/licenses/supplemental/rust-js-sys-0.3.102/LICENSE-APACHE +201 -0
  488. package/binary/licenses/supplemental/rust-js-sys-0.3.102/LICENSE-MIT +25 -0
  489. package/binary/licenses/supplemental/rust-libc-0.2.186/LICENSE-APACHE +176 -0
  490. package/binary/licenses/supplemental/rust-libc-0.2.186/LICENSE-MIT +25 -0
  491. package/binary/licenses/supplemental/rust-log-0.4.32/LICENSE-APACHE +201 -0
  492. package/binary/licenses/supplemental/rust-log-0.4.32/LICENSE-MIT +25 -0
  493. package/binary/licenses/supplemental/rust-memchr-2.8.2/COPYING +3 -0
  494. package/binary/licenses/supplemental/rust-memchr-2.8.2/LICENSE-MIT +21 -0
  495. package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE +25 -0
  496. package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-APACHE.md +177 -0
  497. package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-MIT.md +24 -0
  498. package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-ZLIB.md +14 -0
  499. package/binary/licenses/supplemental/rust-num-traits-0.2.19/LICENSE-APACHE +201 -0
  500. package/binary/licenses/supplemental/rust-num-traits-0.2.19/LICENSE-MIT +25 -0
  501. package/binary/licenses/supplemental/rust-once_cell-1.21.4/LICENSE-APACHE +201 -0
  502. package/binary/licenses/supplemental/rust-once_cell-1.21.4/LICENSE-MIT +23 -0
  503. package/binary/licenses/supplemental/rust-pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
  504. package/binary/licenses/supplemental/rust-pin-project-lite-0.2.17/LICENSE-MIT +23 -0
  505. package/binary/licenses/supplemental/rust-portable-atomic-1.13.1/LICENSE-APACHE +177 -0
  506. package/binary/licenses/supplemental/rust-portable-atomic-1.13.1/LICENSE-MIT +23 -0
  507. package/binary/licenses/supplemental/rust-proc-macro2-1.0.106/LICENSE-APACHE +176 -0
  508. package/binary/licenses/supplemental/rust-proc-macro2-1.0.106/LICENSE-MIT +23 -0
  509. package/binary/licenses/supplemental/rust-pyo3-0.29.0/LICENSE-APACHE +178 -0
  510. package/binary/licenses/supplemental/rust-pyo3-0.29.0/LICENSE-MIT +25 -0
  511. package/binary/licenses/supplemental/rust-pyo3-0.29.0/pyo3-runtime/LICENSE-APACHE +178 -0
  512. package/binary/licenses/supplemental/rust-pyo3-0.29.0/pyo3-runtime/LICENSE-MIT +25 -0
  513. package/binary/licenses/supplemental/rust-pyo3-build-config-0.29.0/LICENSE-APACHE +178 -0
  514. package/binary/licenses/supplemental/rust-pyo3-build-config-0.29.0/LICENSE-MIT +25 -0
  515. package/binary/licenses/supplemental/rust-pyo3-ffi-0.29.0/LICENSE-APACHE +178 -0
  516. package/binary/licenses/supplemental/rust-pyo3-ffi-0.29.0/LICENSE-MIT +25 -0
  517. package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/Cargo.toml +14 -0
  518. package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/README.md +90 -0
  519. package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/declared-license/Apache-2.0.txt +73 -0
  520. package/binary/licenses/supplemental/rust-pyo3-macros-0.29.0/LICENSE-APACHE +178 -0
  521. package/binary/licenses/supplemental/rust-pyo3-macros-0.29.0/LICENSE-MIT +25 -0
  522. package/binary/licenses/supplemental/rust-pyo3-macros-backend-0.29.0/LICENSE-APACHE +178 -0
  523. package/binary/licenses/supplemental/rust-pyo3-macros-backend-0.29.0/LICENSE-MIT +25 -0
  524. package/binary/licenses/supplemental/rust-quick-xml-0.41.0/LICENSE-MIT.md +23 -0
  525. package/binary/licenses/supplemental/rust-quote-1.0.45/LICENSE-APACHE +176 -0
  526. package/binary/licenses/supplemental/rust-quote-1.0.45/LICENSE-MIT +23 -0
  527. package/binary/licenses/supplemental/rust-rustversion-1.0.22/LICENSE-APACHE +176 -0
  528. package/binary/licenses/supplemental/rust-rustversion-1.0.22/LICENSE-MIT +23 -0
  529. package/binary/licenses/supplemental/rust-serde-1.0.228/LICENSE-APACHE +176 -0
  530. package/binary/licenses/supplemental/rust-serde-1.0.228/LICENSE-MIT +23 -0
  531. package/binary/licenses/supplemental/rust-serde_core-1.0.228/LICENSE-APACHE +176 -0
  532. package/binary/licenses/supplemental/rust-serde_core-1.0.228/LICENSE-MIT +23 -0
  533. package/binary/licenses/supplemental/rust-serde_derive-1.0.228/LICENSE-APACHE +176 -0
  534. package/binary/licenses/supplemental/rust-serde_derive-1.0.228/LICENSE-MIT +23 -0
  535. package/binary/licenses/supplemental/rust-shlex-2.0.1/LICENSE-APACHE +13 -0
  536. package/binary/licenses/supplemental/rust-shlex-2.0.1/LICENSE-MIT +21 -0
  537. package/binary/licenses/supplemental/rust-simd-adler32-0.3.9/LICENSE.md +21 -0
  538. package/binary/licenses/supplemental/rust-slab-0.4.12/LICENSE +25 -0
  539. package/binary/licenses/supplemental/rust-syn-2.0.118/LICENSE-APACHE +176 -0
  540. package/binary/licenses/supplemental/rust-syn-2.0.118/LICENSE-MIT +23 -0
  541. package/binary/licenses/supplemental/rust-target-lexicon-0.13.5/LICENSE +220 -0
  542. package/binary/licenses/supplemental/rust-typed-path-0.12.3/LICENSE-APACHE +176 -0
  543. package/binary/licenses/supplemental/rust-typed-path-0.12.3/LICENSE-MIT +23 -0
  544. package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-APACHE +176 -0
  545. package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-MIT +23 -0
  546. package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-UNICODE +39 -0
  547. package/binary/licenses/supplemental/rust-wasm-bindgen-0.2.125/LICENSE-APACHE +201 -0
  548. package/binary/licenses/supplemental/rust-wasm-bindgen-0.2.125/LICENSE-MIT +25 -0
  549. package/binary/licenses/supplemental/rust-wasm-bindgen-macro-0.2.125/LICENSE-APACHE +201 -0
  550. package/binary/licenses/supplemental/rust-wasm-bindgen-macro-0.2.125/LICENSE-MIT +25 -0
  551. package/binary/licenses/supplemental/rust-wasm-bindgen-macro-support-0.2.125/LICENSE-APACHE +201 -0
  552. package/binary/licenses/supplemental/rust-wasm-bindgen-macro-support-0.2.125/LICENSE-MIT +25 -0
  553. package/binary/licenses/supplemental/rust-wasm-bindgen-shared-0.2.125/LICENSE-APACHE +201 -0
  554. package/binary/licenses/supplemental/rust-wasm-bindgen-shared-0.2.125/LICENSE-MIT +25 -0
  555. package/binary/licenses/supplemental/rust-windows-core-0.62.2/license-apache-2.0 +201 -0
  556. package/binary/licenses/supplemental/rust-windows-core-0.62.2/license-mit +21 -0
  557. package/binary/licenses/supplemental/rust-windows-implement-0.60.2/license-apache-2.0 +201 -0
  558. package/binary/licenses/supplemental/rust-windows-implement-0.60.2/license-mit +21 -0
  559. package/binary/licenses/supplemental/rust-windows-interface-0.59.3/license-apache-2.0 +201 -0
  560. package/binary/licenses/supplemental/rust-windows-interface-0.59.3/license-mit +21 -0
  561. package/binary/licenses/supplemental/rust-windows-link-0.2.1/license-apache-2.0 +201 -0
  562. package/binary/licenses/supplemental/rust-windows-link-0.2.1/license-mit +21 -0
  563. package/binary/licenses/supplemental/rust-windows-result-0.4.1/license-apache-2.0 +201 -0
  564. package/binary/licenses/supplemental/rust-windows-result-0.4.1/license-mit +21 -0
  565. package/binary/licenses/supplemental/rust-windows-strings-0.5.1/license-apache-2.0 +201 -0
  566. package/binary/licenses/supplemental/rust-windows-strings-0.5.1/license-mit +21 -0
  567. package/binary/licenses/supplemental/rust-zip-8.6.0/LICENSE +21 -0
  568. package/binary/licenses/supplemental/rust-zlib-rs-0.6.3/LICENSE +19 -0
  569. package/binary/licenses/supplemental/rust-zopfli-0.8.3/COPYING +201 -0
  570. package/binary/licenses/supplemental/selectolax-0.4.13/LICENSE +10 -0
  571. package/binary/licenses/supplemental/selectolax-0.4.13/lexbor/LICENSE +223 -0
  572. package/binary/licenses/supplemental/selectolax-0.4.13/lexbor/NOTICE +16 -0
  573. package/binary/version.json +6 -0
  574. package/native-manifest.json +4474 -0
  575. package/native-verification.json +338 -0
  576. package/package.json +27 -4
@@ -0,0 +1,1046 @@
1
+ from cpython.bool cimport bool
2
+ from cpython.exc cimport PyErr_SetObject
3
+ from cpython.mem cimport (
4
+ PyMem_RawCalloc,
5
+ PyMem_RawFree,
6
+ PyMem_RawMalloc,
7
+ PyMem_RawRealloc
8
+ )
9
+ from enum import IntFlag
10
+
11
+ _ENCODING = 'UTF-8'
12
+
13
+ include "base.pxi"
14
+ include "utils.pxi"
15
+ include "lexbor/attrs.pxi"
16
+ include "lexbor/node.pxi"
17
+ include "lexbor/selection.pxi"
18
+ include "lexbor/util.pxi"
19
+ include "lexbor/node_remove.pxi"
20
+ include "lexbor/fragment_lookup.pxi"
21
+
22
+
23
+ class LexborDocumentOptions(IntFlag):
24
+ """Parser options for the Lexbor document.
25
+
26
+ These mirror the ``lxb_dom_document_opt`` flags from Lexbor.
27
+
28
+ Multiple options can be combined with the bitwise OR operator, or by
29
+ combining their integer values. Both of the following are equivalent:
30
+
31
+ >>> LexborDocumentOptions.WO_EVENTS | LexborDocumentOptions.UNDEF
32
+ >>> LexborDocumentOptions.WO_EVENTS.value | LexborDocumentOptions.UNDEF.value
33
+ 1
34
+
35
+ The combined value can be passed directly to the parser::
36
+
37
+ LexborHTMLParser(html, options=LexborDocumentOptions.WO_EVENTS)
38
+ """
39
+
40
+ """Original Lexbor name: ``LXB_DOM_DOCUMENT_OPT_UNDEF``.
41
+
42
+ Default value. No options are set.
43
+ """
44
+ UNDEF = 0x00
45
+
46
+ """Original Lexbor name: ``LXB_DOM_DOCUMENT_OPT_WO_EVENTS``.
47
+
48
+ Disables mutation events ("without events"). When set, Lexbor skips the
49
+ document mutation callbacks (``inserted``, ``removed``, ``moved``,
50
+ ``children_changed``, ``connected``, and the attribute callbacks) while
51
+ building or modifying the tree. This can speed up parsing, but it also
52
+ disables behaviors implemented through those callbacks.
53
+
54
+ For example, ``<selectedcontent>`` no longer receives a copy of the
55
+ selected ``<option>``::
56
+
57
+ html = (
58
+ "<select><button><selectedcontent></selectedcontent></button>"
59
+ "<option>a</option><option selected>b</option></select>"
60
+ )
61
+
62
+ LexborHTMLParser(html).css_first("selectedcontent").html
63
+ # '<selectedcontent>b</selectedcontent>'
64
+
65
+ LexborHTMLParser(
66
+ html, options=LexborDocumentOptions.WO_EVENTS
67
+ ).css_first("selectedcontent").html
68
+ # '<selectedcontent></selectedcontent>'
69
+ """
70
+ WO_EVENTS = 1 << 0
71
+
72
+
73
+ cdef lxb_dom_node_t* _clone_node_into_document(
74
+ lxb_html_document_t* document, lxb_dom_node_t* node
75
+ ) except NULL:
76
+ """Deep-copy ``node`` into ``document`` and append it as its child."""
77
+ cdef lxb_dom_node_t* cloned
78
+
79
+ with nogil:
80
+ cloned = lxb_dom_document_import_node(
81
+ &document.dom_document, node, <bint> True
82
+ )
83
+
84
+ if cloned == NULL:
85
+ raise SelectolaxError("Can't create a new document")
86
+
87
+ with nogil:
88
+ lxb_dom_node_insert_child(<lxb_dom_node_t * > document, cloned)
89
+
90
+ return cloned
91
+
92
+
93
+ # We don't inherit from HTMLParser here, because it also includes all the C code from Modest.
94
+ cdef class LexborHTMLParser:
95
+ """The lexbor HTML parser.
96
+
97
+ Use this class to parse raw HTML.
98
+
99
+ This parser mimics most of the stuff from ``HTMLParser`` but not inherits it directly.
100
+
101
+ Parameters
102
+ ----------
103
+
104
+ html : str (unicode) or bytes
105
+ """
106
+ def __init__(
107
+ self,
108
+ html: str | bytes,
109
+ is_fragment: bool = False,
110
+ fragment_tag: str = "div",
111
+ fragment_namespace: str = "html",
112
+ options: int = 0,
113
+ ):
114
+ """Create a parser and load HTML.
115
+
116
+ Parameters
117
+ ----------
118
+ html : str or bytes
119
+ HTML content to parse.
120
+ is_fragment : bool, optional
121
+ When ``False`` (default), the input is parsed as a full HTML document.
122
+ If the input is only a fragment, the parser still accepts it and inserts any missing required elements,
123
+ (such as `<html>`, `<head>`, and `<body>`) into the tree,
124
+ according to the HTML parsing rules in the HTML Standard.
125
+ This matches how browsers construct the DOM when they load an HTML page.
126
+
127
+ When ``True``, the input is parsed as an HTML fragment.
128
+ The parser does not insert any missing required HTML elements.
129
+ Behaves the same way as `DocumentFragment` in browsers.
130
+ When `<html>`, `<head>` or `<body>` are present, ignores them entirely.
131
+ As per the HTML Standard.
132
+ fragment_tag : str, optional
133
+ Context element tag used for fragment parsing. Defaults to ``"div"``.
134
+ Only used when ``is_fragment`` is ``True``.
135
+ fragment_namespace : str, optional
136
+ Context element namespace used for fragment parsing. Defaults to ``"html"``.
137
+ Accepts Lexbor namespace names such as ``"html"``, ``"svg"``, and ``"math"``,
138
+ or a namespace URI recognized by Lexbor. Only used when ``is_fragment`` is ``True``.
139
+ options : int, optional
140
+ Lexbor document options passed to ``lxb_html_document_dom_opt_set``.
141
+ Use the flags from :class:`LexborDocumentOptions`, e.g.
142
+ ``LexborDocumentOptions.WO_EVENTS`` to disable mutation events.
143
+
144
+ Several options can be combined with the bitwise OR operator::
145
+
146
+ LexborDocumentOptions.WO_EVENTS | LexborDocumentOptions.UNDEF
147
+
148
+ or by passing the equivalent plain integer::
149
+
150
+ LexborDocumentOptions.WO_EVENTS.value | LexborDocumentOptions.UNDEF.value
151
+
152
+ Defaults to ``0``.
153
+
154
+ """
155
+ cdef size_t html_len
156
+ cdef object bytes_html
157
+
158
+ self._is_fragment = is_fragment
159
+ self._fragment_wrapper = NULL
160
+ self._fragment_root = NULL
161
+ self._fragment_tag_id = LXB_TAG_DIV
162
+ self._fragment_namespace_id = LXB_NS_HTML
163
+ self._selector = None
164
+ self._new_html_document()
165
+ lxb_html_document_dom_opt_set(self.document, <lxb_dom_document_opt_t> int(options))
166
+
167
+ if self._is_fragment:
168
+ self._fragment_tag_id = _fragment_tag_id_from_string(self.document, fragment_tag)
169
+ self._fragment_namespace_id = _fragment_namespace_id_from_string(self.document, fragment_namespace)
170
+ bytes_html, html_len = preprocess_input(html)
171
+ self._parse_html(bytes_html, html_len)
172
+ self.raw_html = bytes_html
173
+
174
+ cdef inline void _new_html_document(self):
175
+ """Initialize a fresh Lexbor HTML document.
176
+
177
+ Returns
178
+ -------
179
+ None
180
+
181
+ Raises
182
+ ------
183
+ SelectolaxError
184
+ If the underlying Lexbor document cannot be created.
185
+ """
186
+ with nogil:
187
+ self.document = lxb_html_document_create()
188
+
189
+ if self.document == NULL:
190
+ PyErr_SetObject(SelectolaxError, "Failed to initialize object for HTML Document.")
191
+
192
+ cdef int _parse_html(self, char *html, size_t html_len) except -1:
193
+ """Parse HTML content into the internal document.
194
+
195
+ Parameters
196
+ ----------
197
+ html : char *
198
+ Pointer to UTF-8 encoded HTML bytes.
199
+ html_len : size_t
200
+ Length of the HTML buffer.
201
+
202
+ Returns
203
+ -------
204
+ int
205
+ ``0`` on success; ``-1`` when parsing fails.
206
+
207
+ Raises
208
+ ------
209
+ SelectolaxError
210
+ If Lexbor returns a non-OK status.
211
+ RuntimeError
212
+ If the internal document is ``NULL`` after a successful parse.
213
+ """
214
+ cdef lxb_status_t status
215
+
216
+ if self.document == NULL:
217
+ return -1
218
+
219
+ with nogil:
220
+ if self._is_fragment:
221
+ status = self._parse_html_fragment(html, html_len)
222
+ else:
223
+ status = self._parse_html_document(html, html_len)
224
+
225
+ if status != LXB_STATUS_OK:
226
+ PyErr_SetObject(SelectolaxError, "Can't parse HTML.")
227
+ return -1
228
+
229
+ if self.document == NULL:
230
+ PyErr_SetObject(RuntimeError, "document is NULL even after html was parsed correctly")
231
+ return -1
232
+ return 0
233
+
234
+ cdef inline lxb_status_t _parse_html_document(self, char *html, size_t html_len) nogil:
235
+ """Parse HTML as a full HTML document.
236
+ If the input is only a fragment, the parser still accepts it and inserts any missing required elements,
237
+ (such as `<html>`, `<head>`, and `<body>`) into the tree,
238
+ according to the HTML parsing rules in the HTML Standard.
239
+ This matches how browsers construct the DOM when they load an HTML page.
240
+
241
+ Parameters
242
+ ----------
243
+ html : char *
244
+ Pointer to UTF-8 encoded HTML bytes.
245
+ html_len : size_t
246
+ Length of the HTML buffer.
247
+
248
+ Returns
249
+ -------
250
+ lxb_status_t
251
+ Lexbor status code produced by ``lxb_html_document_parse``.
252
+ """
253
+ return lxb_html_document_parse(self.document, <lxb_char_t *> html, html_len)
254
+
255
+ cdef inline lxb_status_t _parse_html_fragment(self, char *html, size_t html_len) nogil:
256
+ """Parse HTML as an HTML fragment.
257
+ The parser does not insert any missing required HTML elements.
258
+
259
+ Parameters
260
+ ----------
261
+ html : char *
262
+ Pointer to UTF-8 encoded HTML bytes.
263
+ html_len : size_t
264
+ Length of the HTML buffer.
265
+
266
+ Returns
267
+ -------
268
+ lxb_status_t
269
+ Lexbor status code; ``LXB_STATUS_OK`` when parsing the fragment succeeded.
270
+ """
271
+ cdef lxb_html_parser_t *parser = NULL
272
+ cdef lxb_dom_node_t *fragment_html_node = NULL
273
+ cdef lxb_status_t status = LXB_STATUS_OK
274
+
275
+ parser = lxb_html_parser_create()
276
+ if parser == NULL:
277
+ return LXB_STATUS_ERROR_MEMORY_ALLOCATION
278
+
279
+ status = lxb_html_parser_init(parser)
280
+ if status != LXB_STATUS_OK:
281
+ lxb_html_parser_destroy(parser)
282
+ return status
283
+
284
+ fragment_html_node = lxb_html_parse_fragment_by_tag_id(
285
+ parser,
286
+ self.document,
287
+ self._fragment_tag_id,
288
+ self._fragment_namespace_id,
289
+ <lxb_char_t *> html,
290
+ html_len
291
+ )
292
+ if fragment_html_node == NULL:
293
+ status = parser.status
294
+ lxb_html_parser_destroy(parser)
295
+ if status == LXB_STATUS_OK:
296
+ return LXB_STATUS_ERROR
297
+ return status
298
+
299
+ self._fragment_wrapper = fragment_html_node
300
+ self._fragment_root = fragment_html_node.first_child
301
+ lxb_html_parser_destroy(parser)
302
+ return LXB_STATUS_OK
303
+
304
+ def __dealloc__(self):
305
+ """Release the underlying Lexbor HTML document.
306
+
307
+ Returns
308
+ -------
309
+ None
310
+
311
+ Notes
312
+ -----
313
+ Safe to call multiple times; does nothing if the document is already
314
+ freed.
315
+ """
316
+ if self.document != NULL:
317
+ lxb_html_document_destroy(self.document)
318
+
319
+ def __repr__(self):
320
+ """Return a concise representation of the parsed document.
321
+
322
+ Returns
323
+ -------
324
+ str
325
+ A string showing the number of characters in the parsed HTML.
326
+ """
327
+ html_len = len(self.root.html if self.root is not None else "")
328
+ return f"<LexborHTMLParser chars='{html_len}'>"
329
+
330
+ @property
331
+ def selector(self):
332
+ """Return a lazily created CSS selector helper.
333
+
334
+ Returns
335
+ -------
336
+ LexborCSSSelector
337
+ Selector instance bound to this parser.
338
+ """
339
+ if self._selector is None:
340
+ self._selector = LexborCSSSelector()
341
+ return self._selector
342
+
343
+ @property
344
+ def options(self):
345
+ """Return the Lexbor document options for this parser.
346
+
347
+ Returns
348
+ -------
349
+ LexborDocumentOptions
350
+ The options currently set on the underlying Lexbor document.
351
+ """
352
+ return LexborDocumentOptions(lxb_html_document_dom_opt(self.document))
353
+
354
+ @property
355
+ def root(self):
356
+ """Return the document root node.
357
+
358
+ Returns
359
+ -------
360
+ LexborNode or None
361
+ Root of the parsed document, or ``None`` if unavailable.
362
+ """
363
+ if self.document == NULL:
364
+ return None
365
+ cdef LexborNode node
366
+ cdef lxb_dom_node_t* dom_root
367
+ if self._is_fragment and self._fragment_root != NULL:
368
+ dom_root = self._fragment_root
369
+ else:
370
+ dom_root = lxb_dom_document_root(&self.document.dom_document)
371
+ if dom_root == NULL:
372
+ return None
373
+ node = LexborNode.new(dom_root, self)
374
+ if self._is_fragment:
375
+ node.set_as_fragment_root()
376
+ return node
377
+
378
+ @property
379
+ def body(self):
380
+ """Return document body.
381
+
382
+ Returns
383
+ -------
384
+ LexborNode or None
385
+ ``<body>`` element when present, otherwise ``None``.
386
+ """
387
+ cdef lxb_html_body_element_t* body
388
+ body = lxb_html_document_body_element_noi(self.document)
389
+ if body == NULL:
390
+ return None
391
+ return LexborNode.new(<lxb_dom_node_t *> body, self)
392
+
393
+ @property
394
+ def head(self):
395
+ """Return document head.
396
+
397
+ Returns
398
+ -------
399
+ LexborNode or None
400
+ ``<head>`` element when present, otherwise ``None``.
401
+ """
402
+ cdef lxb_html_head_element_t* head
403
+ head = lxb_html_document_head_element_noi(self.document)
404
+ if head == NULL:
405
+ return None
406
+ return LexborNode.new(<lxb_dom_node_t *> head, self)
407
+
408
+ def tags(self, str name):
409
+ """Return all tags that match the provided name.
410
+
411
+ Parameters
412
+ ----------
413
+ name : str
414
+ Tag name to search for (e.g., ``"div"``).
415
+
416
+ Returns
417
+ -------
418
+ list of LexborNode
419
+ Matching elements in document order.
420
+
421
+ Raises
422
+ ------
423
+ ValueError
424
+ If ``name`` is empty or longer than 100 characters.
425
+ SelectolaxError
426
+ If Lexbor cannot locate the elements.
427
+ """
428
+
429
+ if not name:
430
+ raise ValueError("Tag name cannot be empty")
431
+ if len(name) > 100:
432
+ raise ValueError("Tag name is too long")
433
+
434
+ cdef lxb_dom_collection_t* collection = NULL
435
+ cdef lxb_status_t status
436
+ pybyte_name = name.encode('UTF-8')
437
+
438
+ result = list()
439
+ collection = lxb_dom_collection_make(&self.document.dom_document, 128)
440
+
441
+ if collection == NULL:
442
+ return result
443
+ status = lxb_dom_elements_by_tag_name(
444
+ <lxb_dom_element_t *> self.document,
445
+ collection,
446
+ <lxb_char_t *> pybyte_name,
447
+ len(pybyte_name)
448
+ )
449
+ if status != 0x0000:
450
+ lxb_dom_collection_destroy(collection, <bint> True)
451
+ raise SelectolaxError("Can't locate elements.")
452
+
453
+ for i in range(lxb_dom_collection_length_noi(collection)):
454
+ node = LexborNode.new(
455
+ <lxb_dom_node_t*> lxb_dom_collection_element_noi(collection, i),
456
+ self
457
+ )
458
+ result.append(node)
459
+ lxb_dom_collection_destroy(collection, <bint> True)
460
+ return result
461
+
462
+ def text(
463
+ self,
464
+ deep: bool = True,
465
+ separator: str = "",
466
+ strip: bool = False,
467
+ skip_empty: bool = False,
468
+ ) -> str:
469
+ """Returns the text of the node including text of all its child nodes.
470
+
471
+ Parameters
472
+ ----------
473
+ strip : bool, default False
474
+ If true, calls ``str.strip()`` on each text part to remove extra white spaces.
475
+ separator : str, default ''
476
+ The separator to use when joining text from different nodes.
477
+ deep : bool, default True
478
+ If True, includes text from all child nodes.
479
+ skip_empty : bool, optional
480
+ Exclude text nodes whose content is only ASCII whitespace (space,
481
+ tab, newline, form feed or carriage return) when ``True``.
482
+ Defaults to ``False``.
483
+
484
+ Returns
485
+ -------
486
+ text : str
487
+ Combined textual content assembled according to the provided options.
488
+ """
489
+ if self.root is None:
490
+ return ""
491
+ return self.root.text(deep=deep, separator=separator, strip=strip, skip_empty=skip_empty)
492
+
493
+ @property
494
+ def html(self):
495
+ """Return HTML representation of the page.
496
+
497
+ Returns
498
+ -------
499
+ str or None
500
+ Serialized HTML of the current document.
501
+ """
502
+ if self.document == NULL:
503
+ return None
504
+ if self._is_fragment:
505
+ if self.root is None:
506
+ return ""
507
+ return self.root.html
508
+ node = LexborNode.new(<lxb_dom_node_t *> &self.document.dom_document, self)
509
+ return node.html
510
+
511
+ def html_pretty(
512
+ self,
513
+ Py_ssize_t indent=0,
514
+ bint skip_ws_nodes=False,
515
+ bint skip_comment=False,
516
+ bint raw=False,
517
+ bint without_closing=False,
518
+ bint tag_with_ns=False,
519
+ bint without_text_indent=False,
520
+ bint full_doctype=False,
521
+ bint html5test=False,
522
+ ):
523
+ """Return pretty-printed HTML representation of the page.
524
+
525
+ Parameters
526
+ ----------
527
+ indent : int, optional
528
+ Initial indentation level passed to Lexbor. Defaults to ``0``.
529
+ skip_ws_nodes : bool, optional
530
+ Skip text nodes that contain only whitespace.
531
+ skip_comment : bool, optional
532
+ Exclude HTML comment nodes from the serialized output.
533
+ raw : bool, optional
534
+ Serialize text and attribute values without HTML escaping.
535
+ without_closing : bool, optional
536
+ Omit closing tags for non-void elements.
537
+ tag_with_ns : bool, optional
538
+ Include namespace prefixes in serialized tag names when available.
539
+ without_text_indent : bool, optional
540
+ Disable extra indentation added around text and comment content.
541
+ full_doctype : bool, optional
542
+ Serialize the full document type declaration when a doctype node is present.
543
+ html5test : bool, optional
544
+ Serialize using Lexbor's HTML5 test formatting mode.
545
+ """
546
+ cdef lxb_html_serialize_opt_t options
547
+ if self.document == NULL:
548
+ return None
549
+ if indent < 0:
550
+ raise ValueError("indent must be greater than or equal to 0")
551
+ options = _html_pretty_options(
552
+ skip_ws_nodes,
553
+ skip_comment,
554
+ raw,
555
+ without_closing,
556
+ tag_with_ns,
557
+ without_text_indent,
558
+ full_doctype,
559
+ html5test,
560
+ )
561
+ if self._is_fragment:
562
+ if self.root is None:
563
+ return None
564
+ return self.root.html_pretty(
565
+ indent=indent,
566
+ skip_ws_nodes=skip_ws_nodes,
567
+ skip_comment=skip_comment,
568
+ raw=raw,
569
+ without_closing=without_closing,
570
+ tag_with_ns=tag_with_ns,
571
+ without_text_indent=without_text_indent,
572
+ full_doctype=full_doctype,
573
+ html5test=html5test,
574
+ )
575
+ node = LexborNode.new(<lxb_dom_node_t *> &self.document.dom_document, self)
576
+ return node._serialize_html(options, <size_t> indent, True)
577
+
578
+ def css(self, str query):
579
+ """A CSS selector.
580
+
581
+ Matches pattern `query` against HTML tree.
582
+ `CSS selectors reference <https://www.w3schools.com/cssref/css_selectors.asp>`_.
583
+
584
+ Special selectors:
585
+
586
+ - parser.css('p:lexbor-contains("awesome" i)') -- case-insensitive contains
587
+ - parser.css('p:lexbor-contains("awesome")') -- case-sensitive contains
588
+
589
+ Parameters
590
+ ----------
591
+ query : str
592
+ CSS selector (e.g. "div > :nth-child(2n+1):not(:has(a))").
593
+
594
+ Returns
595
+ -------
596
+ selector : list of `Node` objects
597
+ """
598
+ return self.root.css(query)
599
+
600
+ def css_first(self, str query, default=None, strict=False):
601
+ """Same as `css` but returns only the first match.
602
+
603
+ Parameters
604
+ ----------
605
+
606
+ query : str
607
+ default : Any, default None
608
+ Default value to return if there is no match.
609
+ strict: bool, default False
610
+ Set to True if you want to check if there is strictly only one match in the document.
611
+
612
+
613
+ Returns
614
+ -------
615
+ selector : `LexborNode` object
616
+ """
617
+ return self.root.css_first(query, default, strict)
618
+
619
+ def strip_tags(self, list tags, bool recursive = False):
620
+ """Remove specified tags from the node.
621
+
622
+ Parameters
623
+ ----------
624
+ tags : list of str
625
+ List of tags to remove.
626
+ recursive : bool, default False
627
+ Whenever to delete all its child nodes
628
+
629
+ Examples
630
+ --------
631
+
632
+ >>> tree = LexborHTMLParser('<html><head></head><body><script></script><div>Hello world!</div></body></html>')
633
+ >>> tags = ['head', 'style', 'script', 'xmp', 'iframe', 'noembed', 'noframes']
634
+ >>> tree.strip_tags(tags)
635
+ >>> tree.html
636
+ '<html><body><div>Hello world!</div></body></html>'
637
+
638
+ Returns
639
+ -------
640
+ None
641
+ """
642
+ cdef lxb_dom_collection_t* collection = NULL
643
+ cdef lxb_status_t status
644
+
645
+ for tag in tags:
646
+ pybyte_name = tag.encode('UTF-8')
647
+
648
+ collection = lxb_dom_collection_make(&self.document.dom_document, 128)
649
+
650
+ if collection == NULL:
651
+ raise SelectolaxError("Can't initialize DOM collection.")
652
+
653
+ status = lxb_dom_elements_by_tag_name(
654
+ <lxb_dom_element_t *> self.document,
655
+ collection,
656
+ <lxb_char_t *> pybyte_name,
657
+ len(pybyte_name)
658
+ )
659
+ if status != 0x0000:
660
+ lxb_dom_collection_destroy(collection, <bint> True)
661
+ raise SelectolaxError("Can't locate elements.")
662
+
663
+ for i in range(lxb_dom_collection_length_noi(collection)):
664
+ if recursive:
665
+ node_remove_deep(<lxb_dom_node_t *> lxb_dom_collection_element_noi(collection, i))
666
+ else:
667
+ lxb_dom_node_remove(<lxb_dom_node_t *> lxb_dom_collection_element_noi(collection, i))
668
+ lxb_dom_collection_destroy(collection, <bint> True)
669
+
670
+ def select(self, query=None):
671
+ """Select nodes given a CSS selector.
672
+
673
+ Works similarly to the ``css`` method, but supports chained filtering and extra features.
674
+
675
+ Parameters
676
+ ----------
677
+ query : str or None
678
+ The CSS selector to use when searching for nodes.
679
+
680
+ Returns
681
+ -------
682
+ LexborSelector or None
683
+ Selector bound to the root node, or ``None`` if the document is empty.
684
+ """
685
+ cdef LexborNode node
686
+ node = self.root
687
+ if node:
688
+ return LexborSelector(node, query)
689
+ return None
690
+
691
+ def any_css_matches(self, tuple selectors):
692
+ """Return ``True`` if any of the specified CSS selectors match.
693
+
694
+ Parameters
695
+ ----------
696
+ selectors : tuple[str]
697
+ CSS selectors to evaluate.
698
+
699
+ Returns
700
+ -------
701
+ bool
702
+ ``True`` when at least one selector matches.
703
+ """
704
+ return self.root.any_css_matches(selectors)
705
+
706
+ def scripts_contain(self, str query):
707
+ """Return ``True`` if any script tag contains the given text.
708
+
709
+ Caches script tags on the first call to improve performance.
710
+
711
+ Parameters
712
+ ----------
713
+ query : str
714
+ Text to search for within script contents.
715
+
716
+ Returns
717
+ -------
718
+ bool
719
+ ``True`` when a matching script tag is found.
720
+ """
721
+ return self.root.scripts_contain(query)
722
+
723
+ def script_srcs_contain(self, tuple queries):
724
+ """Return ``True`` if any script ``src`` contains one of the strings.
725
+
726
+ Caches values on the first call to improve performance.
727
+
728
+ Parameters
729
+ ----------
730
+ queries : tuple of str
731
+ Strings to look for inside ``src`` attributes.
732
+
733
+ Returns
734
+ -------
735
+ bool
736
+ ``True`` when a matching source value is found.
737
+ """
738
+ return self.root.script_srcs_contain(queries)
739
+
740
+ def css_matches(self, str selector):
741
+ """Return ``True`` if the document matches the selector at least once.
742
+
743
+ Parameters
744
+ ----------
745
+ selector : str
746
+ CSS selector to test.
747
+
748
+ Returns
749
+ -------
750
+ bool
751
+ ``True`` when a match exists.
752
+ """
753
+ return self.root.css_matches(selector)
754
+
755
+ def merge_text_nodes(self):
756
+ """Iterates over all text nodes and merges all text nodes that are close to each other.
757
+
758
+ This is useful for text extraction.
759
+ Use it when you need to strip HTML tags and merge "dangling" text.
760
+
761
+ Examples
762
+ --------
763
+
764
+ >>> tree = LexborHTMLParser("<div><p><strong>J</strong>ohn</p><p>Doe</p></div>")
765
+ >>> node = tree.css_first('div')
766
+ >>> tree.unwrap_tags(["strong"])
767
+ >>> tree.text(deep=True, separator=" ", strip=True)
768
+ "J ohn Doe" # Text extraction produces an extra space because the strong tag was removed.
769
+ >>> node.merge_text_nodes()
770
+ >>> tree.text(deep=True, separator=" ", strip=True)
771
+ "John Doe"
772
+
773
+ Returns
774
+ -------
775
+ None
776
+ """
777
+ return self.root.merge_text_nodes()
778
+
779
+ @staticmethod
780
+ cdef LexborHTMLParser from_document(lxb_html_document_t *document, bytes raw_html):
781
+ """Construct a parser from an existing Lexbor document.
782
+
783
+ Parameters
784
+ ----------
785
+ document : lxb_html_document_t *
786
+ Borrowed pointer to an initialized Lexbor HTML document.
787
+ raw_html : bytes
788
+ Original HTML bytes backing the document.
789
+
790
+ Returns
791
+ -------
792
+ LexborHTMLParser
793
+ Parser instance wrapping the provided document.
794
+ """
795
+ obj = <LexborHTMLParser> LexborHTMLParser.__new__(LexborHTMLParser)
796
+ obj.document = document
797
+ obj.raw_html = raw_html
798
+ obj.cached_script_texts = None
799
+ obj.cached_script_srcs = None
800
+ obj._is_fragment = False
801
+ obj._fragment_wrapper = NULL
802
+ obj._fragment_root = NULL
803
+ obj._fragment_tag_id = LXB_TAG_DIV
804
+ obj._fragment_namespace_id = LXB_NS_HTML
805
+ obj._selector = None
806
+ return obj
807
+
808
+ def clone(self):
809
+ """Clone the current document tree.
810
+
811
+ You can use to do temporary modifications without affecting the original HTML tree.
812
+ It is tied to the current parser instance.
813
+ Gets destroyed when the parser instance is destroyed.
814
+ Document options are preserved in the cloned parser.
815
+ The document ``head`` and ``body`` are preserved when available.
816
+
817
+ Returns
818
+ -------
819
+ LexborHTMLParser
820
+ A parser instance backed by a deep-copied document.
821
+ """
822
+ cdef lxb_html_document_t* cloned_document
823
+ cdef lxb_dom_node_t* cloned_node
824
+ cdef lxb_dom_node_t* source_child
825
+ cdef lxb_dom_node_t* next_child
826
+ cdef lxb_dom_node_t* cloned_html
827
+ cdef lxb_dom_node_t* child
828
+ cdef LexborHTMLParser cls
829
+
830
+ with nogil:
831
+ cloned_document = lxb_html_document_create()
832
+
833
+ if cloned_document == NULL:
834
+ raise SelectolaxError("Can't create a new document")
835
+
836
+ lxb_html_document_dom_opt_set(
837
+ cloned_document, lxb_html_document_dom_opt(self.document)
838
+ )
839
+
840
+ cloned_document.ready_state = LXB_HTML_DOCUMENT_READY_STATE_COMPLETE
841
+
842
+ cloned_node = NULL
843
+ cloned_html = NULL
844
+
845
+ if self._is_fragment:
846
+ if self._fragment_wrapper != NULL and self._fragment_root != NULL:
847
+ cloned_node = _clone_node_into_document(
848
+ cloned_document, self._fragment_wrapper
849
+ )
850
+ else:
851
+ source_child = self.document.dom_document.node.first_child
852
+ while source_child != NULL:
853
+ next_child = source_child.next
854
+ cloned_node = _clone_node_into_document(cloned_document, source_child)
855
+ if cloned_html == NULL and lxb_dom_node_tag_id_noi(cloned_node) == LXB_TAG_HTML:
856
+ cloned_html = cloned_node
857
+ source_child = next_child
858
+
859
+ if cloned_html != NULL:
860
+ child = cloned_html.first_child
861
+ while child != NULL:
862
+ if lxb_dom_node_tag_id_noi(child) == LXB_TAG_HEAD:
863
+ cloned_document.head = <lxb_html_head_element_t *> child
864
+ elif lxb_dom_node_tag_id_noi(child) == LXB_TAG_BODY:
865
+ cloned_document.body = <lxb_html_body_element_t *> child
866
+ child = child.next
867
+
868
+ cls = LexborHTMLParser.from_document(cloned_document, self.raw_html)
869
+ if self._is_fragment:
870
+ cls._is_fragment = True
871
+ cls._fragment_tag_id = self._fragment_tag_id
872
+ cls._fragment_namespace_id = self._fragment_namespace_id
873
+ cls._fragment_wrapper = cloned_node
874
+ if cloned_node != NULL:
875
+ cls._fragment_root = cloned_node.first_child
876
+ return cls
877
+
878
+ def unwrap_tags(self, list tags, delete_empty = False):
879
+ """Unwraps specified tags from the HTML tree.
880
+
881
+ Works the same as the ``unwrap`` method, but applied to a list of tags.
882
+
883
+ Parameters
884
+ ----------
885
+ tags : list
886
+ List of tags to remove.
887
+ delete_empty : bool
888
+ Whenever to delete empty tags.
889
+
890
+ Examples
891
+ --------
892
+
893
+ >>> tree = LexborHTMLParser("<div><a href="">Hello</a> <i>world</i>!</div>")
894
+ >>> tree.body.unwrap_tags(['i','a'])
895
+ >>> tree.body.html
896
+ '<body><div>Hello world!</div></body>'
897
+
898
+ Returns
899
+ -------
900
+ None
901
+ """
902
+ # faster to check if the document is empty which should determine if we have a root
903
+ if self.document != NULL:
904
+ self.root.unwrap_tags(tags, delete_empty=delete_empty)
905
+
906
+ @property
907
+ def inner_html(self) -> str:
908
+ """Return HTML representation of the child nodes.
909
+
910
+ Works similar to innerHTML in JavaScript.
911
+ Unlike the `.html` property, does not include the current node.
912
+ Can be used to set HTML as well. See the setter docstring.
913
+
914
+ Returns
915
+ -------
916
+ text : str | None
917
+ """
918
+ return self.root.inner_html
919
+
920
+ @inner_html.setter
921
+ def inner_html(self, str html):
922
+ """Set inner HTML to the specified HTML.
923
+
924
+ Replaces existing data inside the node.
925
+ Works similar to innerHTML in JavaScript.
926
+
927
+ Parameters
928
+ ----------
929
+ html : str
930
+
931
+ Returns
932
+ -------
933
+ None
934
+ """
935
+ self.root.inner_html = html
936
+
937
+ def inner_html_pretty(
938
+ self,
939
+ Py_ssize_t indent=0,
940
+ bint skip_ws_nodes=False,
941
+ bint skip_comment=False,
942
+ bint raw=False,
943
+ bint without_closing=False,
944
+ bint tag_with_ns=False,
945
+ bint without_text_indent=False,
946
+ bint full_doctype=False,
947
+ bint html5test=False,
948
+ ):
949
+ """Return pretty-printed HTML representation of the child nodes.
950
+
951
+ Parameters
952
+ ----------
953
+ indent : int, optional
954
+ Initial indentation level passed to Lexbor. Defaults to ``0``.
955
+ skip_ws_nodes : bool, optional
956
+ Skip text nodes that contain only whitespace.
957
+ skip_comment : bool, optional
958
+ Exclude HTML comment nodes from the serialized output.
959
+ raw : bool, optional
960
+ Serialize text and attribute values without HTML escaping.
961
+ without_closing : bool, optional
962
+ Omit closing tags for non-void elements.
963
+ tag_with_ns : bool, optional
964
+ Include namespace prefixes in serialized tag names when available.
965
+ without_text_indent : bool, optional
966
+ Disable extra indentation added around text and comment content.
967
+ full_doctype : bool, optional
968
+ Serialize the full document type declaration when a doctype node is present.
969
+ html5test : bool, optional
970
+ Serialize using Lexbor's HTML5 test formatting mode.
971
+ """
972
+ if self.root is None:
973
+ return None
974
+ return self.root.inner_html_pretty(
975
+ indent=indent,
976
+ skip_ws_nodes=skip_ws_nodes,
977
+ skip_comment=skip_comment,
978
+ raw=raw,
979
+ without_closing=without_closing,
980
+ tag_with_ns=tag_with_ns,
981
+ without_text_indent=without_text_indent,
982
+ full_doctype=full_doctype,
983
+ html5test=html5test,
984
+ )
985
+
986
+ def create_node(self, str tag):
987
+ """Given an HTML tag name, e.g. `"div"`, create a single empty node for that tag,
988
+ e.g. `"<div></div>"`.
989
+
990
+ Parameters
991
+ ----------
992
+ tag : str
993
+ Name of the tag to create.
994
+
995
+ Returns
996
+ -------
997
+ LexborNode
998
+ Newly created element node.
999
+ Raises
1000
+ ------
1001
+ SelectolaxError
1002
+ If the element cannot be created.
1003
+
1004
+ Examples
1005
+ --------
1006
+ >>> parser = LexborHTMLParser("<div></div>")
1007
+ >>> new_node = parser.create_node("span")
1008
+ >>> new_node.tag_name
1009
+ 'span'
1010
+ >>> parser.css_first("div").append_child(new_node)
1011
+ >>> parser.html
1012
+ '<html><head></head><body><div><span></span></div></body></html>'
1013
+ """
1014
+ cdef lxb_html_element_t* element
1015
+ cdef lxb_dom_node_t* dom_node
1016
+ if not tag:
1017
+ raise SelectolaxError("Tag name cannot be empty")
1018
+ pybyte_name = tag.encode('UTF-8')
1019
+
1020
+ element = lxb_html_document_create_element(
1021
+ self.document,
1022
+ <const lxb_char_t *> pybyte_name,
1023
+ len(pybyte_name),
1024
+ NULL
1025
+ )
1026
+
1027
+ if element == NULL:
1028
+ raise SelectolaxError(f"Can't create element for tag '{tag}'")
1029
+
1030
+ dom_node = <lxb_dom_node_t *> element
1031
+
1032
+ return LexborNode.new(dom_node, self)
1033
+
1034
+ # Putting lexbor on python's heap is better than putting it
1035
+ # onto C's Heap, because python's Garbage collector can collect
1036
+ # this memory after use and has the bonus of gaining access to
1037
+ # mimalloc which python uses under the hood...
1038
+ if lexbor_memory_setup(
1039
+ PyMem_RawMalloc,
1040
+ PyMem_RawRealloc,
1041
+ PyMem_RawCalloc,
1042
+ PyMem_RawFree
1043
+ ) != LXB_STATUS_OK:
1044
+ # This will almost never happen due to the code in both the windows and posix versions
1045
+ # but if something were to happen this excecption on import should be triggered...
1046
+ raise SelectolaxError("Can't initalize allocators from lexbor_memory_setup(...)")