Skip to content

Install

Parsec is one project published four ways. Each one has the same parser underneath, and each release ships all four at the same version.

Terminal window
cargo add parsec-web

You need Rust 1.88 or newer. That gives you the HTML parser, CSS, XPath, URLs and encodings together. Each of those is also its own crate, so you can take only the one you need:

Crate What it parses
parsec-web-core HTML: the tokenizer, the tree builder and the tree
parsec-web-css CSS, with the cascade behind its default cascade feature
parsec-web-encoding Encodings, with parse_bytes behind its default parse feature
parsec-url URLs, by the WHATWG URL Standard
parsec-xpath XPath 1.0
parsec-js JavaScript
parsec-xml XML 1.0 with namespaces
parsec-base What they share: spans, line indexes, diagnostics and limits

Until 1.0, a minor release can change the API and a patch release won’t, so a requirement of "0.3" takes fixes and never a break.

Terminal window
pip install parsec-web

It runs on CPython 3.10 and later. There are wheels for Linux (glibc and musl), macOS and Windows, on x86-64 and ARM; anywhere else, pip builds from source, which needs Rust. The module you import is parsec_html.

Terminal window
npm install parsec-web

In Node, npm fetches a native build for Linux, macOS or Windows on x86-64 or ARM, and falls back to WebAssembly anywhere else. Browsers and bundlers get the WebAssembly. The package ships TypeScript types.

Each release has a package per platform with include/parsec.h, a static and a shared library, and pkg-config and CMake files:

Archive Platform
parsec-capi-VERSION-x86_64-unknown-linux-gnu.tar.gz Linux x86-64, glibc 2.35 or newer
parsec-capi-VERSION-aarch64-unknown-linux-gnu.tar.gz Linux ARM64, glibc 2.35 or newer
parsec-capi-VERSION-universal-apple-darwin.tar.gz macOS, Apple silicon and Intel in one library
parsec-capi-VERSION-x86_64-pc-windows-msvc.zip Windows x86-64
parsec-capi-VERSION-aarch64-pc-windows-msvc.zip Windows ARM64

parsec-capi-SHA256SUMS beside them lists their hashes, and each archive has a build provenance attestation you can check:

Terminal window
gh attestation verify FILE --repo parsec-html/parsec