Coder Social home page Coder Social logo

pdftable-api's Introduction

pdftable-api

A simple REST API accepting PDF files and returning table data as JSON built on top of pdf-table-extractor

I wanted to play around with Docker a bit and figured this would be a good first step to learn how to build and dockerize a Node.js application. You probably shouldn't use this in anything serious.

Build & run

  1. Clone the repository: git clone [email protected]:that-one-tom/pdftable-api.git
  2. Change into the newly created directory: cd pdftable-api
  3. Build the Docker image: docker build --tag that-one-tom/pdftable-api .
  4. Run it: docker run -p 9010:8080 -d that-one-tom/pdftable-api (Replace 9010 with the port you want the app to be available under)

Usage

Send the file in a multipart form POST request to the /upload endpoint using the field name file:

Insomnia Screenshot

Use Case

I am currently using this in my n8n environment to read and parse numeric data published by my local county council (who themselves don't provide data through easily machine-readable files or an API but upload PDF files generated using Microsoft Word).

My n8n workflow first stores new PDFs it finds, uploads them to this REST API and then transforms and stores the extracted data:

n8n Screenshot

There are a couple of commercial solutions providing a REST API for this particular data parsing job too. However, I found they neither were a good fit for n8n environments because they don't work synchronously or are too expensive.

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.