Pomais deprecated and will be removed in a future version. UsePrimeCutfor new work.
from poma import PomaPoma remains available for compatibility with older integrations.
Constructor
Poma(
api_key: str | None = None,
*,
timeout: float = 600.0,
client: httpx.Client | None = None,
)Legacy methods
start_chunk_file
start_chunk_file(
file_path,
*,
base_url: str | None = None,
) -> dict[str, Any]Submit a file and return a dictionary that includes the job ID.
start_chunk_file_eco
start_chunk_file_eco(
file_path,
*,
base_url: str | None = None,
) -> dict[str, Any]Submit a file to the eco ingestion path.
get_chunk_result
get_chunk_result(
job_id: str,
*,
initial_delay: float = 5.0,
poll_interval: float = 3.0,
max_interval: float = 15.0,
show_progress: bool = False,
download_dir = None,
filename: str | None = None,
) -> dict[str, Any]Poll until completion and return unpacked dictionary data.
Unlike PrimeCut.collect(...), this legacy helper uses polling only.
unpack_poma_archive
unpack_poma_archive(
poma_archive_data: bytes | None = None,
poma_archive_path: str | os.PathLike[str] | None = None,
) -> dict[str, Any]Unpack archive data without using PomaArchive.
extract_chunks_and_chunksets_from_poma_archive is a backwards-compatible alias.
create_cheatsheet
Returns a single cheatsheet string.
create_cheatsheets
Returns one cheatsheet per document.
download_file
download_file(
download_url: str,
filename: str | None = None,
*,
save_directory = None,
) -> strDownload a file from a POMA download URL and return the saved path.
download_bytes
download_bytes(download_url: str) -> bytesDownload raw bytes from a POMA download URL.
close
Close the underlying httpx.Client.
Poma also supports context-manager usage:
with Poma() as client:
job = client.start_chunk_file("example.pdf")For the recommended migration path, see Migrate from Poma to PrimeCut.