--- id: extruct version: "0.18.0" license: unclear license_treatment: permissive maintenance: active --- # extruct — Extract embedded metadata from HTML markup License: permissive · Maintenance: active · Downloads: 659.4K/mo ## What it is and what it does extruct is a metadata extraction library that parses HTML documents and pulls out structured data embedded in standard formats. It handles W3C Microdata (including schema.org), JSON-LD, Microformats, Open Graph tags, RDFa, and Dublin Core metadata—all through a single unified interface. You pass it an HTML string and optional base URL, and it returns a dictionary keyed by format type, each containing the extracted data. The library wraps several specialized parsers (lxml, rdflib, mf2py, pyrdfa3) and HTML utilities (w3lib, html-text, jstyleson) to normalize their output. It's commonly used in web scraping, SEO analysis, and data integration pipelines where you need to reliably extract metadata that content publishers have embedded for search engines, social media, or semantic web applications. Use it for: - Extract schema.org Microdata from e-commerce product pages to build product catalogs - Parse Open Graph tags from web pages for social media link previews and metadata - Harvest JSON-LD structured data from news articles and blog posts for content indexing - Extract Microformats from personal websites and social profiles for contact/event data - Build semantic web applications by parsing RDFa annotations from HTML documents - Aggregate Dublin Core metadata from institutional or library websites ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts structured metadata from HTML markup in multiple formats: Microdata, JSON-LD, Microformats, Open Graph, RDFa, and Dublin Core. Yes. extruct is actively maintained, has no known vulnerabilities, supports current Python versions (3.8–3.12), and installs with low friction. It solves a real problem—unified extraction of multiple metadata formats—that would otherwise require juggling separate parsers. The permissive license and 971 repository stars indicate solid community adoption. Install it if you need to reliably extract structured metadata from HTML in production or research contexts. ## Install pip install extruct uv add extruct poetry add extruct ## Installing extruct Before you install: Low install friction with a pure-Python wheel. Active maintenance with recent commits and 971 repository stars. Supports Python 3.8 through 3.12. License in practice: Permissive license allows commercial and private use without restriction. Quickstart: pip install extruct import extruct from w3lib.html import get_base_url html = '...' base_url = 'https://example.com' data = extruct.extract(html, base_url=base_url) Verify before relying: - Performance characteristics when processing large HTML documents or batch operations - Specific version compatibility matrix for each metadata format parser (mf2py, rdflib, pyrdfa3) - Whether experimental RDFa support is production-ready ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 659.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags extract metadata from html, parse microdata schema.org, json-ld extraction, open graph parser, html structured data extraction, rdfa parser, microformats parser, dublin core metadata, metadata-extraction, web-scraping, structured-data [View on SkillFed](https://skillfed.io/packages/extruct) · [View on PyPI](https://pypi.org/project/extruct/)