Skip to main content

paper2kindle

Convert arXiv and SSRN papers into reflowable EPUB 3 documents and send them to Kindle.

The CLI is available as both paper2kindle and p2k.

Install

Install the published package from PyPI with uv:

uv tool install paper2kindle@latest
paper2kindle --version
p2k --help

To use optional Resend delivery, install the resend extra:

uv tool install 'paper2kindle[resend]@latest'

Upgrade an existing installation with uv tool upgrade paper2kindle.

EPUB conversion also requires the official external tools Pandoc, EPUBCheck. The setup wizard checks for both. Paper conversion runs locally; Docling may download its maintained models on first use.

Quick start

Run the first-time setup wizard, verify the configuration, then send a paper:

paper2kindle setup
paper2kindle doctor
p2k send 2401.12345

Setup and delivery

The interactive wizard configures your Kindle address and email delivery and is safe to rerun. To configure or inspect only one area, use one of the mutually exclusive scoped flags:

paper2kindle setup --kindle
paper2kindle setup --email
paper2kindle setup --tools
paper2kindle setup --storage

SMTP is the default. Setup records the host, port, STARTTLS or SSL mode, username, and sender; its password/token is stored in the OS keychain. Add that exact sender to Amazon's Approved Personal Document E-mail List. Credentials can instead be supplied with PAPER2KINDLE_SMTP_PASSWORD.

Resend is optional and requires a user-owned, Resend-verified sending domain:

paper2kindle setup --email  # choose resend

Its API key is stored in the keychain or read from PAPER2KINDLE_RESEND_API_KEY. Each user must provide their own key. Attachments over 29 MiB are rejected before contacting Resend.

Send EPUB by default, or explicitly request PDF. The document is temporary after a successful send unless retained with --keep or --output:

paper2kindle send 2401.12345
p2k send 2401.12345 --delivery resend --keep
p2k send ssrn:1234567 --format pdf --output paper.pdf
p2k send 2401.12345 --dry-run

--delivery is a one-command override and does not alter saved configuration. Dry runs prepare and retain the file without loading credentials or sending.

Supported sources

Source Accepted input
arXiv Modern or legacy ID, arXiv: ID, abstract URL, or PDF URL
SSRN ssrn:<id>, numeric abstract ID, or canonical paper URL

Only publicly accessible papers are supported. paper2kindle does not bypass authentication, paywalls, or source access controls.

Inspect and prepare

Inspecting only performs metadata requests; it does not download or convert the paper:

paper2kindle inspect 2401.12345
p2k inspect https://arxiv.org/pdf/hep-th/9901001.pdf
p2k inspect ssrn:1234567

EPUB 3 is the default and is never silently changed to PDF:

paper2kindle prepare 2401.12345
paper2kindle prepare ssrn:1234567 --output paper.epub
paper2kindle prepare 2401.12345 --format pdf --output paper.pdf
paper2kindle prepare 2401.12345 --strict --debug-artifacts ./debug

EPUB preparation requires pandoc and epubcheck. For arXiv, paper2kindle uses arXiv's official accessible HTML when available; otherwise it uses the published PDF with Docling while still producing EPUB. It never executes downloaded TeX. SSRN uses only publicly advertised PDF links on approved SSRN hosts and does not bypass access controls. Docling is installed as a Python dependency and may download its models on first use. --strict rejects source-fallback warnings, and --debug-artifacts retains conversion intermediates for diagnosis.

The converter checks output for missing structure and assets, fragmented text, unresolved LaTeX, degraded equations, encoding replacement characters, and a missing references section. Severe truncation always stops conversion; --strict also stops on quality warnings.

Security and privacy

  • Downloads require HTTPS and are restricted to approved arXiv or SSRN hosts.
  • Redirects, metadata, PDFs, and image assets are bounded and validated.
  • Downloaded TeX is never executed. arXiv's official accessible HTML is used when available, with Docling PDF extraction as the EPUB fallback.
  • Active HTML and SVG content is removed; raster figures are decoded, re-encoded, and embedded before Pandoc runs in sandbox mode.
  • SMTP passwords and Resend API keys are stored in the OS keychain or supplied through environment variables. They are not written to the config file.
  • The application does not collect telemetry.

PDF parsing and document conversion still process untrusted documents through third-party libraries. Run the CLI with the same care as other local document conversion software.

Development

Python 3.12+ and uv are required:

git clone https://github.com/markosnarinian/paper2kindle.git
cd paper2kindle
uv sync --all-extras
uv run pytest
uv run ruff check .
uv run pyright
uv build

The architecture and implementation roadmap are documented in PLAN.md.

Download files

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

Source Distribution

paper2kindle-0.1.2.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

paper2kindle-0.1.2-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paper2kindle-0.1.2.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for paper2kindle-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3e26f48403fdfabdc05ca3c65972c27d7bb20f8b7ac5d62aab5c6107b4a9add5
MD5 6a57c49debe93e675bed0d209b2f107c
BLAKE2b-256 53f62eb051271565dd11d94ebbd95790ed8dd8931592f051ce91ef5c215d8d8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper2kindle-0.1.2.tar.gz:

Publisher: python-publish.yml on markosnarinian/paper2kindle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: paper2kindle-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for paper2kindle-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4921ba727340893a23afa5a5c74b2ed4b6d99da883ff77f64822d1503042c9bf
MD5 4afa6281e7f4bf7f2c339fe6a122ed2c
BLAKE2b-256 bf24c85d29fbc1f8049515971cc0b8ff3a844a36818d6b6217c44ba09b0c667b

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper2kindle-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on markosnarinian/paper2kindle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

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