Skip to main content

microformats are the simplest way to openly publish contacts, events, reviews, recipes, and other structured information on the web.

>>> import mf
>>> url = "https://alice.example"
>>> doc = f'''
... <p class=h-card><a href={url}>Alice</a></p>
... <ul class=h-feed>
... <li class=h-entry>foo
... <li class=h-entry>bar
... </ul>
... '''
>>> page = mf.parse(doc=doc, url=url)

# TODO >>> dict(page)
# TODO >>> page.json

>>> card = page["items"][0]
>>> card["type"]
['h-card']
>>> card["properties"]
{'name': ['Alice'], 'url': ['https://alice.example']}
>>> feed = page["items"][1]
>>> feed["children"][0]["properties"]["name"]
['foo']

>>> mf.util.representative_card(page, url)
{'name': ['Alice'], 'url': ['https://alice.example']}
>>> mf.util.representative_feed(page, url)["items"][0]["name"]
['foo']

# TODO >>> page.representative_card
# TODO {'name': ['Alice'], 'url': ['https://alice.example']}
# TODO >>> page.representative_feed["items"][0]["name"]
# TODO ['foo']

Based upon mf2util.

Metadata

Release files for microformats 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microformats 0.5.1
File Size Uploaded
microformats-0.5.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for microformats 0.5.1
File Interpreter ABI Platform
microformats-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / microformats-0.5.1.tar.gz

Download URL microformats-0.5.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f55b50ad3a55e53a8248f29c364fd438a604429d87ca6b446bd4efa8496bfda
BLAKE2b-256 checksum
How to use checksums
17e3ae1fb1a1f9ba3df55c47ee4db3fa26255220d87b2bd8dc765c0408a37274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.10.0-23-amd64

Release files / microformats-0.5.1-py3-none-any.whl

Download URL microformats-0.5.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6619dd6729a8b66194260edb579cb49f6498356da7f90f86f31d56762b50ed85
BLAKE2b-256 checksum
How to use checksums
aa9ba3decc68252ed841a177f1efa975008a80a75138c1531ca95bd1d9711d81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.10.0-23-amd64

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.25

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page