Skip to content

ppadiya/Pdf_form_buddy

Repository files navigation

User App

User App is a web application designed to handle user registration, login, profile management, and PDF form processing. This project is still a work in progress.

Features

  • User Registration and Login
  • Profile Management
  • PDF Form Upload and Field Extraction
  • OCR Processing for Scanned PDFs
  • Form Autofill using Profile Data

Project Structure

user_app/ ├── pycache/ ├── p/ ├── .env ├── app.py ├── app.py.backup ├── app.log ├── config.py ├── database.py ├── fieldextractor.log ├── fieldextractor.py ├── fill_form_handler.py ├── form_autofill.py ├── ocr_processor.py ├── requirements.txt ├── retrievedata.py ├── static/ │ └── css/ │ └── styles.css ├── templates/ │ ├── base.html │ ├── fill_form.html │ ├── login.html │ ├── profile.html │ ├── register.html │ ├── review_form.html │ ├── upload_form.html │ └── view_profile.html ├── Sample Files/ ├── TEST.PY └── uploads/

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/user_app.git
    cd user_app
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Set up the environment variables in a .env file:

    HUGGINGFACE_API_KEY="your_huggingface_api_key"
    SECRET_KEY="your_secret_key"
    WTF_CSRF_SECRET_KEY="your_csrf_secret_key"
    DEEPSEEK_API_KEY="your_deepseek_api_key"
  5. Initialize the database:

    python -c "from database import init_db; init_db()"

Usage

  1. Run the application:

    flask run
  2. Open your web browser and go to http://127.0.0.1:5000/.

Project Components

The main application file that sets up the Flask app, routes, and handles user authentication and profile management.

Contains configuration settings for the Flask app, including secret keys and session settings.

Handles database connections and operations, including user and profile management.

Uses the DeepSeek API to extract fields from uploaded PDF forms.

Handles the form filling process, including field validation and autofill using profile data.

Contains logic for autofilling form fields based on user profile data.

Processes PDF files using OCR to extract text content.

A utility script to retrieve and print user data from the database.

Templates

Static Files

  • styles.css: Contains the CSS styles for the application.

Logs

Testing

To run the tests, use the following command:

python TEST.PY

Contributing
Contributions are welcome! Please fork the repository and submit a pull request.



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published