GithubHelp home page GithubHelp logo

micka33 / content-extractor Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 11.0 16.46 MB

Extract meaningful content from pdf and psd file, such as texts and images both linked into a common JSON string

Home Page: https://micka33.github.io/content-extractor/

Python 97.39% Shell 0.85% Ruby 1.75%

content-extractor's People

Contributors

micka33 avatar thuutin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

content-extractor's Issues

No module named psd_tools

Hi,

When I execute the parser script, I get the following error

Traceback (most recent call last):
  File "./parser.py", line 36, in <module>
    json = parse(sys.argv[1], sys.argv[2])
  File "./parser.py", line 24, in parse
    from psdtools import main
  File "/Users/xyz/Documents/tools/content-extractor/psdtools/main.py", line 1, in <module>
    from psd_tools import PSDImage
ImportError: No module named psd_tools

I have installed all the dependencies (curl, brew, python 2.7 ...)

I also tried to install psd_tools separately

Requirement already satisfied (use --upgrade to upgrade): psd-tools in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): docopt>=0.5 in /usr/local/lib/python2.7/site-packages (from psd-tools)

I always get the same error. Do you have any idea ?

pdfminer has changed it's API and broken some links

The euske / pdfminer repository has changed the location of the PDFDocument class, as noted in the README. This class can be refound easily, but also other things have changed as can be deducted from the following error message. I will not pursue this any further and use pdfminer directly.

[..]/pdfsplitter/content_extractor/pdfreader/util/convert.py in <module>()
        2 from pdfminer.pdfparser import PDFParser
        3 from pdfminer.pdfdocument import PDFDocument
----> 4 from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, process_pdf
        5 from pdfminer.pdfdevice import PDFDevice, TagExtractor
        6 from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter

ImportError: cannot import name process_pdf

IndexError: list index out of range

I encounter this problem, though the examples are processed successfully.
File "general.py", line 12, in
json = main.run("Programming with PDFMiner.pdf", "./images/")
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\main.py", line 82, in run
dict_book = text_to_dict(pdf_file)
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\main.py", line 13, in text_to_dict
b = book(xml)
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\lib\book.py", line 20, in init
self._pages.append(page(p))
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\lib\page.py", line 17, in init
self._paragraphs.append(paragraph(p))
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\lib\paragraph.py", line 39, in init
self._lines.append(line(l))
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\lib\line.py", line 40, in init
self._chars.append(char(c))
File "D:\codegit\python2.7\pdfminer\content-extractor-master\pdfreader\lib\char.py", line 30, in init
self._font = xml_char.get('font').split('+')[1] if xml_char.get('font') != None else None
IndexError: list index out of range

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.