Skip to main content

Language Processing Tool

Language Processing Tool is a Python package that processes PDFs and detects languages in documents. It supports both text-based and scanned PDFs using OCR.

Installation

You can install the package from PyPI using:

pip install language-processing-tool

Features

  • Extracts text from PDFs (both text-based and scanned).
  • Uses OCR (Tesseract) for image-based PDFs.
  • Detects the dominant language and provides a language distribution.
  • Supports batch processing of multiple PDFs.
  • CLI and programmatic usage available.

Usage

In Python Code

To use this package in your Python script:

from language_processing_tool.process_pdfs import process_pdfs, process_single_file

# Process a single PDF file
print(process_single_file("/path/to/file.pdf"))

# Process multiple PDFs from a directory (using CSV input)
process_pdfs("/path/to/input_folder/", "pdf_files.csv", "/path/to/output_folder/")

Command Line Usage

After installing the package, you can use the CLI tool:

Process a Single PDF

process-pdfs /path/to/file.pdf

Batch Processing (Using CSV)

process-pdfs /path/to/input_folder/ /path/to/csv_file.csv /path/to/output_folder/

CSV File Format

The CSV file should contain a column named filename, listing the PDF filenames (without extensions). Example:

filename
document1
document2
document3

Make sure the corresponding PDFs (document1.pdf, document2.pdf, etc.) are in the specified input folder.

Project Structure

language_processing_tool
├── LICENSE
├── README.md
├── setup.py
├── pyproject.toml
├── requirements.txt
├── language_processing_tool
│   ├── __init__.py
│   ├── process_pdfs.py
│   ├── sourcecode.py
├── tests
│   ├── test.py

Entry Points

The package includes a CLI entry point:

process-pdfs <arguments>

which maps to the main() function in process_pdfs.py.

Dependencies

This package requires:

  • pytesseract
  • langdetect
  • pandas
  • PyMuPDF
  • icecream
  • Pillow
  • argparse

License

This project is licensed under the MIT License.

Author

Metadata

Release files for language-processing-tool 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for language-processing-tool 0.2.7
File Size Uploaded
language_processing_tool-0.2.7.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for language-processing-tool 0.2.7
File Interpreter ABI Platform
language_processing_tool-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / language_processing_tool-0.2.7.tar.gz

Download URL language_processing_tool-0.2.7.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4a536db53fb670105fc829a90f2e2d75e46cdb9c24bfe0e7907fe17f61cfad42
BLAKE2b-256 checksum
How to use checksums
dc649800103e9fc46e141ae6585c6772aef523d13269e8b719e82582cf9559cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / language_processing_tool-0.2.7-py3-none-any.whl

Download URL language_processing_tool-0.2.7-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
025c37ec7b0ac96a3b8b0fe5af3ad4dcd34eefda2069d998dbf1d5f18d649be8
BLAKE2b-256 checksum
How to use checksums
87167f09845c2e60a320dfc87c6a3185bc7420a776cf181429058f432521a872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page