Skip to main content

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 string
  • load_csv(filepath) – Returns rows as a list of dictionaries
  • load_json(filepath) – Returns parsed JSON data
  • load_xml(filepath) – Returns a nested dictionary representation

doc_loader

  • load_pdf(filepath) – Extracts all text from a PDF
  • load_docx(filepath) – Returns paragraph text as a list of strings
  • load_pptx(filepath) – Returns slide text as a list of lists
  • load_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


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)

Uploaded Source

Built Distribution

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

unidocloader-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for unidocloader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ce2726087290d427edf68dc9d349535f93ee9eb66a12a14d328f7abc5ae989c4
MD5 36564fc2dde5fc19770b3455b4e597cc
BLAKE2b-256 a7c0cf86bf827dee83d487e906b798988c70e7d8aa4c60c94fcb7493c5c0ad20

See more details on using hashes here.

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

Hashes for unidocloader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 062857ddff63a08678606688e10ae347e692d30c17f055b3a3101f0dbdacba22
MD5 9a463826c397b815d31d15011320939a
BLAKE2b-256 9287e393467b921dd068e9b8ee237619b640c4e7a7c8110e59e3500c8127adbf

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