Skip to main content

ArticlePub

Turn a long article or blog post into a clean, Kindle-friendly EPUB.

ArticlePub is for the moment when you find something worth reading, but you want it in your reading queue instead of another browser tab. Give it a URL, get an EPUB, and optionally send that EPUB straight to Calibre-Web.

Quick Start

If you have uv, you can run ArticlePub without installing it permanently:

uvx articlepub add "https://example.com/article" --provider none

That creates an EPUB in articlepub/.

Want AI cleanup and better article structure? Set your Anthropic key and leave the provider at its default:

export ANTHROPIC_API_KEY="..."
uvx articlepub add "https://example.com/article"

Send To Calibre-Web

If your Calibre-Web server allows anonymous uploads:

uvx articlepub add "https://example.com/article" \
  --provider none \
  --calibre-url "https://calibre.example.com/"

If login is required:

uvx articlepub add "https://example.com/article" \
  --calibre-url "https://calibre.example.com/" \
  --calibre-username "articlepub" \
  --calibre-password "your-password"

Add the uploaded book to a shelf:

uvx articlepub add "https://example.com/article" \
  --calibre-url "https://calibre.example.com/" \
  --calibre-shelf "Quick Read"

Shelf names can contain spaces. Repeat --calibre-shelf to add the book to more than one shelf.

Already have an EPUB? Upload it directly:

uvx articlepub upload \
  --calibre-url "https://calibre.example.com/" \
  --calibre-shelf "Quick Read" \
  articlepub/article.epub

What You Get

ArticlePub prints the EPUB path to stdout, so it is easy to script:

articlepub/example-article.epub

When Calibre-Web upload is enabled, it also prints the Calibre-Web book URL when available:

articlepub/example-article.epub
https://calibre.example.com/book/35

Status messages go to stderr and tell the story of the run:

OK    Saved articlepub/example-article.epub  :-)
OK    Book uploaded  :-)
INFO  Book: https://calibre.example.com/book/35
OK    Added to shelf: Quick Read  :-)
OK    Book uploaded successfully  :-)

Common Recipes

Save to a different folder:

uvx articlepub add "https://example.com/article" --provider none --out ~/Documents/epubs

Override the EPUB title:

uvx articlepub add "https://example.com/article" --provider none --title "Weekend Reading"

Use Claude to fetch the page directly when local extraction fails. This requires ANTHROPIC_API_KEY or --api-key:

uvx articlepub add "https://example.com/article" --fetch-mode llm

Check your setup before a long run:

uvx articlepub doctor "https://example.com/article" --provider none

See detailed timing and upload diagnostics:

uvx articlepub add "https://example.com/article" --provider none --log-level debug

Keep raw debug artifacts for one run:

uvx articlepub add "https://example.com/article" --provider none --store-metadata

Raw artifacts are written under OUT/.raw. Without --store-metadata, stale .raw data is removed.

Fetch Modes

ArticlePub starts with --fetch-mode auto.

  • auto: try local extraction first, then fall back to LLM fetch when needed.
  • local: fetch and extract locally, then optionally ask the provider to clean the HTML.
  • llm: ask the LLM provider to fetch the URL directly.

If you do not want to use an LLM, add --provider none.

Useful Options

Option What it does
--out articlepub Choose where EPUB files are written.
--provider none Build without an LLM or API key.
--api-key ... Pass an Anthropic key directly instead of using ANTHROPIC_API_KEY.
--title "..." Override the EPUB title.
--log-level debug Show detailed timing and Calibre-Web steps.
--doctor Validate an add command without building the EPUB.
--calibre-url ... Upload the result to Calibre-Web.
--calibre-username ... and --calibre-password ... Log in before uploading.
--calibre-shelf "Quick Read" Add the uploaded book to a shelf.

Run uvx articlepub --help or uvx articlepub add --help for the full CLI reference.

Check the installed version:

uvx articlepub --version
uvx articlepub version

Local Development

From a checkout of this repository:

PYTHONPATH=src python -m articlepub add "file://$PWD/tests/fixtures/blog.html" \
  --provider none \
  --fetch-mode local \
  --out /private/tmp/articlepub-check \
  --log-level debug

Run the test suite:

PYTHONPATH=src python -m unittest discover -s tests

Release

Releases are tag-driven. The release workflow runs when a vX.Y.Z tag is pushed.

Before tagging, update the version in both places:

  • pyproject.toml
  • src/articlepub/__init__.py

Then commit, tag, and push:

git tag v0.1.2
git push origin main
git push origin v0.1.2

The GitHub Action will run tests, build the wheel and source distribution, publish to PyPI with Trusted Publishing, and create a GitHub Release with generated release notes. The PyPI trusted publisher should point at the release GitHub Actions environment.

Metadata

Release files for articlepub 0.1.2

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

Source distribution (sdist)

Source distribution for articlepub 0.1.2
File Size Uploaded
articlepub-0.1.2.tar.gz 41.2 kB Details

Built distribution (wheel)

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

Total release size: 78.5 kB

Release files / articlepub-0.1.2.tar.gz

Download URL articlepub-0.1.2.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
378b395e170f6548fec3d96d05d2e665c3535aa1956f2ac8a9cc6366835ba8bd
BLAKE2b-256 checksum
How to use checksums
e9c8980d98a2ec2f1f6b27c40030661ec01c50df2518c7c943790558830b3187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}

Release files / articlepub-0.1.2-py3-none-any.whl

Download URL articlepub-0.1.2-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55bcd2bea6d74d2484d8015fbbcf913d7a3012561487c181693c108e23b7fa2d
BLAKE2b-256 checksum
How to use checksums
9da6c40bc0c25721e778b28641b797373b58227238162e2ab7c8bb51ffc9b4c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.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