Skip to content

Commit cdcc4a3

Browse files
Merge pull request #3 from renan-siqueira/documentation
Documentation
2 parents ab82ef2 + 2c69449 commit cdcc4a3

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 renan-siqueira
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# PDF Text Extraction Tool
2+
3+
## Description
4+
5+
This project facilitates the extraction of text from PDF files using various Python libraries. It is designed to be flexible, allowing the choice among different text extraction libraries and supporting both single PDF file and directory containing multiple PDF files.
6+
7+
---
8+
9+
## Project Structure
10+
11+
```markdown
12+
- main.py
13+
- extractors/
14+
- __init__.py
15+
- pypdf2_extractor.py
16+
- pdfminer_extractor.py
17+
- pymupdf_extractor.py
18+
- pdfplumber_extractor.py
19+
- helpers/
20+
- __init__.py
21+
- utils.py
22+
- json/
23+
- params.json
24+
```
25+
26+
---
27+
28+
## Configuration
29+
30+
- **Python:** This project is developed in Python. Ensure you have the latest version of Python installed.
31+
- **Dependencies:** The required libraries are listed in each extraction file within the `extractors` folder. Install them using `pip install <library>`.
32+
33+
_Use the `requirements.txt` file to install all libraries at once_
34+
35+
---
36+
37+
## Usage
38+
39+
1. **Initial Setup:** Edit the `json/params.json` file to set the input path (`input_path`), output path (`output_path`), desired libraries (`libraries`), and log level (`log_level`).
40+
41+
Example `params.json`:
42+
43+
```json
44+
{
45+
"input_path": "/path/to/pdf/or/directory",
46+
"output_path": "/path/to/output/directory",
47+
"libraries": ["pypdf2", "pdfminer"],
48+
"log_level": "INFO"
49+
}
50+
```
51+
52+
2. **Execution:** Run the `main.py` script to start the text extraction process.
53+
54+
```bash
55+
python main.py
56+
```
57+
58+
---
59+
60+
## Features
61+
62+
- Text extraction from PDF files using various libraries.
63+
- Supports processing either a single file or multiple files in a directory.
64+
- Automatic output folder generation based on input.
65+
- Flexible configuration via the json/params.json file.

requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cffi==1.16.0
2+
charset-normalizer==3.3.2
3+
cryptography==41.0.5
4+
pdfminer==20191125
5+
pdfminer.six==20221105
6+
pdfplumber==0.10.3
7+
Pillow==10.1.0
8+
pycparser==2.21
9+
pycryptodome==3.19.0
10+
PyMuPDF==1.23.6
11+
PyMuPDFb==1.23.6
12+
PyPDF2==3.0.1
13+
pypdfium2==4.24.0

0 commit comments

Comments
 (0)