Skip to main content

pageindex-search

Python client for Page Search API by PageIndex. Upload a PDF, ask up to 10 questions at once, and get back the pages that answer each one, ranked by relevance. Every page is read.

pip install pageindex-search

Create an API key in the console and set it:

export PAGEINDEX_SEARCH_API_KEY=pis_live_...

Quick start

from pageindex_search import PageSearch

client = PageSearch()

doc = client.upload("3M_2018_10K.pdf")
result = client.search(doc, ["What was capital expenditure in 2018?", "Who is the CEO?"])

for answer in result.results:
    print(answer.question)
    for page in answer.pages:
        print(f"  page {page.page}: {page.relevance:.2f}")

print(f"cost ${result.usage.cost_usd}, credit left ${result.usage.balance_usd}")

Upload a document once and search it as often as you like; uploading the same file again returns the same document.

Reference

PageSearch(api_key=None, base_url=None, timeout=120, max_retries=2) The key defaults to PAGEINDEX_SEARCH_API_KEY.
upload(file, wait=True) A path, bytes or an open file. Returns a Document, ready to search unless wait=False.
search(document, questions, top_k=None) Up to 10 questions. Each answer lists the pages likely to help (relevance 0.3 or more; 0.2 or more when fewer than 3 are; possibly none), or exactly top_k.
document(id), documents(limit, after), iter_documents() Your documents.
delete(document) Delete a document.
usage(start=None, end=None) Uploads, searches and cost by day, your credit and stored pages.

Errors raise PageSearchError, with the API's status, code, message and request_id.

See the API reference for every field and the pricing.

Metadata

Release files for pageindex-search 0.1.1

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

Source distribution (sdist)

Source distribution for pageindex-search 0.1.1
File Size Uploaded Provenance Actions
pageindex_search-0.1.1.tar.gz 6.9 kB Without provenance Details for pageindex_search-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pageindex-search 0.1.1
File Interpreter ABI Platform Actions
pageindex_search-0.1.1-py3-none-any.whl Python 3 none any Details for pageindex_search-0.1.1-py3-none-any.whl

Total release size: 14.4 kB

Release files / pageindex_search-0.1.1.tar.gz

Download URL pageindex_search-0.1.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
68da06799a6709b5531dcb2b0ef38b9256a9cea53da6348e191f985a98edcc78
BLAKE2b-256 checksum
How to use checksums
5e204f5d7969fff6091f50955f9f7c45b3c8f0b7e1bc5c3c12e03dc2569152c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pageindex_search-0.1.1-py3-none-any.whl

Download URL pageindex_search-0.1.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5057a7bd902a1395c45d0cc049adb25c49526a0af58a7a34b1f2d689326d4b1a
BLAKE2b-256 checksum
How to use checksums
ed466f7bddad6807b62864981b3d33a7d3eb0c83533fff59a5cea13557019d2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pageindex-search 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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