The native PyO3 module returns raw dicts via pythonize, but the Python SDK API expects typed dataclass objects (Document, Page, Metadata, etc.) to be consistent with the subprocess fallback and test expectations. Updated wrapper functions in __init__.py to convert native results: - extract(): wraps dict in Document.from_dict() - extract_stream(): wraps yielded page dicts in Page.from_dict() - get_metadata(): wraps dict in Metadata() - hash(): wraps string in Fingerprint.from_string() - classify(): wraps dict in Classification() - search(): wraps yielded match dicts in Match The native PyO3 entry points (extract, extract_text, extract_stream) were already implemented with: - extract: uses extract_pdf + pythonize for PyDict conversion - extract_text: uses extract_text for plain String return - extract_stream: uses extract_pdf_streaming with custom StreamIterator All kwargs parsing with strict validation (unknown kwargs raise TypeError) was already in place. Acceptance criteria: - pdftract.extract() returns Document object with pages/metadata - pdftract.extract_text() returns plain text string - pdftract.extract_stream() yields Page objects - Unknown kwarg raises TypeError
16 lines
666 B
Rust
16 lines
666 B
Rust
//! Generate document-model test fixtures.
|
|
//!
|
|
//! This program creates 15 PDF test fixtures for document model integration tests.
|
|
//!
|
|
//! FIXTURE PASSWORDS:
|
|
//! - All encrypted fixtures use user password "test" (NOT secret - these are test fixtures)
|
|
//! - Owner password is empty string for all encrypted fixtures
|
|
|
|
// NOTE: This fixture generator is disabled - lopdf is no longer a dependency.
|
|
// Use existing fixture files or regenerate with a different tool.
|
|
|
|
fn main() {
|
|
eprintln!("Fixture generator is disabled - lopdf is no longer a dependency.");
|
|
eprintln!("Use existing fixture files in tests/document_model/fixtures/");
|
|
std::process::exit(0);
|
|
}
|