--- id: mf2py version: "2.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # mf2py — Microformats parser License: permissive · Maintenance: dormant · Downloads: 562.7K/mo ## What it is and what it does mf2py is a microformats parser that reads HTML and extracts structured data in JSON format. It recognizes microformats2 classes (like h-card, h-entry, h-event) and converts them into a standardized dictionary structure, making it easy to programmatically access semantic markup embedded in web pages. The library also supports the older microformats1 format and has experimental metaformats extraction. You typically use mf2py when you need to consume or validate microformats-marked HTML—common in IndieWeb applications, social media integrations, and semantic web tooling. It accepts HTML from files, strings, or URLs, and returns a dict with items, relationships, and metadata. The three runtime dependencies (html5lib, requests, beautifulsoup4) handle the heavy lifting of HTML parsing and network fetching. Use it for: - Extract author and publication metadata from blog posts marked with h-entry and h-card microformats. - Parse event listings (h-event) from calendar or conference websites to build aggregators or search indexes. - Validate that your own HTML markup correctly implements microformats2 before publishing. - Build IndieWeb applications that need to read contact cards (h-card) or social interactions (webmentions) from remote URLs. - Convert microformats-annotated HTML into JSON for downstream processing or storage in a database. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. mf2py parses HTML documents to extract microformats2 data structures, with backwards compatibility for microformats1 and experimental metaformats support. Yes, if you are working with microformats-marked HTML or building IndieWeb tooling. The package is stable, has no known vulnerabilities, and low install friction. However, dormant maintenance (980 days since last release) means you should not expect bug fixes or spec updates; use it only for stable, well-established microformats2 parsing tasks. ## Install pip install mf2py uv add mf2py poetry add mf2py ## Installing mf2py Before you install: Low install friction with a pure-Python wheel and three common dependencies (html5lib, requests, beautifulsoup4). Maintenance is dormant—last release was 980 days ago—so expect no active bug fixes or feature updates, though the package has been stable since its 2014 inception. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute mf2py freely as long as you retain the license notice. Quickstart: import mf2py mf2json = mf2py.parse(doc="
Jane