Skip to main content

Official Python SDK for the Poma document-processing API

Project description

POMA AI Logo

POMA: Preserving Optimal Markdown Architecture

Quick-Start Guide

Installation

Requires Python 3.10+. Install the core package:

pip install poma

For different integrations:

pip install 'poma[langchain]'
pip install 'poma[llamaindex]'
pip install 'poma[qdrant]'

# Or LangChain/LlamaIndex/Qdrant including example extras:
pip install 'poma[all]'
  • You may also want: pip install python-dotenv to load API keys from a .env file.
  • API keys required (POMA_API_KEY) for the POMA AI client via environment variables.
  • To request a POMA_API_KEY, please contact us at sdk@poma-ai.com

Usage

from poma import PrimeCut, generate_cheatsheets

pc = PrimeCut(api_key="your_key")

# Ingest a document — submits the file, polls, and returns typed results
result = pc.ingest("document.pdf")

print(result.chunksets[0])
print(result.chunks[0].content)

# Eco ingestion uses the same flow against the eco endpoints
eco_result = pc.ingest_eco("document.pdf")

To test this flow from the command line (requires POMA_API_KEY in the environment):

python -m poma document.pdf          # run both ingest and ingest_eco
python -m poma path/to/file.pdf      # custom file
python -m poma document.pdf --no-eco   # standard ingest only
python -m poma document.pdf --eco     # eco ingest only

Generate cheatsheets as a top-level utility:

cheatsheets = generate_cheatsheets(
    relevant_chunksets=result.chunksets,
    all_chunks=result.chunks,
)
print(cheatsheets[0]["content"])

If you already have a .poma archive, unpack it directly:

from poma import unpack

archived_result = unpack("document.poma")
print(archived_result.chunks[0].content)

Async clients use the same API shape:

import asyncio

from poma import AsyncPrimeCut


async def main() -> None:
    async with AsyncPrimeCut(api_key="your_key") as pc:
        result = await pc.ingest("document.pdf")
        print(result.chunksets[0])


asyncio.run(main())

Example Implementations

All examples, integrations, and additional information can be found in our GitHub repository: poma-ai/poma

We provide example implementations to help you get started with POMA AI:

  • example.py — A standalone implementation for documents, showing the basic POMA AI workflow with simple keyword-based retrieval
  • example_langchain.py — Integration with LangChain, demonstrating how easy it is to use POMA AI with LangChain
  • example_llamaindex.py — Integration with LlamaIndex, showing how simple it is to use POMA AI with LlamaIndex

Note: The integration examples use OpenAI embeddings. Make sure to set your OPENAI_API_KEY environment variable, or replace the embeddings with your preferred ones.

All examples follow the same two-phase process (ingest → retrieve) but demonstrate different integration options for your RAG pipeline.

! Please do NOT send any sensitive and/or personal information to POMA AI endpoints without having a signed contract & DPA !

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

poma-0.4.4.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

poma-0.4.4-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file poma-0.4.4.tar.gz.

File metadata

  • Download URL: poma-0.4.4.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for poma-0.4.4.tar.gz
Algorithm Hash digest
SHA256 05ecc1247342194ad66ecf0ec162169993a26664974a2573d35c3046416be499
MD5 a07f8ea6ae0a29e76a01f83ac34237e0
BLAKE2b-256 5ee3c4c07de37a78c006ecff733d2c72e54b154859dc454ead63e3da39646261

See more details on using hashes here.

Provenance

The following attestation bundles were made for poma-0.4.4.tar.gz:

Publisher: python-publish.yml on poma-ai/poma-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file poma-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: poma-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for poma-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 244a14809d5bc1e4abde37256332c36fbbb6def9d8af4678224749255e02d32c
MD5 592e02f74c52d0142df672f91e064823
BLAKE2b-256 5c8f4ad447313c23f1ec1d56fb4c5072b43321261e16cdfec4eec729f584b186

See more details on using hashes here.

Provenance

The following attestation bundles were made for poma-0.4.4-py3-none-any.whl:

Publisher: python-publish.yml on poma-ai/poma-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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