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.
- package/LICENSE +21 -0
- package/README.md +128 -2
- package/binary/_internal/PIL/_avif.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_imaging.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_imagingcms.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_imagingft.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_imagingmath.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_imagingtk.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/PIL/_webp.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/_cffi_backend.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/_quickjs.abi3.so +0 -0
- package/binary/_internal/base_library.zip +0 -0
- package/binary/_internal/brewdoc/_urljs/glue.js +858 -0
- package/binary/_internal/brewdoc/_vendor/THIRD_PARTY_NOTICES.txt +342 -0
- package/binary/_internal/brewdoc/_vendor/linkedom-worker.js +12650 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/INSTALLER +1 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/METADATA +157 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/RECORD +30 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/REQUESTED +0 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/WHEEL +4 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/direct_url.json +1 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/entry_points.txt +2 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/licenses/LICENSE +21 -0
- package/binary/_internal/brewdoc-0.3.2.dist-info/uv_cache.json +1 -0
- package/binary/_internal/cffi-2.1.1.dist-info/INSTALLER +1 -0
- package/binary/_internal/cffi-2.1.1.dist-info/METADATA +67 -0
- package/binary/_internal/cffi-2.1.1.dist-info/RECORD +34 -0
- package/binary/_internal/cffi-2.1.1.dist-info/REQUESTED +0 -0
- package/binary/_internal/cffi-2.1.1.dist-info/WHEEL +6 -0
- package/binary/_internal/cffi-2.1.1.dist-info/entry_points.txt +5 -0
- package/binary/_internal/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
- package/binary/_internal/cffi-2.1.1.dist-info/top_level.txt +2 -0
- package/binary/_internal/charset_normalizer/cd.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/charset_normalizer/md.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/INSTALLER +1 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/METADATA +892 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/RECORD +24 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/REQUESTED +0 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/WHEEL +7 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/entry_points.txt +2 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/licenses/LICENSE +21 -0
- package/binary/_internal/charset_normalizer-3.5.2.dist-info/top_level.txt +1 -0
- package/binary/_internal/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/INSTALLER +1 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/METADATA +111 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/RECORD +122 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/REQUESTED +0 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/WHEEL +5 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE.APACHE +202 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/licenses/LICENSE.BSD +27 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/sboms/cryptography-rust.cyclonedx.json +1365 -0
- package/binary/_internal/cryptography-50.0.2.dist-info/sboms/sbom.json +43 -0
- package/binary/_internal/libXau-154567c4.so.6.0.0 +0 -0
- package/binary/_internal/libavif-8a7f9d56.so.16.4.2 +0 -0
- package/binary/_internal/libbrotlicommon-53534446.so.1.2.0 +0 -0
- package/binary/_internal/libbrotlidec-7e5462ba.so.1.2.0 +0 -0
- package/binary/_internal/libfreetype-9fc94c80.so.6.20.6 +0 -0
- package/binary/_internal/libgcc_s.so.1 +0 -0
- package/binary/_internal/libharfbuzz-172d1f63.so.0.61421.0 +0 -0
- package/binary/_internal/libjpeg-31e2ca52.so.62.4.0 +0 -0
- package/binary/_internal/liblcms2-dade1fbf.so.2.0.19 +0 -0
- package/binary/_internal/liblzma-2be87c3e.so.5.8.3 +0 -0
- package/binary/_internal/libopenjp2-b07f72ad.so.2.5.4 +0 -0
- package/binary/_internal/libpng16-abb096d5.so.16.58.0 +0 -0
- package/binary/_internal/libpython3.12.so.1.0 +0 -0
- package/binary/_internal/libsharpyuv-0066295b.so.0.1.2 +0 -0
- package/binary/_internal/libstdc++.so.6 +0 -0
- package/binary/_internal/libtiff-fc87e79d.so.6.2.0 +0 -0
- package/binary/_internal/libwebp-51b0b3f7.so.7.2.0 +0 -0
- package/binary/_internal/libwebpdemux-9fe2abcc.so.2.0.17 +0 -0
- package/binary/_internal/libwebpmux-8fb1c9f6.so.3.1.2 +0 -0
- package/binary/_internal/libxcb-ad31f5a3.so.1.1.0 +0 -0
- package/binary/_internal/libz.so.1 +0 -0
- package/binary/_internal/libzstd-44be1190.so.1.5.7 +0 -0
- package/binary/_internal/pdfminer/cmap/78-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78ms-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/78ms-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/83pv-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/83pv-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90ms-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90ms-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90msp-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90msp-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90pv-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/90pv-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Add-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Add-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Add-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Add-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/B5pc-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/B5pc-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS1-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS1-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS2-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/CNS2-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETHK-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETHK-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETen-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETen-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETenms-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/ETenms-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Ext-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Ext-RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Ext-RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Ext-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GB-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GB-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GB-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GB-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBK-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBK-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBK2K-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBK2K-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBKp-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBKp-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBT-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBT-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBT-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBT-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBTpc-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBTpc-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBpc-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/GBpc-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKdla-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKdla-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKdlb-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKdlb-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKgccs-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKgccs-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKm314-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKm314-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKm471-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKm471-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKscs-B5-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/HKscs-B5-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Hankaku-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Hankaku-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Hiragana-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Hiragana-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-Johab-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-Johab-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCms-UHC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCms-UHC-HW-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCms-UHC-HW-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCms-UHC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCpc-EUC-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/KSCpc-EUC-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Katakana-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Katakana-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/NWP-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/NWP-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/README.txt +79 -0
- package/binary/_internal/pdfminer/cmap/RKSJ-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/RKSJ-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Roman-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/Roman-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UCS2-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UCS2-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF16-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF16-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF8-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniCNS-UTF8-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UCS2-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UCS2-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF16-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF16-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF8-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniGB-UTF8-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-HW-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-HW-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UCS2-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF16-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF16-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF8-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS-UTF8-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF16-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF16-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF8-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJIS2004-UTF8-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJISX0213-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJISX0213-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJISX02132004-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniJISX02132004-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UCS2-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UCS2-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF16-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF16-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF32-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF32-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF8-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/UniKS-UTF8-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/WP-Symbol-H.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/WP-Symbol-V.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-CNS1.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-GB1.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-Japan1.json.gz +0 -0
- package/binary/_internal/pdfminer/cmap/to-unicode-Adobe-Korea1.json.gz +0 -0
- package/binary/_internal/pdfminer/py.typed +0 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/INSTALLER +1 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/METADATA +110 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/RECORD +191 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/REQUESTED +0 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/WHEEL +5 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/licenses/LICENSE +22 -0
- package/binary/_internal/pdfminer_six-20260107.dist-info/top_level.txt +1 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/INSTALLER +1 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/METADATA +617 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/RECORD +30 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/REQUESTED +0 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/WHEEL +5 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/entry_points.txt +2 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/licenses/LICENSE.txt +21 -0
- package/binary/_internal/pdfplumber-0.11.10.dist-info/top_level.txt +1 -0
- package/binary/_internal/pillow-12.3.0.dist-info/INSTALLER +1 -0
- package/binary/_internal/pillow-12.3.0.dist-info/METADATA +180 -0
- package/binary/_internal/pillow-12.3.0.dist-info/RECORD +142 -0
- package/binary/_internal/pillow-12.3.0.dist-info/REQUESTED +0 -0
- package/binary/_internal/pillow-12.3.0.dist-info/WHEEL +6 -0
- package/binary/_internal/pillow-12.3.0.dist-info/licenses/LICENSE +1574 -0
- package/binary/_internal/pillow-12.3.0.dist-info/sboms/auditwheel.cdx.json +1 -0
- package/binary/_internal/pillow-12.3.0.dist-info/sboms/pillow-12.3.0.cdx.json +721 -0
- package/binary/_internal/pillow-12.3.0.dist-info/top_level.txt +1 -0
- package/binary/_internal/pillow-12.3.0.dist-info/zip-safe +1 -0
- package/binary/_internal/pillow.libs/libXau-154567c4.so.6.0.0 +0 -0
- package/binary/_internal/pillow.libs/libavif-8a7f9d56.so.16.4.2 +0 -0
- package/binary/_internal/pillow.libs/libbrotlicommon-53534446.so.1.2.0 +0 -0
- package/binary/_internal/pillow.libs/libbrotlidec-7e5462ba.so.1.2.0 +0 -0
- package/binary/_internal/pillow.libs/libfreetype-9fc94c80.so.6.20.6 +0 -0
- package/binary/_internal/pillow.libs/libharfbuzz-172d1f63.so.0.61421.0 +0 -0
- package/binary/_internal/pillow.libs/libjpeg-31e2ca52.so.62.4.0 +0 -0
- package/binary/_internal/pillow.libs/liblcms2-dade1fbf.so.2.0.19 +0 -0
- package/binary/_internal/pillow.libs/liblzma-2be87c3e.so.5.8.3 +0 -0
- package/binary/_internal/pillow.libs/libopenjp2-b07f72ad.so.2.5.4 +0 -0
- package/binary/_internal/pillow.libs/libpng16-abb096d5.so.16.58.0 +0 -0
- package/binary/_internal/pillow.libs/libsharpyuv-0066295b.so.0.1.2 +0 -0
- package/binary/_internal/pillow.libs/libtiff-fc87e79d.so.6.2.0 +0 -0
- package/binary/_internal/pillow.libs/libwebp-51b0b3f7.so.7.2.0 +0 -0
- package/binary/_internal/pillow.libs/libwebpdemux-9fe2abcc.so.2.0.17 +0 -0
- package/binary/_internal/pillow.libs/libwebpmux-8fb1c9f6.so.3.1.2 +0 -0
- package/binary/_internal/pillow.libs/libxcb-ad31f5a3.so.1.1.0 +0 -0
- package/binary/_internal/pillow.libs/libzstd-44be1190.so.1.5.7 +0 -0
- package/binary/_internal/pycparser-3.0.dist-info/INSTALLER +1 -0
- package/binary/_internal/pycparser-3.0.dist-info/METADATA +244 -0
- package/binary/_internal/pycparser-3.0.dist-info/RECORD +15 -0
- package/binary/_internal/pycparser-3.0.dist-info/REQUESTED +0 -0
- package/binary/_internal/pycparser-3.0.dist-info/WHEEL +5 -0
- package/binary/_internal/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
- package/binary/_internal/pycparser-3.0.dist-info/top_level.txt +1 -0
- package/binary/_internal/pypdfium2/version.json +11 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/INSTALLER +1 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/METADATA +1139 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/RECORD +75 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/REQUESTED +0 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/WHEEL +6 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/entry_points.txt +2 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/Apache-2.0.txt +202 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +26 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/LICENSES/CC-BY-4.0.txt +317 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/abseil.txt +203 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/agg23.txt +14 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/fast_float.txt +27 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/freetype.txt +169 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/icu.txt +568 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/lcms.txt +27 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.ijg +260 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.md +135 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libopenjpeg.txt +32 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libpng.txt +134 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libtiff.txt +21 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/llvm-libc.txt +278 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium-binaries.txt +9 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium.txt +230 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/simdutf.txt +18 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/zlib.txt +29 -0
- package/binary/_internal/pypdfium2-5.13.0.dist-info/top_level.txt +4 -0
- package/binary/_internal/pypdfium2_raw/libpdfium.so +0 -0
- package/binary/_internal/pypdfium2_raw/version.json +10 -0
- package/binary/_internal/python_calamine/_python_calamine.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/INSTALLER +1 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/METADATA +94 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/RECORD +11 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/REQUESTED +0 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/WHEEL +5 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/licenses/LICENSE +21 -0
- package/binary/_internal/python_calamine-0.8.2.dist-info/sboms/python-calamine.cyclonedx.json +1615 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/INSTALLER +1 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/METADATA +161 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/RECORD +9 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/REQUESTED +0 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/WHEEL +7 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/licenses/LICENSE +21 -0
- package/binary/_internal/quickjs_ng-0.17.0.1.dist-info/top_level.txt +2 -0
- package/binary/_internal/selectolax/base.pxi +4 -0
- package/binary/_internal/selectolax/lexbor/attrs.pxi +123 -0
- package/binary/_internal/selectolax/lexbor/fragment_lookup.pxi +52 -0
- package/binary/_internal/selectolax/lexbor/node.pxi +1355 -0
- package/binary/_internal/selectolax/lexbor/node_remove.pxi +29 -0
- package/binary/_internal/selectolax/lexbor/selection.pxi +251 -0
- package/binary/_internal/selectolax/lexbor/util.pxi +114 -0
- package/binary/_internal/selectolax/lexbor.c +66981 -0
- package/binary/_internal/selectolax/lexbor.cpython-312-x86_64-linux-gnu.so +0 -0
- package/binary/_internal/selectolax/lexbor.pxd +682 -0
- package/binary/_internal/selectolax/lexbor.pyi +1534 -0
- package/binary/_internal/selectolax/lexbor.pyx +1046 -0
- package/binary/_internal/selectolax/modest/node.pxi +976 -0
- package/binary/_internal/selectolax/modest/selection.pxi +199 -0
- package/binary/_internal/selectolax/modest/util.pxi +20 -0
- package/binary/_internal/selectolax/py.typed +0 -0
- package/binary/_internal/selectolax/utils.pxi +117 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/INSTALLER +1 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/METADATA +222 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/RECORD +30 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/REQUESTED +0 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/WHEEL +7 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/licenses/LICENSE +10 -0
- package/binary/_internal/selectolax-0.4.13.dist-info/top_level.txt +1 -0
- package/binary/brewdoc +0 -0
- package/binary/licenses/installed/brewdoc/brewdoc/_vendor/THIRD_PARTY_NOTICES.txt +342 -0
- package/binary/licenses/installed/brewdoc/brewdoc-0.3.2.dist-info/licenses/LICENSE +21 -0
- package/binary/licenses/installed/cffi/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
- package/binary/licenses/installed/charset-normalizer/charset_normalizer-3.5.2.dist-info/licenses/LICENSE +21 -0
- package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
- package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE.APACHE +202 -0
- package/binary/licenses/installed/cryptography/cryptography-50.0.2.dist-info/licenses/LICENSE.BSD +27 -0
- package/binary/licenses/installed/interpreter/LICENSE.txt +279 -0
- package/binary/licenses/installed/native-runtime/GPL-3 +674 -0
- package/binary/licenses/installed/native-runtime/gcc-12-base-amd64-copyright +1512 -0
- package/binary/licenses/installed/pdfminer.six/pdfminer_six-20260107.dist-info/licenses/LICENSE +22 -0
- package/binary/licenses/installed/pdfplumber/pdfplumber-0.11.10.dist-info/licenses/LICENSE.txt +21 -0
- package/binary/licenses/installed/pillow/pillow-12.3.0.dist-info/licenses/LICENSE +1574 -0
- package/binary/licenses/installed/pycparser/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/Apache-2.0.txt +202 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +26 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/LICENSES/CC-BY-4.0.txt +317 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/abseil.txt +203 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/agg23.txt +14 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/fast_float.txt +27 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/freetype.txt +169 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/icu.txt +568 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/lcms.txt +27 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.ijg +260 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libjpeg_turbo.md +135 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libopenjpeg.txt +32 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libpng.txt +134 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/libtiff.txt +21 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/llvm-libc.txt +278 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium-binaries.txt +9 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/pdfium.txt +230 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/simdutf.txt +18 -0
- package/binary/licenses/installed/pypdfium2/pypdfium2-5.13.0.dist-info/licenses/data/linux_x64/BUILD_LICENSES/zlib.txt +29 -0
- package/binary/licenses/installed/python-calamine/python_calamine-0.8.2.dist-info/licenses/LICENSE +21 -0
- package/binary/licenses/installed/quickjs-ng/quickjs_ng-0.17.0.1.dist-info/licenses/LICENSE +21 -0
- package/binary/licenses/installed/runtime-hooks/pyi_rth_cryptography_openssl.py +20 -0
- package/binary/licenses/installed/runtime-hooks/pyi_rth_inspect.py +99 -0
- package/binary/licenses/installed/runtime-hooks/pyi_rth_multiprocessing.py +88 -0
- package/binary/licenses/installed/runtime-hooks/pyi_rth_pkgutil.py +64 -0
- package/binary/licenses/installed/selectolax/selectolax-0.4.13.dist-info/licenses/LICENSE +10 -0
- package/binary/licenses/installed-manifest.json +202 -0
- package/binary/licenses/supplemental/openssl/3.5.9/README-copyright.txt +9 -0
- package/binary/licenses/supplemental/openssl/4.0.3/README-copyright.txt +9 -0
- package/binary/licenses/supplemental/provenance.json +2347 -0
- package/binary/licenses/supplemental/pyinstaller-6.22.3/COPYING.txt +648 -0
- package/binary/licenses/supplemental/pyinstaller-6.22.3/bootloader/waflib/LICENSE +25 -0
- package/binary/licenses/supplemental/pyinstaller-6.22.3/bootloader/zlib/LICENSE +22 -0
- package/binary/licenses/supplemental/pyinstaller-6.22.3/doc/license.rst +24 -0
- package/binary/licenses/supplemental/pyinstaller-hooks-contrib-2026.8/LICENSE +521 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE +373 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.bdb.txt +126 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.bzip2.txt +37 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.cpython.txt +771 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.expat.txt +21 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libX11.txt +942 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libXau.txt +21 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libedit.txt +29 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libffi.txt +21 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.liblzma.txt +13 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libuuid.txt +27 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.libxcb.txt +30 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.mpdecimal.txt +24 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.ncurses.txt +29 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.openssl-1.1.txt +124 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.openssl-3.txt +177 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.sqlite.txt +23 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.tcl.txt +40 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.tix.txt +54 -0
- package/binary/licenses/supplemental/python-build-standalone-20260929/LICENSE.zlib.txt +21 -0
- package/binary/licenses/supplemental/python-calamine-0.8.2/LICENSE +21 -0
- package/binary/licenses/supplemental/python-calamine-0.8.2/source-identity/Cargo.lock +620 -0
- package/binary/licenses/supplemental/python-calamine-0.8.2/source-identity/Cargo.toml +22 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/LICENSE +21 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/cutils.h.txt +24 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/dtoa.c.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/dtoa.h.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp-opcode.h.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp.c.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libregexp.h.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libunicode.c.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/libunicode.h.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/list.h.txt +23 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs-atom.h.txt +24 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs-opcode.h.txt +24 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs.c.txt +26 -0
- package/binary/licenses/supplemental/quickjs-ng-0.17.0.1/engine-headers/upstream-quickjs/quickjs.h.txt +26 -0
- package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-0BSD +12 -0
- package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-adler2-2.0.1/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-android_system_properties-0.1.5/LICENSE-APACHE +13 -0
- package/binary/licenses/supplemental/rust-android_system_properties-0.1.5/LICENSE-MIT +20 -0
- package/binary/licenses/supplemental/rust-atoi_simd-0.18.1/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-atoi_simd-0.18.1/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-autocfg-1.5.1/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-autocfg-1.5.1/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-bumpalo-3.20.3/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-bumpalo-3.20.3/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-byteorder-1.5.0/COPYING +3 -0
- package/binary/licenses/supplemental/rust-byteorder-1.5.0/LICENSE-MIT +21 -0
- package/binary/licenses/supplemental/rust-calamine-0.36.0/LICENSE-MIT.md +23 -0
- package/binary/licenses/supplemental/rust-cc-1.2.64/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-cc-1.2.64/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-cfg-if-1.0.4/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-cfg-if-1.0.4/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-chrono-0.4.45/LICENSE.txt +240 -0
- package/binary/licenses/supplemental/rust-codepage-0.1.2/COPYRIGHT +9 -0
- package/binary/licenses/supplemental/rust-codepage-0.1.2/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-codepage-0.1.2/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-core-foundation-sys-0.8.7/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-core-foundation-sys-0.8.7/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-crc32fast-1.5.0/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-crc32fast-1.5.0/LICENSE-MIT +21 -0
- package/binary/licenses/supplemental/rust-debug_unsafe-0.1.4/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-debug_unsafe-0.1.4/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/COPYRIGHT +17 -0
- package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-encoding_rs-0.8.35/LICENSE-WHATWG +26 -0
- package/binary/licenses/supplemental/rust-equivalent-1.0.2/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-equivalent-1.0.2/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-fast-float2-0.2.3/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-fast-float2-0.2.3/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-find-msvc-tools-0.1.9/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-find-msvc-tools-0.1.9/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-flate2-1.1.9/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-flate2-1.1.9/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-futures-core-0.3.32/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-futures-core-0.3.32/LICENSE-MIT +26 -0
- package/binary/licenses/supplemental/rust-futures-task-0.3.32/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-futures-task-0.3.32/LICENSE-MIT +26 -0
- package/binary/licenses/supplemental/rust-futures-util-0.3.32/LICENSE-APACHE +202 -0
- package/binary/licenses/supplemental/rust-futures-util-0.3.32/LICENSE-MIT +26 -0
- package/binary/licenses/supplemental/rust-hashbrown-0.17.1/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-hashbrown-0.17.1/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-heck-0.5.0/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-heck-0.5.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-iana-time-zone-0.1.65/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-iana-time-zone-0.1.65/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-iana-time-zone-haiku-0.1.2/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-iana-time-zone-haiku-0.1.2/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-indexmap-2.14.0/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-indexmap-2.14.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-js-sys-0.3.102/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-js-sys-0.3.102/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-libc-0.2.186/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-libc-0.2.186/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-log-0.4.32/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-log-0.4.32/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-memchr-2.8.2/COPYING +3 -0
- package/binary/licenses/supplemental/rust-memchr-2.8.2/LICENSE-MIT +21 -0
- package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE +25 -0
- package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-APACHE.md +177 -0
- package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-MIT.md +24 -0
- package/binary/licenses/supplemental/rust-miniz_oxide-0.8.9/LICENSE-ZLIB.md +14 -0
- package/binary/licenses/supplemental/rust-num-traits-0.2.19/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-num-traits-0.2.19/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-once_cell-1.21.4/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-once_cell-1.21.4/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
- package/binary/licenses/supplemental/rust-pin-project-lite-0.2.17/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-portable-atomic-1.13.1/LICENSE-APACHE +177 -0
- package/binary/licenses/supplemental/rust-portable-atomic-1.13.1/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-proc-macro2-1.0.106/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-proc-macro2-1.0.106/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-pyo3-0.29.0/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-0.29.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-pyo3-0.29.0/pyo3-runtime/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-0.29.0/pyo3-runtime/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-pyo3-build-config-0.29.0/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-build-config-0.29.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-pyo3-ffi-0.29.0/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-ffi-0.29.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/Cargo.toml +14 -0
- package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/README.md +90 -0
- package/binary/licenses/supplemental/rust-pyo3-file-0.16.0/declared-license/Apache-2.0.txt +73 -0
- package/binary/licenses/supplemental/rust-pyo3-macros-0.29.0/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-macros-0.29.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-pyo3-macros-backend-0.29.0/LICENSE-APACHE +178 -0
- package/binary/licenses/supplemental/rust-pyo3-macros-backend-0.29.0/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-quick-xml-0.41.0/LICENSE-MIT.md +23 -0
- package/binary/licenses/supplemental/rust-quote-1.0.45/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-quote-1.0.45/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-rustversion-1.0.22/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-rustversion-1.0.22/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-serde-1.0.228/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-serde-1.0.228/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-serde_core-1.0.228/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-serde_core-1.0.228/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-serde_derive-1.0.228/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-serde_derive-1.0.228/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-shlex-2.0.1/LICENSE-APACHE +13 -0
- package/binary/licenses/supplemental/rust-shlex-2.0.1/LICENSE-MIT +21 -0
- package/binary/licenses/supplemental/rust-simd-adler32-0.3.9/LICENSE.md +21 -0
- package/binary/licenses/supplemental/rust-slab-0.4.12/LICENSE +25 -0
- package/binary/licenses/supplemental/rust-syn-2.0.118/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-syn-2.0.118/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-target-lexicon-0.13.5/LICENSE +220 -0
- package/binary/licenses/supplemental/rust-typed-path-0.12.3/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-typed-path-0.12.3/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-APACHE +176 -0
- package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-MIT +23 -0
- package/binary/licenses/supplemental/rust-unicode-ident-1.0.24/LICENSE-UNICODE +39 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-0.2.125/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-0.2.125/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-macro-0.2.125/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-macro-0.2.125/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-macro-support-0.2.125/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-macro-support-0.2.125/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-shared-0.2.125/LICENSE-APACHE +201 -0
- package/binary/licenses/supplemental/rust-wasm-bindgen-shared-0.2.125/LICENSE-MIT +25 -0
- package/binary/licenses/supplemental/rust-windows-core-0.62.2/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-core-0.62.2/license-mit +21 -0
- package/binary/licenses/supplemental/rust-windows-implement-0.60.2/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-implement-0.60.2/license-mit +21 -0
- package/binary/licenses/supplemental/rust-windows-interface-0.59.3/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-interface-0.59.3/license-mit +21 -0
- package/binary/licenses/supplemental/rust-windows-link-0.2.1/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-link-0.2.1/license-mit +21 -0
- package/binary/licenses/supplemental/rust-windows-result-0.4.1/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-result-0.4.1/license-mit +21 -0
- package/binary/licenses/supplemental/rust-windows-strings-0.5.1/license-apache-2.0 +201 -0
- package/binary/licenses/supplemental/rust-windows-strings-0.5.1/license-mit +21 -0
- package/binary/licenses/supplemental/rust-zip-8.6.0/LICENSE +21 -0
- package/binary/licenses/supplemental/rust-zlib-rs-0.6.3/LICENSE +19 -0
- package/binary/licenses/supplemental/rust-zopfli-0.8.3/COPYING +201 -0
- package/binary/licenses/supplemental/selectolax-0.4.13/LICENSE +10 -0
- package/binary/licenses/supplemental/selectolax-0.4.13/lexbor/LICENSE +223 -0
- package/binary/licenses/supplemental/selectolax-0.4.13/lexbor/NOTICE +16 -0
- package/binary/version.json +6 -0
- package/native-manifest.json +4474 -0
- package/native-verification.json +338 -0
- 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(...)")
|