Skip to main content

Turn article URLs into Kindle-friendly EPUBs and optionally upload them to Calibre-Web.

Project description

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.

Project details


Download files

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

Source Distribution

articlepub-0.1.2.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

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

articlepub-0.1.2-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file articlepub-0.1.2.tar.gz.

File metadata

  • Download URL: articlepub-0.1.2.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for articlepub-0.1.2.tar.gz
Algorithm Hash digest
SHA256 378b395e170f6548fec3d96d05d2e665c3535aa1956f2ac8a9cc6366835ba8bd
MD5 fec736273393f4f028a7d6a28357eb39
BLAKE2b-256 e9c8980d98a2ec2f1f6b27c40030661ec01c50df2518c7c943790558830b3187

See more details on using hashes here.

File details

Details for the file articlepub-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: articlepub-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for articlepub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55bcd2bea6d74d2484d8015fbbcf913d7a3012561487c181693c108e23b7fa2d
MD5 cee6d59a6287a4c03d10e3649abd2b67
BLAKE2b-256 9da6c40bc0c25721e778b28641b797373b58227238162e2ab7c8bb51ffc9b4c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page