Skip to main content

langchain-doccheap

PyPI

LangChain tools for doc.cheap: an agent gives them a photo or scan of a passport, national ID card or driving licence and gets back the printed fields – name, date of birth, document number, expiry, the machine-readable zone – as JSON.

One recognised document costs one credit, $0.01. Registering gives 100 free documents every month. An unreadable image, an empty frame or an unsupported document type costs nothing, and every answer says whether it was billed.

The package needs Python 3.10 or later. It is built on the doc-cheap client and langchain-core 1.x.

Installation

pip install langchain-doccheap

The tools

Tool Name the model sees What it does
DocCheapScanDocument doc_cheap_scan_document Reads one JPEG or PNG image, from image_path or image_base64, with an optional reference label and expect_country (ISO 3166-1 alpha-3).
DocCheapGetScan doc_cheap_get_scan Returns a stored result by scan_id.
DocCheapListScans doc_cheap_list_scans Returns one page of stored results (limit, cursor).
DocCheapDeleteScan doc_cheap_delete_scan Deletes a stored result by scan_id.
DocCheapGetUsage doc_cheap_get_usage Returns this month's free credits, the paid credits, the credits spent and the scan counters.

Every tool returns the API's answer as a JSON string. An API error – an unknown scan, a used-up rate limit, a wrong key – comes back to the model as a short text such as doc.cheap error: 404 scan_not_found: … instead of stopping the agent; pass handle_tool_error=False to have it raised as a ToolException.

Quick start

from langchain_doccheap import DocCheapScanDocument

scan = DocCheapScanDocument(api_key="sk_sandbox_public")
print(scan.invoke({"image_path": "passport.jpg"}))

With an agent, take all five tools from the toolkit. They share one client and its connections:

from langchain.agents import create_agent
from langchain_doccheap import DocCheapToolkit

tools = DocCheapToolkit().get_tools()  # reads DOC_CHEAP_API_KEY
agent = create_agent("openai:gpt-4.1-mini", tools)
agent.invoke({"messages": [{"role": "user", "content": "Read the passport in ./passport.jpg"}]})

DocCheapToolkit(include_delete=False) leaves out the tool that deletes stored results.

API keys

  • Live key – sk_live_…, created in the doc.cheap cabinet.
  • Sandbox key – sk_sandbox_public works without an account. It gives 10 free recognised documents per address in all, and at most 10 requests per address an hour, whatever their answer.

Without api_key the tools read the key from the DOC_CHEAP_API_KEY environment variable. base_url (or DOC_CHEAP_API_BASE) points them at another address. To control timeouts, proxies or connection pooling, build a doc_cheap.Client yourself and pass it as client=; the tools leave it open.

Stored results. A result is stored only when the scan was made with a live key under a non-zero retention window. Under the sandbox key nothing is stored, so getting or deleting a scan answers scan_not_found.

Resources

License

MIT

Metadata

Release files for langchain-doccheap 0.1.0

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

Source distribution (sdist)

Source distribution for langchain-doccheap 0.1.0
File Size Uploaded Provenance Actions
langchain_doccheap-0.1.0.tar.gz 8.8 kB With provenance Details for langchain_doccheap-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-doccheap 0.1.0
File Interpreter ABI Platform Actions
langchain_doccheap-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_doccheap-0.1.0-py3-none-any.whl

Total release size: 17.0 kB

Release files / langchain_doccheap-0.1.0.tar.gz

Download URL langchain_doccheap-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b324df0b7e374a8f036f1f533cb6926868631d0dd95997e1a98656b46b668222
BLAKE2b-256 checksum
How to use checksums
55a618fd40689e9fa2d6199f7f354ab0ab9115f96ca360baaa36c206a8ab4d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / langchain_doccheap-0.1.0-py3-none-any.whl

Download URL langchain_doccheap-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab815dd68b4a9118249cec92725eecc2b149acb1f663c800ce7ddf01b704dbc
BLAKE2b-256 checksum
How to use checksums
cea058a30905c6e08eb4bac6ef4bd361f9fb049b97ff77a3807f2e0ad0c12351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Security for langchain-doccheap 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_doccheap-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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