Pickaxe
Pickaxe is a Python package for structured data extraction from HTML documents. It provides a simple and intuitive API for parsing HTML documents, and automatically extracting structured data from them.
Features
- Written in Rust: Pickaxe is written in Rust, which makes it fast and memory-efficient.
- Robust: Pickaxe uses the
html5everandselectorscrate for browser-grade HTML parsing and CSS selector matching. - CSS Selectors & XPath: Pickaxe supports both CSS selectors and (simple) XPath expressions for querying HTML documents.
Quick Start
Python
Installation
pip install python-pickaxe
Basic Usage
from pickaxe import HtmlDocument
# Parse an HTML document
document = HtmlDocument.from_str("<html><body><h1>Hello, World!</h1></body></html>")
# Access elements using CSS selectors or XPath expressions
heading = document.find("h1")
print(heading.inner_text) # Output: Hello, World!
heading = document.find_xpath("//h1")
print(heading.inner_text) # Output: Hello, World!
Rust
Installation
cargo add rust-pickaxe
Basic Usage
use pickaxe::HtmlDocument;
fn main() {
// Parse an HTML document
let document = HtmlDocument::from_str("<html><body><h1>Hello, World!</h1></body></html>").unwrap();
// Access elements using CSS selectors or XPath expressions
let heading = document.find("h1").unwrap();
println!("{}", heading.inner_text()); // Output: Hello, World!
let heading = document.find_xpath("//h1").unwrap();
println!("{}", heading.inner_text()); // Output: Hello, World!
}
License
This project is licensed under MIT License.
Support & Feedback
If you encounter any issues or have feedback, please open an issue. We'd love to hear from you!
Made with ❤️ by Emergent Methods
Metadata
Release files for python-pickaxe 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_pickaxe-0.5.5-cp39-abi3-manylinux_2_34_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.34+ x86-64 | Details for python_pickaxe-0.5.5-cp39-abi3-manylinux_2_34_x86_64.whl |
Release files / python_pickaxe-0.5.5-cp39-abi3-manylinux_2_34_x86_64.whl
| Download URL | python_pickaxe-0.5.5-cp39-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.9 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0f4518227fde0a1bb7bb4db9e539a5081179afb45131540a48d11a66bbb3afc1
|
|
BLAKE2b-256 checksum How to use checksums |
382f41902d0e53cfd1c31a4fbbf8dcc2b26989c64b64a0b6bbbf0d98ff9c6876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.14
|
Security for python-pickaxe 0.5.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.