News for hackers. Stuff that matters.
Re:Textract, a Python package for extracting text from any d... by quink on Sunday August 03, 2014 @09:06PM (#8129772)
I realise that it's nice that it'll give you a single function to dump whatever file format into (while actually running it through a shell command in the backend), but it's not that hard to:

  out = ""
  pdf = pyPdf.PdfFileReader(stream)
  try:
      if pdf.getIsEncrypted():
          pdf.decrypt('')
      for page in pdf.pages:
          out += page.extractText()
  except NotImplementedError:
      # Yeah, this ain't happening

There are no comments on this comment yet.