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
-
Clone the repository.
-
Install the dependencies:
pip install -r requirements.txt -
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e23a2cd70a89a81c9d9a13023621a1b4919ac85f73e6f11ecfd62a3c76c4324e
|
|
| MD5 |
e35f4740dffc094d1d23d52563bd2cef
|
|
| BLAKE2b-256 |
b78eab5a11242fb1679b3dc4fbec081e6236744e0bd21db4bc8733c252c89d36
|
File details
Details for the file file_text_extractor-0.1-py3-none-any.whl.
File metadata
- Download URL: file_text_extractor-0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7302e1ac0fcc1de18640a68a46c371c205dbab7c332c364e6ff0ff98d24b2125
|
|
| MD5 |
c2426ae565942201a9dd6f9e68914b88
|
|
| BLAKE2b-256 |
f3de2d04c740a623c6ac7ba07a2086745453fd0cc5843119844347f1abe56c06
|