Skip to main content

A Python library and CLI tool that uses LLMs to enhance PDF files

Project description

pdfalive


CI GitHub License PyPI - Version PyPI - Python Version

A Python library and set of CLI tools to bring PDF files alive with the magic of LLMs.

Usage

To use the CLIs described below, you can install the python package (pip install pdfalive), or run the cli directly using uvx:

uvx pdfalive generate-toc input.pdf output.pdf

More detailed examples of the CLI sub-commands are provided below. You can also use --help on the main command-line and any of the sub-commands to get an idea of the different options supported.

generate-toc

Automatically generate clickable Table of Contents (e.g. using PDF bookmarks) for a PDF file by extracting features from the PDF and then calling an LLM to infer the pages and section names from these.

Example usage:

pdfalive generate-toc input.pdf output.pdf

By default we use the latest Anthropic Claude Sonnet available, but you can change this by setting the model as part of invocation:

pdfalive generate-toc --model-identifier 'claude-haiku-4-5' input.pdf output.pdf

Note that for using Anthropic models you'd want to set your api key via the environment variable ANTHROPIC_API_KEY. Similar mechanisms apply to OpenAI (OPENAI_API_KEY) and other vendors.

Development

We use uv to manage the library. To install locally can run e.g. with:

uv sync
uv pip install -e .

We use ruff for formatting and linting, mypy for static type checking, and pytest for running unit-tests. We also use pre-commit for ensuring high-quality commits.

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

pdfalive-0.1.0.tar.gz (647.6 kB view details)

Uploaded Source

Built Distribution

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

pdfalive-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file pdfalive-0.1.0.tar.gz.

File metadata

  • Download URL: pdfalive-0.1.0.tar.gz
  • Upload date:
  • Size: 647.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pdfalive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1368107577f88cddadbf6e6c57841653561027b3f5205eb1e48cd42ee890782
MD5 1fd584c4e535fc1176c35dce0df80227
BLAKE2b-256 bf02c27d834ce54eb82bb3982e88e9e108af5f9a2b68956b6f23e05f74341c2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfalive-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on promptromp/pdfalive

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

File details

Details for the file pdfalive-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdfalive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pdfalive-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e202a6a53a0dedadc5b63f9edb5d64d63e6b103a17ab29ea456765f7f00c1c20
MD5 ba1051b5e1f09c9fb28975cb5036e661
BLAKE2b-256 7babd7776b8ad157ebdc1a06d249565f5f382ffaa3041473d5153628fd33b93f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfalive-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on promptromp/pdfalive

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

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