Coder Social home page Coder Social logo

pdf2csv-converter's Introduction

Features

  • Converts PDF to CSV, JPG and TXT
  • Compatible with python 3
  • Super Small in size (the .py files only)
  • Supports one page at a time

Updates

  • Added CLI and config.ini
  • Now outputs with the same filename as the source (but in csv format ofcourse)
  • added pathlib library, so it'll probably work in all operating systems

PDF2CSV - Converter

Have a PDF scanned from a picture by an app like camscanner and you need to type it all in MS Excel? Well, here is a program to cure your seemingly uncurable sadness. By the orders of peaky blinders


Why I made it?

All the converters on the internet just fill the complete image in a single cell of excel thereby making it useless for further calculations. This converter will make your work easier.

How it Works

It works in 3 steps

Step 1 - Conversion of PDF to JPG

Step 2 - Conversion of JPG to TXT

Step 3 - Conversion Formatting of TXT to CSV

Installation

  1. You will need python 3 installed, latest version will do.

  2. Download poppler for your operating system.

  3. Download Tesseract-OCR for your system and install it.

  4. In cmd/terminal,

    pip install pytesseract

  5. Install pdf2image and pillow by pip install pdf2image

    pip install pillow

  6. Clone or download the files in this repo and extract them.

  7. Done!

How to use

  1. Open the config.ini file in your favourite text editor and enter in it, the path of 'poppler' bin directory and 'Tesseract' and save the file.

  2. In cmd/terminal/Power shell enter

    python pdf2csv.py -i filetoconvert.pdf
    
  3. DONE!

Tip - If you want to convert a file in different folder, in cmd, put full address, eg.

   python pdf2.csv.py -i "C:\Users\USERNAME\someRandomFolder\samplefile.pdf"

It is advised to put the address in double inverted commas because it avoids error due to folder with spaces in their name.

PS - type python pdf2csv.py -h to see all available arguements in command line.

Modules involved

  • PIL or pillow
  • csv
  • pytesseract
  • os
  • pdf2image
  • argeparse
  • configparser
  • pathlib

pdf2csv-converter's People

Contributors

sahilchoudhary22 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.