A web-based app to extract and parse text from PDFs using PyMuPDF and Llama-Parse. Interactive PDF upload and text display via Gradio, fully Dockerized for optional deployment.
Functionality
- Extracting text from PDFs using PyMuPDF
- Processing and parsing text with Llama-Parse
- Interactive web interface via Gradio for PDF upload and text display
Infrastructure / Deployment
- Dockerized deployment for quick and reproducible setup
- Architecture documentation with high-level, sequence, and flow diagrams
High-level structure of the application:

- User uploads PDF via Frontend.
- Frontend receives the PDF.
- Frontend sends the PDF to the Backend for processing.
- Backend extract text with PyMuPDF from the PDF.
- Backend processes text with Llama-Parse.
- Backend returns results to Frontend.
- Frontend displays extracted text to user.
Backend
Frontend
Infrastructure | Dev Tools
git clone https://github.com/estelacode/pdf_text_extractor.git
cd pdf_text_extractor
# Create & activate virtual environment
py -3.13 -m venv .venv
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
# Install dependencies
uv pip install -e .
# Configure environment
Configure .env file (copy from .env.example)uv run main.py
# Navigate to http://localhost:7860/pdf_text_extractor/
├── .dockerignore # Files and folders to exclude from Docker builds
├── .env # Environment variables (keep secret)
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
├── .python-version # Python version used in the project
├── .venv/ # Local virtual environment (ignored in git)
├── data/ # Folder for input/output data (PDFs, extracted text, etc.)
├── dist/ # Distribution or build files
├── docs/ # Documentation files
├── main.py # Entry point of the application
├── notebook/ # Jupyter notebooks for experiments or testing
├── pyproject.toml # Project dependencies and metadata
├── README.md # Project README file
├── Dockerfile # Dockerfile to build the container
├── src/ # Source code for the project
└── uv.lock # Dependency lock file for uv- Improve text extraction: Maintain original structure, including paragraphs, headings, and columns
- Add image extraction: Detect and save images from PDFs.
- Add table extraction: Detect tables and export them as CSV or JSON.
- Add API endpoints: Expose extraction and parsing methods as HTTP services (extract, parse, retrieve).
- Add automated tests
- Deploy to cloud: Make the app accessible from anywhere
Build the artifact
# Generate the whl file in the dist folder
uv build Docker Deployment
# Build Docker image
docker build -t pdf_text_extractor .
# Run Docker container
docker run -d -p 8080:8080 pdf_text_extractor
# Run Docker container with environment variables
docker run -d -p 8080:8080 -e LLAMA_CLOUD_API_KEY="YOUR_API_KEY" pdf_text_extractorTools & Frameworks
- Gradio – For building web interfaces.
- Docker Desktop Community – Containerization and deployment.
- uv – Project and dependency management.
PDF Procesing Libraries
- Llama Parse
- Llama Parse-Getting Started
- PyMuPDF
- pdfminer.six – Alternative PDF text extraction library.
Estela Madariaga



