Giter Club home page Giter Club logo

pdf-parser's Introduction

PDF Parser

PDF Parser is a Spring Boot-based application designed to extract text and images from PDF attachments within Gmail messages. It relies on Google APIs to access Gmail and Firebase Cloud Storage to save the extracted images.

Prerequisites

To begin, ensure you have the following prerequisites in place:

  • Java 11 or higher
  • Gmail API Credentials JSON (Refer to the Gmail API Quickstart Guide for acquiring these credentials)
  • Firebase API Credentials JSON for Firebase Cloud Storage (You can create a service account and obtain the JSON credentials from the Firebase Console)

Setup

  1. Start by cloning the repository to your local machine:

    git clone https://github.com/gasparyanvazgen/pdf-parser.git
  2. Ensure you have the necessary credentials files available:

  3. Adjust the application.yml file within the src/main/resources directory to match your specific configuration:

    gmail:
      applicationName: pdf-parser
      tokensDirectoryPath: tokens
      credentialsFilePath: /gmail-credentials.json
      userId: [email protected]
    
    firebase:
      storage:
        googleApplicationCredentials: /firebase-credentials.json
        storageBucket: project_id.appspot.com
  4. To launch the application, use Gradle:

    ./gradlew bootRun

The application is now accessible at http://localhost:8080.

Usage

Extracting Bank Statements

To extract bank statements from Gmail messages, initiate a GET request to the following endpoint:

GET http://localhost:8080/api/pdf-parser/parse-bank-statements

Parameters:

  • subject (required): Specify the subject of the Gmail messages you wish to fetch (e.g., "Bank statement").
  • startDate (optional): Set the start date for message filtering (in the format "yyyy-MM-dd").
  • endDate (optional): Define the end date for message filtering (in the format "yyyy-MM-dd").

This endpoint will return a JSON response that includes the extracted text and image URLs from the PDF attachments within matching Gmail messages.

Code Structure

The project is organized as follows:

License

This project is licensed under the MIT License. Refer to the LICENSE file for details.

pdf-parser's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.