Skip to main content

LangChain integration package for Synap DocuAnalyzer.

Project description

langchain-synapsoft

langchain-synapsoft is a standalone LangChain integration package for Synap DocuAnalyzer.

It exposes a small, focused public surface:

  • SynapDocuAnalyzerClient for the REST workflow
  • SynapDocuAnalyzerLoader for converting parsed pages into LangChain Document objects
  • SynapDocuAnalyzerTool for agent-facing document conversion

The package currently targets the verified upload -> poll -> result flow and is prepared for the 0.1.0 alpha release.

After the 0.1.0 GitHub release is published to PyPI, you can install and integrate this package directly in your own project. Access to a live Synap DocuAnalyzer deployment is managed separately: installing the package does not grant service access, and API keys plus usage quotas are provisioned by Synapsoft.

Installation

Install from PyPI after the 0.1.0 release:

pip install -U langchain-synapsoft

Install for local development:

python -m pip install -e ".[dev]"

This package is intended to be easy to adopt in customer projects. After publication, pip install is enough to add the integration client, but using the Synap DocuAnalyzer service itself still requires a separately issued API key and an agreed usage policy from Synapsoft.

Environment

To call a live Synap DocuAnalyzer service, langchain-synapsoft expects a base URL and API key.

export SYNAP_DA_BASE_URL="https://your-docuanalyzer-host"
export SYNAP_DA_API_KEY="your-api-key"
$env:SYNAP_DA_BASE_URL = "https://your-docuanalyzer-host"
$env:SYNAP_DA_API_KEY = "your-api-key"

Quickstart: Loader

from langchain_synapsoft import SynapDocuAnalyzerLoader

loader = SynapDocuAnalyzerLoader(
    file_path="sample.pdf",
    base_url="https://your-docuanalyzer-host",
    api_key="your-api-key",
    output_type="md",
    mode="page",
)

docs = loader.load()
print(len(docs))
print(docs[0].metadata)
print(docs[0].page_content[:300])

The loader returns one Document per page by default. Use mode="single_document" to join every page into one Document.

If your deployment requires a longer request timeout or skips TLS verification for an internal certificate chain, pass request_timeout= and verify_ssl= when creating the loader.

Quickstart: Tool

from langchain_synapsoft import SynapDocuAnalyzerTool

tool = SynapDocuAnalyzerTool(
    base_url="https://your-docuanalyzer-host",
    api_key="your-api-key",
)

content = tool.invoke({"file_path": "sample.pdf", "output_type": "md"})
print(content[:300])

Supported behavior

  • Auto-detects both root-style endpoints such as /monitor and legacy /api/monitor deployments
  • Uses the verified Synap page result contract behind a simple Python API
  • Pretty-prints JSON page responses while preserving the raw payload in PageResult.raw_payload
  • Includes focused unit tests plus an opt-in live smoke test for a real server

Current limitations

  • Asset ZIP download flows are intentionally out of the public API surface for now
  • Remote delete endpoints are not exposed yet
  • Live integration tests require a reachable Synap DocuAnalyzer deployment and credentials

Development

From a repository checkout, create and activate a virtual environment, then install the development dependencies:

python -m venv .venv
python -m pip install -U pip
python -m pip install -e ".[dev]"

Run the local checks:

python -m ruff check .
python -m pytest -q
synap-docuanalyzer-smoke --sample-file "path/to/sample.docx"

To run the opt-in live pytest target, set SYNAP_DA_BASE_URL, SYNAP_DA_API_KEY, and SYNAP_SAMPLE_FILE, then run:

python -m pytest -q -m live_server
synap-docuanalyzer-smoke --sample-file "$SYNAP_SAMPLE_FILE"

Repository guide

License

This project is licensed under the MIT License.

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

langchain_synapsoft-0.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

langchain_synapsoft-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_synapsoft-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for langchain_synapsoft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a0e74c7b9d40ce3ca6eec7a6acda22e8fbfad402f9ce9a23aec8c41dae3ae077
MD5 10fe7f20ab3d3685d305932f6d823122
BLAKE2b-256 09447170120d7d58d2a17517412e345b7f71f89af77e910e18b84c0d9be76b6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_synapsoft-0.1.0.tar.gz:

Publisher: publish.yml on synapsoft-DA/langchain-synapsoft

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

File details

Details for the file langchain_synapsoft-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_synapsoft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 612a9d6d05938059fab0aceb6a3903778b21897c4b61889db71021e6efee1348
MD5 4fb4a129f95aac08124c55aae65f9cf8
BLAKE2b-256 ec2529c11df8475b8157883d5c857be0f82b13086b5e13ca030a47c0ed513b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_synapsoft-0.1.0-py3-none-any.whl:

Publisher: publish.yml on synapsoft-DA/langchain-synapsoft

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