Metadata-Version: 2.1
Name: simple-pdf2text
Version: 0.0.1
Summary: A small package to extract text from pdf
Home-page: https://github.com/OnlyAR/pdf2text
Author: Only(AR)
Author-email: zhangjh.se@outlook.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: certifi
Requires-Dist: charset-normalizer
Requires-Dist: idna
Requires-Dist: requests
Requires-Dist: tika
Requires-Dist: urllib3
Requires-Dist: wordninja

# PDF2Text Converter

[中文文档](README-zh.md)

This Python utility, `pdf2text.py`, converts PDF documents into plain human-readable text format by processing line
breaks in words and sentences. The script is capable of reading other file types too, but it's specially equipped to
handle PDFs.

### Features

- Extracts text content from PDF and other document formats supported by [Apache Tika](https://tika.apache.org/).
- Corrects word breaks that occur due to hyphenation supported by [wordninja](https://github.com/keredson/wordninja/)(
  e.g., "low- power" -> "low-power", "im- plement" -> "implement").
- Optionally corrects sentence breaks that occur due to newline characters.

### Installation

1. Install the package and requirements by running:

   ```shell
   pip install git+https://github.com/OnlyAR/pdf2text.git
   ```

   or use ssh:

   ```shell
   pip install git+ssh://git@github.com/OnlyAR/pdf2text.git
   ```

2. Make sure the java environment is installed and the correct path is configured to execute the `java` command.

### Usage

To convert a file to text, use the `pdf2text` function.

```python
from pdf2text import pdf2text

file_path = 'path_to_your_pdf_file.pdf'
with open(file_path, 'rb') as file:
    text_content = pdf2text(file, word_line_break=True, sentence_line_break=False)
    print(text_content)
```

For further details and options, please refer to the Chinese .
