melhiq_ocr / README.md
mussie1212's picture
Update README.md
10bbbab verified
|
raw
history blame
1.63 kB
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

  1. Clone the repository:

    git clone <repository-url>
    cd fastapi-pdf-processor
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. 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.