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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chadselect-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: chadselect-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4485890e94401f4ce3aed5d3aac273478825f7b2c938b8777e251f4ab21a78fa
|
|
| MD5 |
dde9ba1d95808725360cfcf43dd6b101
|
|
| BLAKE2b-256 |
86ebbd7989e7306722f3e393c27f52c709a1741c76e7732349d962452d8387cf
|
File details
Details for the file chadselect-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: chadselect-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6885296c9efb655774585fbea46d3a86fc654cc2d1b9e128a809e7b71a7f6a2
|
|
| MD5 |
34352c9134dbd0da270da8113bf5a6d1
|
|
| BLAKE2b-256 |
6257b768b68a3413b4510a25717c646bee941715b30638a257436642974823e5
|
File details
Details for the file chadselect-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: chadselect-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bcea1d793d47717adb0bf9977fa8aa9e8c0efb1fde6289fda7d15b22fcd7469
|
|
| MD5 |
634321d3c3fb0a3c95db3dbc10142743
|
|
| BLAKE2b-256 |
90f5f510758657446fa320dd2428eb137b360975e124988b5247a7a02edbb0e2
|