DF Extract Lib
Requirements
Python 3.10+ asyncio
Installation
# Using pip
$ python -m pip install df-extract
# Manual install
$ python -m pip install .
1. To extract content from PDF
from df_extract.pdf import ExtractPDF
path = "/home/test/ABC.pdf"
extract_pdf = ExtractPDF(file_path=path)
# By default, output as text
await extract_pdf.extract() # Output will be located `/home/test/ABC.pdf.txt`
# Output as json
await extract_pdf.extract(as_json=True) # Output will be located `/home/test/ABC.pdf.json`
You can change the output directory with simply pass
output_dirparam
from df_extract.pdf import ExtractPDF
path = "/home/test/ABC.pdf"
extract_pdf = ExtractPDF(file_path=path, output_dir="/home/test/output")
await extract_pdf.extract()
Extract content from PDF with image data
This requires
easyocr
from df_extract.base import ImageExtract
from df_extract.pdf import ExtractPDF
path = "/home/test/ABC.pdf"
image_extract = ImageExtract(model_download_enabled=True)
extract_pdf = ExtractPDF(file_path=path, image_extract=image_extract)
await extract_pdf.extract()
2. To extract content from PPT and PPTx
from df_extract.pptx import ExtractPPTx
path = "/home/test/DEF.pptx"
extract_pptx = ExtractPPTx(file_path=path)
# By default, output as text
await extract_pptx.extract() # Output will be located `/home/test/DEF.pptx.txt`
# Output as json
await extract_pptx.extract(as_json=True) # Output will be located `/home/test/DEF.pptx.json`
3. To extract content from Doc and Docx
from df_extract.docx import ExtractDocx
path = "/home/test/GHI.docx"
extract_docx = ExtractDocx(file_path=path)
# By default, output as text
await extract_docx.extract() # Output will be located `/home/test/GHI.docx.txt`
# Output as json
await extract_docx.extract(as_json=True) # Output will be located `/home/test/GHI.docx.json`
4. To extract content from PNG, JPEG and JPG
from df_extract.image import ExtractImage
path = "/home/test/JKL.png"
extract_png = ExtractImage(file_path=path)
# By default, output as text
await extract_png.extract() # Output will be located `/home/test/JKL.png.txt`
# Output as json
await extract_png.extract(as_json=True) # Output will be located `/home/test/JKL.png.json`
Metadata
Release files for df-extract 0.0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| df_extract-0.0.2.1.tar.gz | 11.7 kB | Without provenance | Details for df_extract-0.0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| df_extract-0.0.2.1-py3-none-any.whl | Python 3 | none | any | Details for df_extract-0.0.2.1-py3-none-any.whl |
Total release size: 25.7 kB
Release files / df_extract-0.0.2.1.tar.gz
| Download URL | df_extract-0.0.2.1.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c162dd85881866b8479a969135925ad7d0b881ade7e34ada88ff95b531bd632c
|
|
BLAKE2b-256 checksum How to use checksums |
94b1203a533b073939f66c08b151b02f55a5be4298fd96fc9685175c343df86d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / df_extract-0.0.2.1-py3-none-any.whl
| Download URL | df_extract-0.0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d46d15d8e08dce13904b9ac88ec25d28a40ddac3c8ccb3c39fb5189eb0743004
|
|
BLAKE2b-256 checksum How to use checksums |
af6dd33a87d3de22eccba3495ffa53057f27a027f0eda89d0c1736c18c03aabd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for df-extract 0.0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.