Skip to main content

PDF to TXT

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

EXPDF2TXT

🤔 Overview

The expdf2txt is a versatile and efficient package designed for seamless conversion of PDF (Portable Document Format) files into TXT (Plain Text) format. This package empowers users with a straightforward and reliable method to extract textual content from PDF documents, making it easily accessible and editable."

❓ Features

1. InvoiceExtractor (Convert Invoice Pdf to Text)

Code:

from expdf2txt.invoice2data import InvoiceExtractor
FILEPATH = "invoice_2001321.pdf"
invocie_extractor = InvoiceExtractor(FILEPATH)
data = invocie_extractor.openai_extract_data(format_data=True)
print(data)

2. ImageExtractor (extract image from pdf)

Code:

from expdf2txt.pdf2data import PDFExtractor
FILEPATH = "invoice_2001321.pdf"
pdf_obj = PDFExtractor(FILEPATH)
pdf_obj.extract_image()

🚀 Methods

1. InvoiceExtractor methods :

openai_extract_data() 'This method extracts text from a Invoice Pdf'

  • Parameters:
  1. temperature (float, optional): The temperature parameter for the OpenAI LLM.
  2. api_key (str, optional): The API key for accessing OpenAI services. Note: "If the default API key is not functioning, please provide an alternative API key for use."
  3. template (str, optional): Custom template string for document extraction.
  4. format_data (bool, optional): If True, format the extracted data into a dictionary or list; if False, return raw output. Note: "If the data is successfully converted into a dictionary, it will be returned as a dictionary. Otherwise, it will be returned as a list."

2. PDFExtractor methods:

  • countpages() 'Count the number of pages in the document.'
  • extract_string() 'Extract the data from the source.'
  • extract_image() 'Extract images from the PDF document and saves them as separate files.'

Dependencies

  • openai

  • pytesseract

  • PyPDF2

  • PyMuPDF

License

This project is licensed under the MIT License - see the LICENSE file for details.

Issues

If you encounter any issues or have suggestions, please create an issue on the GitHub repository.

Acknowledgments

Mention any libraries or tools you used and give credit to their respective authors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expdf2txt-1.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

expdf2txt-1.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file expdf2txt-1.1.1.tar.gz.

File metadata

  • Download URL: expdf2txt-1.1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for expdf2txt-1.1.1.tar.gz
Algorithm Hash digest
SHA256 170df1a04badf9f76836c9e84eb7d81f8a2f763db01be1dd8c6d017221c7b9c7
MD5 68eff44b51b68adf8cc897194cde3b3e
BLAKE2b-256 4f4d444b363fe9b8a264a0fa886ea6d79e1f777ceef9de4d5ce9866b7765f366

See more details on using hashes here.

File details

Details for the file expdf2txt-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: expdf2txt-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for expdf2txt-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 354412dc3775e1047c81acc68694202b90b857d7d78bcacf7838f3f227c50dac
MD5 79fbc32d74ef9d88af8a3ee6eb9a9282
BLAKE2b-256 3b27b5a4cd4d90d2b060b89b7ead9f815c89cabe617b2fb8459d3780964b4525

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page