Use PyMuPDF to insert PDFs as markdown
Project description
llm-fragments-pdf
A fragment loader for LLM that converts PDF files into markdown plaintext using PyMuPDF4LLM.
This is especially useful for models which don't support attachments.
Installation
Install this plugin in the same environment as LLM:
llm install llm-fragments-pdf
Usage
Use -f 'pdf:filepath' convert a pdf file to markdown text and insert that text as a fragment.
Example:
llm -f 'pdf:my_pdf.pdf' "What is this document about?"
The output includes:
- Filename
- PDF contents as markdown
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-fragments-pdf
python -m venv venv
source venv/bin/activate
Install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Dependencies
- PyMuPDF4LLM: For extracting markdown from PDFs
- llm: The LLM CLI tool this plugin extends
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_fragments_pdf-0.1.tar.gz.
File metadata
- Download URL: llm_fragments_pdf-0.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59d71ec2d111b10401de54fa65dd19b6e1bd01951ff084b56bf599b538815766
|
|
| MD5 |
34161427c64f40b8179a3c523be21e9f
|
|
| BLAKE2b-256 |
591942a425f22fd0ed8797a229ff05499e725bee8dae6fdfa5ab451697541e99
|
Provenance
The following attestation bundles were made for llm_fragments_pdf-0.1.tar.gz:
Publisher:
publish.yml on daturkel/llm-fragments-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_fragments_pdf-0.1.tar.gz -
Subject digest:
59d71ec2d111b10401de54fa65dd19b6e1bd01951ff084b56bf599b538815766 - Sigstore transparency entry: 214878454
- Sigstore integration time:
-
Permalink:
daturkel/llm-fragments-pdf@e84889762f4f44b2909e30d8ce511c23f53232d1 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/daturkel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e84889762f4f44b2909e30d8ce511c23f53232d1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_fragments_pdf-0.1-py3-none-any.whl.
File metadata
- Download URL: llm_fragments_pdf-0.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d821e2d82ebcff5310bda71447494330982ffee773dbcca7b7ecee8275655f7f
|
|
| MD5 |
6236508eac50657db9cfd0ed6b0e810a
|
|
| BLAKE2b-256 |
09507353f001911b73caf4eaec112bf2ce4421af50f3b0e03040506a60608aa2
|
Provenance
The following attestation bundles were made for llm_fragments_pdf-0.1-py3-none-any.whl:
Publisher:
publish.yml on daturkel/llm-fragments-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_fragments_pdf-0.1-py3-none-any.whl -
Subject digest:
d821e2d82ebcff5310bda71447494330982ffee773dbcca7b7ecee8275655f7f - Sigstore transparency entry: 214878456
- Sigstore integration time:
-
Permalink:
daturkel/llm-fragments-pdf@e84889762f4f44b2909e30d8ce511c23f53232d1 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/daturkel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e84889762f4f44b2909e30d8ce511c23f53232d1 -
Trigger Event:
release
-
Statement type: