A universal document loader supporting TXT, CSV, JSON, XML, PDF, DOCX, PPTX, and XLSX
Project description
unidocloader
A universal document loader library for Python. Load content from multiple file formats with a single, simple API.
Installation
pip install unidocloader
Supported Formats
| Format | Function | Module |
|---|---|---|
.txt |
load_txt() |
text_loader |
.csv |
load_csv() |
text_loader |
.json |
load_json() |
text_loader |
.xml |
load_xml() |
text_loader |
.pdf |
load_pdf() |
doc_loader |
.docx |
load_docx() |
doc_loader |
.pptx |
load_pptx() |
doc_loader |
.xlsx |
load_xlsx() |
doc_loader |
Modules
text_loader
load_txt(filepath)– Returns file content as a stringload_csv(filepath)– Returns rows as a list of dictionariesload_json(filepath)– Returns parsed JSON dataload_xml(filepath)– Returns a nested dictionary representation
doc_loader
load_pdf(filepath)– Extracts all text from a PDFload_docx(filepath)– Returns paragraph text as a list of stringsload_pptx(filepath)– Returns slide text as a list of listsload_xlsx(filepath)– Returns rows as a list of dictionaries (first row = headers)
Usage Examples
from unidocloader import load_txt, load_csv, load_json, load_pdf, load_docx
# Load a text file
content = load_txt("notes.txt")
print(content)
# Load a CSV file
rows = load_csv("data.csv")
for row in rows:
print(row)
# Load a JSON file
data = load_json("config.json")
print(data)
# Load a PDF file
text = load_pdf("report.pdf")
print(text)
# Load a Word document
paragraphs = load_docx("letter.docx")
for p in paragraphs:
print(p)
License
MIT
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
unidocloader-1.0.0.tar.gz
(4.0 kB
view details)
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 unidocloader-1.0.0.tar.gz.
File metadata
- Download URL: unidocloader-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce2726087290d427edf68dc9d349535f93ee9eb66a12a14d328f7abc5ae989c4
|
|
| MD5 |
36564fc2dde5fc19770b3455b4e597cc
|
|
| BLAKE2b-256 |
a7c0cf86bf827dee83d487e906b798988c70e7d8aa4c60c94fcb7493c5c0ad20
|
File details
Details for the file unidocloader-1.0.0-py3-none-any.whl.
File metadata
- Download URL: unidocloader-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
062857ddff63a08678606688e10ae347e692d30c17f055b3a3101f0dbdacba22
|
|
| MD5 |
9a463826c397b815d31d15011320939a
|
|
| BLAKE2b-256 |
9287e393467b921dd068e9b8ee237619b640c4e7a7c8110e59e3500c8127adbf
|