Coder Social home page Coder Social logo

reformatpdf's Introduction

ReformatPDF

A program that allows you to convert large PDF tables to JSON for further work.



Spoiler func reformat
def reformat(self) -> dict:
        
  В зависимости от полученного списка словарей форматирует данные по нужному шаблону.

  [{'top': 241.32117, 'left': 114.458305, 'width': 148.84747314453125, 'height': 23.783233642578125,
   'text': 'Шулаева Евгения Юрьевна\r(Бакалавриат)'},
  {'top': 241.32117, 'left': 263.3058, 'width': 58.32025146484375, 'height': 23.783233642578125, 'text': ''},
  {'top': 241.32117, 'left': 321.62604, 'width': 53.400787353515625, 'height': 23.783233642578125, 'text': ''},
  {'top': 241.32117, 'left': 375.02682, 'width': 95.03976440429688, 'height': 23.783233642578125, 'text': 'Копия'},
  {'top': 241.32117, 'left': 470.0666, 'width': 94.81597900390625, 'height': 23.783233642578125, 'text': 'V'},
  {'top': 0.0, 'left': 0.0, 'width': 0.0, 'height': 0.0, 'text': ''}]
  Вернет : 
  {'name': 'Шулаева Евгения Юрьевна', 'form_of_education': 'Бакалавриат', 'document_type': 'Копия', 'consent': True}


  [{'top': 264.92746, 'left': 64.614006, 'width': 49.84033966064453, 'height': 12.490386962890625, 'text': '48.03.01'},
  {'top': 264.92746, 'left': 114.454346, 'width': 148.8521728515625, 'height': 12.490386962890625, 'text': 'Теология'},
  {'top': 264.92746, 'left': 263.30652, 'width': 58.32073974609375, 'height': 12.490386962890625, 'text': '9'},
  {'top': 264.92746, 'left': 321.62726, 'width': 53.399078369140625, 'height': 12.490386962890625, 'text': '32'},
  {'top': 264.92746, 'left': 375.02634, 'width': 95.03768920898438, 'height': 12.490386962890625, 'text': ''},
  {'top': 264.92746, 'left': 470.06403, 'width': 94.8138427734375, 'height': 12.490386962890625, 'text': '9'}]
  Вернет:
  {'code': '48.03.01', 'name': 'Теология', 'number_of_seats': '9', 'applications': '32', 'consent': '9'}


reformatpdf's People

Contributors

dotx12 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ekamjeet

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.