Skip to main content

markdown-this

PyPI

Extract the readable content of a URL and convert it to Markdown. The package also handles GitHub repositories and Markdown files through the GitHub API, and arXiv abstract pages through their HTML representation.

Installation

uv add markdown-this

Usage

from markdown_this import extract_main_content

title, markdown, fallback_text, intro = extract_main_content(
    "https://example.com/article"
)

The source can also be a local HTML file (Path or path string) or raw HTML:

from pathlib import Path
from markdown_this import extract_main_content

title, markdown, fallback_text, intro = extract_main_content(Path("article.html"))
title, markdown, fallback_text, intro = extract_main_content("<html><p>...</p></html>")

extract_main_content returns the title, extracted Markdown, plain-text fallback, and a short introduction suitable for a notification or preview. The Markdown value starts with YAML front matter containing the metadata that was found, such as title, author, url, date, and the declared page type (article, website, home, and so on).

For example:

---
title: An article
author: An author
url: https://example.com/article
date: 2026-08-06
---

Article content.

The package also installs a markdown-this command:

markdown-this https://example.com/article
markdown-this article.html
cat article.html | markdown-this -

The command writes the extracted Markdown to stdout. Its input may be a URL, an existing HTML path, or HTML read from stdin.

The lower-level fetchers and normalization helpers are available from the package modules when an application needs more control over the pipeline.

Development

uv run pytest packages/markdown-this/tests
uv run ruff check packages/markdown-this

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown_this-0.1.8.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown_this-0.1.8-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file markdown_this-0.1.8.tar.gz.

File metadata

  • Download URL: markdown_this-0.1.8.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for markdown_this-0.1.8.tar.gz
Algorithm Hash digest
SHA256 480894bc1345f4a3a4d4d02b6562f794332e237393b980978a7787c479b9888a
MD5 1db42038028c0648dfc39a5c7f80aa0f
BLAKE2b-256 d73e0758877ec199ed3b217403da91c3c5de7908a4fa3383f8677d8eed558bbd

See more details on using hashes here.

File details

Details for the file markdown_this-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: markdown_this-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for markdown_this-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 972c40842beb89c6bb0a84757d1b1360da08f5d334706d486533de15b3d5404c
MD5 80a1522899f5568d864355ca69eeae32
BLAKE2b-256 6047942b93217dcdd4fd699277580cdca7a6334bf0203d8e9bb4ae758bdf444f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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