Skip to main content

Unified data extraction — Regex, XPath 1.0, CSS Selectors, and JMESPath behind one query interface. Powered by Rust.

Project description

chadselect (Python)

Rust-powered unified data extraction — Regex, XPath 1.0, CSS Selectors, and JMESPath behind one query interface.

This is the Python binding for chadselect, built with PyO3 and maturin.

Install

pip install chadselect

Quick Start

from chadselect import ChadSelect

cs = ChadSelect()
cs.add_html('<span class="price">$49.99</span>')

price = cs.select(0, "css:.price")          # "$49.99"
results = cs.query(-1, "regex:\\$[\\d.]+")   # ["$49.99"]

Async

from chadselect import AsyncChadSelect

cs = AsyncChadSelect()
cs.add_html(html)
price = await cs.select(0, "css:.price")

Query Prefixes

Prefix Engine Content Types
css: CSS Selectors HTML
xpath: XPath 1.0 HTML
json: JMESPath JSON
regex: Regex HTML, JSON, Text
(none) Regex HTML, JSON, Text

Post-Processing Functions

Chain functions with >>:

cs.select(0, "css:.price >> trim >> uppercase")

Available: trim, uppercase, lowercase, normalize-space, substring(start,len), substring-after(delim), substring-before(delim), replace(old,new), get-attr(name).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

chadselect-0.1.0-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

chadselect-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

chadselect-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file chadselect-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for chadselect-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4485890e94401f4ce3aed5d3aac273478825f7b2c938b8777e251f4ab21a78fa
MD5 dde9ba1d95808725360cfcf43dd6b101
BLAKE2b-256 86ebbd7989e7306722f3e393c27f52c709a1741c76e7732349d962452d8387cf

See more details on using hashes here.

File details

Details for the file chadselect-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chadselect-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6885296c9efb655774585fbea46d3a86fc654cc2d1b9e128a809e7b71a7f6a2
MD5 34352c9134dbd0da270da8113bf5a6d1
BLAKE2b-256 6257b768b68a3413b4510a25717c646bee941715b30638a257436642974823e5

See more details on using hashes here.

File details

Details for the file chadselect-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chadselect-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0bcea1d793d47717adb0bf9977fa8aa9e8c0efb1fde6289fda7d15b22fcd7469
MD5 634321d3c3fb0a3c95db3dbc10142743
BLAKE2b-256 90f5f510758657446fa320dd2428eb137b360975e124988b5247a7a02edbb0e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page