Skip to content

Commit b614d4e

Browse files
feat: crate README and requirements.txt
1 parent ab82ef2 commit b614d4e

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

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)