Spaces:
Sleeping
Sleeping
metadata
title: FastAPI PDF Processor
emoji: π
colorFrom: gray
colorTo: blue
sdk: docker
app_file: app/main.py
pinned: false
Project Structure
FastAPI PDF Processor
This project is a FastAPI application designed to process PDF files. It includes functionality for analyzing PDF types, extracting text or images, and formatting the output.
Project Structure
fastapi-pdf-processor
βββ app
β βββ main.py # Entry point of the FastAPI application
β βββ extraction.py # Contains the process_pdf_task function
β βββ utils.py # Utility functions for PDF processing
βββ requirements.txt # Project dependencies
βββ README.md # Project documentation
Setup Instructions
Clone the repository:
git clone <repository-url> cd fastapi-pdf-processor
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install the required dependencies:
pip install -r requirements.txt
Usage
To run the FastAPI application, execute the following command:
uvicorn app.main:app --reload
You can then access the API at http://127.0.0.1:8000
.
API Endpoints
- POST /process_pdf: This endpoint accepts a PDF file and processes it using the
process_pdf_task
function. The response will include the document type and the parsed document.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.