Summary
The Python client currently advertises first-class local PDF and CSV ingestion, but the public Documents API does not actually implement add_pdf() or add_csv(). As shipped, the documented examples will fail at runtime with AttributeError, leaving a half-integrated ingestion feature in the newest modular client.
Context
The recent modular client work added parser utilities for local files in utils/pdf_parser.py and utils/csv_parser.py, and the README/examples position them as supported ingestion workflows. However, lib/documents.py only exposes CRUD, import, filter delete, and search methods; there is no public bridge from the client to those parsers.
This creates a high-impact mismatch in a search engine client, because document ingestion is the first mile of the indexing path. A broken ingestion helper blocks evaluation of the engine on real PDFs/CSVs and undermines trust in the client surface right after the new package/API expansion.
Relevant locations:
lib/documents.py
utils/pdf_parser.py
utils/csv_parser.py
README.md
examples/pdf.py
examples/csv.py
Proposed Implementation
- Add
Documents.add_pdf(collection_name, file_path, options=None) and Documents.add_csv(collection_name, file_path, options=None) to lib/documents.py.
- In each method, parse the local file via the existing helper, build the document payload, and submit it through the existing
add() path so validation/auth/request behavior stays centralized.
- Normalize option handling so callers can override document fields, IDs, metadata inclusion, and parser settings without bypassing validation.
- Add tests covering:
- successful PDF/CSV ingestion helper flow
- missing file / missing optional dependency failures
- generated document shape
- README example parity
- Keep README/examples aligned with the actual shipped API surface.
Impact
This fixes a user-facing runtime bug in the documented happy path, completes an already-started feature, and makes the Python client materially more useful for real indexing workloads. It also reduces onboarding friction for a high-performance search engine, where fast ingestion from local datasets is often the first proof-of-value step.
Summary
The Python client currently advertises first-class local PDF and CSV ingestion, but the public
DocumentsAPI does not actually implementadd_pdf()oradd_csv(). As shipped, the documented examples will fail at runtime withAttributeError, leaving a half-integrated ingestion feature in the newest modular client.Context
The recent modular client work added parser utilities for local files in
utils/pdf_parser.pyandutils/csv_parser.py, and the README/examples position them as supported ingestion workflows. However,lib/documents.pyonly exposes CRUD, import, filter delete, and search methods; there is no public bridge from the client to those parsers.This creates a high-impact mismatch in a search engine client, because document ingestion is the first mile of the indexing path. A broken ingestion helper blocks evaluation of the engine on real PDFs/CSVs and undermines trust in the client surface right after the new package/API expansion.
Relevant locations:
lib/documents.pyutils/pdf_parser.pyutils/csv_parser.pyREADME.mdexamples/pdf.pyexamples/csv.pyProposed Implementation
Documents.add_pdf(collection_name, file_path, options=None)andDocuments.add_csv(collection_name, file_path, options=None)tolib/documents.py.add()path so validation/auth/request behavior stays centralized.Impact
This fixes a user-facing runtime bug in the documented happy path, completes an already-started feature, and makes the Python client materially more useful for real indexing workloads. It also reduces onboarding friction for a high-performance search engine, where fast ingestion from local datasets is often the first proof-of-value step.