Get started with AnyParser SDK

The quickest way to get started with AnyParser is using the SDK.

If you’d prefer to call the RESTful API directly, please refer to the API Reference

The SDK has the following features:

  • Full content parsing
  • Key-value extraction

The rest of this guide will go through a full content parsing example. To see how to get started with the other features, please browse the rest of the SDK reference.

Setup

First install any-parser from pypi.

pip install any-parser

Next get your API key from the CambioML website.

Finally, set up your AnyParser sync or async client.

anyparser_sync.py
from any_parser import AnyParser

ap = AnyParser(api_key="...")

md_output, total_time = ap.extract(file_path="/path/to/your/file")
anyparser_async.py
from any_parser import AnyParser

ap = AnyParser(api_key="...")

file_id = ap.async_extract(file_path="/path/to/your/file")

md = ap.async_fetch(file_id=file_id)

Full Examples

Check out these notebooks for more detailed examples of using AnyParser.