Skip to main content

xyberos-documents

Filesystem + document loaders plugin — RFC-0019, M1. Turns plain-text-only ingestion into real document ingestion.

Loaders return text chunks consumed by IngestingKnowledge.ingest:

Loader Formats Dependency
FileLoader .md .txt .json .py .rst … + directory walks stdlib only
HtmlLoader .html .htm (tag stripping) stdlib only
CsvLoader .csv stdlib only
PdfLoader .pdf lazy pypdf / PyPDF2 / pymupdf
DocxLoader .docx lazy python-docx
XlsxLoader .xlsx .xlsm lazy openpyxl

The stdlib loaders keep the zero-dependency core sacred; the binary loaders import their backend lazily and raise a clear ProviderError when missing.

Install

pip install xyberos-documents        # from PyPI
pip install "xyberos-documents[documents]"  # PDF/DOCX/XLSX backends: pypdf, python-docx, openpyxl

# development (editable, from this repo):
pip install -e ./documents
# PDF/DOCX/XLSX backends (also available as the core extra):
pip install xyberos[documents]

Usage

Load a document as text chunks, then feed IngestingKnowledge:

from xyberos import create_app
from xyberos.knowledge import IngestingKnowledge
from xyberos.llm import HashEmbedder
from xyberos.vector import SqliteVectorStore
from xyberos_documents import DocumentsPlugin, load_document

app = create_app(
    knowledge=IngestingKnowledge(SqliteVectorStore("learning.db"), embedder=HashEmbedder())
)
app.load_plugin(DocumentsPlugin())

app.tools.execute("ingest_document", None, path="report.pdf", chunk_size=512)
app.tools.execute("ingest_directory", None, path="docs/", extensions=[".pdf", ".docx"])

Each loader can also be used standalone (no app required):

from xyberos_documents import PdfLoader, DocxLoader, HtmlLoader, load_document

for doc in PdfLoader().load("report.pdf"):
    print(doc.text)

Tools registered

  • ingest_document(path, chunk_size=512, loader=None) — auto-detect by extension (loader can force text/html/pdf/docx/csv/xlsx).
  • ingest_directory(path, extensions=None, chunk_size=512, recursive=True) — walk a folder and route each file to the right loader.

Both require the registered knowledge provider to support ingest() (an IngestingKnowledge); otherwise a clear ProviderError is raised.

Examples

  • examples/ingest_documents.py — generates a sample PDF + DOCX and ingests both, then queries the knowledge base.

Tests

pip install pytest
pytest tests/

Optional-dep tests (pdf, docx, xlsx) skip cleanly when their library is not installed — the same pattern as the core's test_sentence_embedder.py.

Contract & ship location

  • Contract: Knowledge (via IngestingKnowledge), plus Tool for the two ingest tools.
  • Ship: FileLoader / HtmlLoader / CsvLoader are stdlib (would be Core); PdfLoader / DocxLoader / XlsxLoader map to the [documents] extra.
  • Dependencies: xyberos>=1.0,<2; optional [documents] for binary formats.

Typing

This package is fully inline-annotated and ships a PEP 561 py.typed marker, so Pylance/Pyright and mypy analyze it as a typed package. The marker is also declared under [tool.setuptools.package-data] to keep the intent explicit. Strict-mode consumers do not need reportMissingTypeStubs suppressions or python.analysis.useLibraryCodeForTypes overrides for from xyberos_documents import DocumentsPlugin.

Metadata

Release files for xyberos-documents 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xyberos-documents 0.1.2
File Size Uploaded Provenance Actions
xyberos_documents-0.1.2.tar.gz 15.3 kB With provenance Details for xyberos_documents-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xyberos-documents 0.1.2
File Interpreter ABI Platform Actions
xyberos_documents-0.1.2-py3-none-any.whl Python 3 none any Details for xyberos_documents-0.1.2-py3-none-any.whl

Total release size: 30.3 kB

Release files / xyberos_documents-0.1.2.tar.gz

Download URL xyberos_documents-0.1.2.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b871202f9c915d3e24a259353c30c001dbae28ac74544cd37cadade48e035e66
BLAKE2b-256 checksum
How to use checksums
8373c4610dd60d256460bb069e6f2ef2b1c58f92fcbf7452e321ec85f6820d3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xyberos_documents-0.1.2-py3-none-any.whl

Download URL xyberos_documents-0.1.2-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
660e7d86c0bef6ef897fec15d01d1f09a3ba52cd8c87c93eb1fff4701f352bc4
BLAKE2b-256 checksum
How to use checksums
2f3e490e84f1429317fbfaf3036cc12e1102bf9627eb0d1a598083821e8222c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for xyberos-documents 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xyberos_documents-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page