Skip to main content

A package to extract text from various file formats including PDF and DOCX.

Project description

File Text Extractor

This package allows you to extract text from .pdf, .docx, and .txt files, either from a local file path or from a Google Cloud Storage (GCS) URI. The package handles file extraction directly in memory for GCS files, without the need to download them to the local system.

Installation

  1. Clone the repository.

  2. Install the dependencies:

    pip install -r requirements.txt
    
  3. Install the package locally:

    pip install .
    

Usage

Extracting from a Local File

from file_text_extractor import extract_text

# Extract text from a local PDF, DOCX, or TXT file
local_file_path = '/path/to/your/file.pdf'
text = extract_text(file_path=local_file_path)
print(text)

### Extracting from a GCS URI

```python
from file_text_extractor import extract_text

# Extract text from a file in GCS
gcs_uri = 'gs://your-bucket-name/path/to/your/file.pdf'
text = extract_text(gcs_uri=gcs_uri)
print(text)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

file_text_extractor-0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

file_text_extractor-0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file file_text_extractor-0.1.tar.gz.

File metadata

  • Download URL: file_text_extractor-0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for file_text_extractor-0.1.tar.gz
Algorithm Hash digest
SHA256 e23a2cd70a89a81c9d9a13023621a1b4919ac85f73e6f11ecfd62a3c76c4324e
MD5 e35f4740dffc094d1d23d52563bd2cef
BLAKE2b-256 b78eab5a11242fb1679b3dc4fbec081e6236744e0bd21db4bc8733c252c89d36

See more details on using hashes here.

File details

Details for the file file_text_extractor-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for file_text_extractor-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7302e1ac0fcc1de18640a68a46c371c205dbab7c332c364e6ff0ff98d24b2125
MD5 c2426ae565942201a9dd6f9e68914b88
BLAKE2b-256 f3de2d04c740a623c6ac7ba07a2086745453fd0cc5843119844347f1abe56c06

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