Extracts data from PDF files and saves it to Excel files.
Project description
📄 pdfsp
pdfsp is a Python package that extracts tables from PDF files and saves them to Excel. It also provides a simple Streamlit app for interactive viewing of the extracted data.
🚀 Features
- Extracts tabular data from PDFs using
pdfplumber - Converts tables into
pandasDataFrames - Saves output as
.xlsxExcel files usingopenpyxl - Ensures column names are unique to prevent issues
- Visualizes DataFrames with
streamlit
📦 Installation
Make sure you're using Python 3.10 or newer, then install with:
pip install pdfsp -U
python script
# pdf.py
from pdfsp import extract_tables, Options
# Define extraction options
source_folder = "."
output_folder = "output"
combine_tables = True
options = Options(
source_folder=source_folder,
output_folder=output_folder,
combine=combine_tables
)
# Run the table extraction
extract_tables(options)
From console / Terminal / Command Line
# Extract all tables from all PDF files in the current folder and save them to the current folder
pdfsp . .
# Extract and COMBINE big tables (spanning multiple pages) into single files, saved to the current folder
pdfsp . . --combine
# Extract all tables from PDF files in 'someFolder' and save them to 'SomeOutFolder'
pdfsp someFolder SomeOutFolder
# Extract all tables from 'some.pdf' and save them to the current folder
pdfsp some.pdf .
# Extract all tables from 'some.pdf' and save them to 'toThisFolder'
pdfsp some.pdf toThisFolder
=== 📊 Extraction Summary Report ===
✅ Successful Files: 3
- pdfs/report1.pdf → 🗂️ 5 tables extracted
- pdfs/summary2.pdf → 🗂️ 3 tables extracted
- pdfs/report2.pdf → 🗂️ 7 tables extracted
❌ Failed Files: 1
- pdfs/corrupted.pdf
⚠️ Some files failed to process. See details above.
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
pdfsp-0.1.9.tar.gz
(2.1 MB
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
pdfsp-0.1.9-py3-none-any.whl
(9.7 kB
view details)
File details
Details for the file pdfsp-0.1.9.tar.gz.
File metadata
- Download URL: pdfsp-0.1.9.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53e7fffc7f0ac0fd2e6b1d22b3896b34d44efec065eb62420ad7791d4cb2c4d0
|
|
| MD5 |
daa25be1a7ca8bda2d67dcb5bc221b4d
|
|
| BLAKE2b-256 |
e2a5f9c445d470c7b7a1e4b666bf94841912272a1d6c207b2908917345412ab6
|
File details
Details for the file pdfsp-0.1.9-py3-none-any.whl.
File metadata
- Download URL: pdfsp-0.1.9-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42ba738244e0bececb47c92427ab0665a4da3409a5bab199a0e73a131e3225e4
|
|
| MD5 |
556ba8b364bebc0887925976b7b44e5d
|
|
| BLAKE2b-256 |
72d3edfe0d809cdb2c98f84c393ac5f016c3d8031c82ffae409805216dcf7a56
|