Extract clean text from PDFs.
Project description
txt-from-pdf: Extract clean text from PDFs
Extracting text from pdfs using pdfminer.six and pypdf. Adapted from PDFextract.
Installation
pip install txt-from-pdf
Usage
from txtfrompdf import extract_txt_from_pdf
pdf_path = "file.pdf"
text = extract_txt_from_pdf(pdf_path)
print(text)
CLI Usage
Single file:
txt-from-pdf --input file.pdf --output extracted-text
Multiple files in a directory:
txt-from-pdf --input dir-with-pdfs --output extracted-text
Detailed help:
usage: txt-from-pdf [-h] --input INPUT [--output OUTPUT] [--no_filter] [--size SIZE]
txt-from-pdf CLI - Extracts cleaned text from PDF files
options:
-h, --help show this help message and exit
--input INPUT Path to a folder containing PDFs or to a single PDF file. (Required)
--output OUTPUT Output location for the extracted text files. (Optional, default: 'extracted_text')
--no_filter Turn off cleaning the resulting text files. (Optional)
--size SIZE Maximum file size per page in bytes for processing (mostly images). (Optional, default: 300000)
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
txt-from-pdf-1.1.1.tar.gz
(13.9 kB
view details)
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 txt-from-pdf-1.1.1.tar.gz.
File metadata
- Download URL: txt-from-pdf-1.1.1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf24d63867db2fa648a58493fa5c33c84809a3a90c3fa2557c8b472d49199bc9
|
|
| MD5 |
d645e02c464c65e13b91e25ce0b35fd7
|
|
| BLAKE2b-256 |
b2c36784e51e973000607cf708569626fa66b7059fb74d06a92dbeb5c1275ff7
|
File details
Details for the file txt_from_pdf-1.1.1-py3-none-any.whl.
File metadata
- Download URL: txt_from_pdf-1.1.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a06323c556409ea08ee6b2057dbf7066ca4c19fabfdbde0fe5362a2ae44fc4c
|
|
| MD5 |
ae45f463e39149b6fe1e685f919ba0f1
|
|
| BLAKE2b-256 |
aead739f20805cd182effebd2ee65029a08219304ad3050cec6208fca303c673
|