MCPcopy Index your code
hub / github.com/awolverp/markupever

github.com/awolverp/markupever @v0.3.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.4 ↗ · + Follow
476 symbols 1,072 edges 27 files 133 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MarkupEver

<em>The fast, most optimal, and correct HTML & XML parsing library</em>






<a href="https://awolverp.github.io/markupever" target="_blank"><b>Documentation</b></a> | <a href="https://github.com/awolverp/cachebox/releases"><b>Releases</b></a> | <a href="https://awolverp.github.io/markupever/#performance" target="_blank"><b>Benchmarks</b></a>

text image image image python-test download


MarkupEver is a modern, fast (high-performance), XML & HTML languages parsing library written in Rust.

KEY FEATURES: * 🚀 Fast: Very high performance and fast (thanks to html5ever and selectors). * 🔥 Easy: Designed to be easy to use and learn. Completion everywhere. * ✨ Low-Memory: Written in Rust. Uses low memory. Don't worry about memory leaks. Uses Rust memory allocator. * 🧶 Thread-safe: Completely thread-safe. * 🎯 Quering: Use your CSS knowledge for selecting elements from a HTML or XML document. * ⚡ Streaming: Incremental/streaming parsing support.

Installation

You can install MarkupEver by using pip:

It's recommended to use virtual environments.

$ pip3 install markupever

Example

Parse

Parsing a HTML content and selecting elements:

import markupever

dom = markupever.parse_file("file.html", "html")
# Or parse a HTML content directly:
# dom = markupever.parse("... content ...", "html")

for element in dom.select("div.section > p:child-nth(1)"):
    print(element.text())

Create DOM

Creating a DOM from zero:

from markupever import dom

dom = dom.TreeDom()
root: dom.Document = dom.root()

root.create_doctype("html")

html = root.create_element("html", {"lang": "en"})
body = html.create_element("body")
body.create_text("Hello Everyone ...")

print(root.serialize())
# <!DOCTYPE html>
# <html lang="en">
#   <body>Hello Everyone ...</body>
# </html>

Core symbols most depended-on inside this repo

get
called by 70
python/markupever/dom.py
root
called by 49
python/markupever/dom.py
process
called by 19
python/markupever/parser.py
as_node_guard
called by 18
src/nodes.rs
finish
called by 17
python/markupever/parser.py
append
called by 15
python/markupever/dom.py
create_element
called by 14
python/markupever/dom.py
into_dom
called by 14
python/markupever/parser.py

Shape

Method 343
Class 68
Function 55
Enum 9
Route 1

Languages

Rust59%
Python41%

Modules by API surface

python/markupever/dom.py118 symbols
src/nodes.rs65 symbols
treedom/src/parser.rs32 symbols
matching/src/selectable.rs30 symbols
src/parser.rs24 symbols
treedom/src/interface.rs23 symbols
src/tree.rs20 symbols
python/markupever/iterators.py20 symbols
python/tests/test_rustlib.py19 symbols
treedom/src/dom.rs18 symbols
matching/src/parser.rs17 symbols
python/markupever/parser.py15 symbols

For agents

$ claude mcp add markupever \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact