A lightweight Python utility for extracting text from multiple file formats — PDF, Word (.docx), CSV, and plain text — via a single unified interface.
- Single
extract_text()interface for all supported formats - Automatic file type detection based on extension
- Supports:
- PDF files (via
pdfplumber) - Word documents (
.docx, viapydocx) - CSV files (standard library)
- Plain text files (
.txt)
- PDF files (via
- Per-format error isolation to prevent one failure from blocking others
- Python 3.8+
- Dependencies:
-
Clone the repository:
git clone https://github.com/your-username/scraper.git cd scraper -
Install dependencies:
pip install pdfplumber pydocx
from main import extract_text
text = extract_text("document.pdf")
print(text)Supported file extensions: .pdf, .docx, .csv, .txt
scraper/
├── main.py # All extraction logic