Skip to main content
Use our lightweight Python library to parse documents and extract fields. For detailed information, see the README in Github.

Use Async Parsing with the landing-ai Python Library

If using the library, you can parse documents asynchronously by calling the endpoint (instead of the ADE Parse Jobs endpoint). To do this, install the library, set your API key, and run the following code:
import asyncio
from landingai_ade import AsyncLandingAIADE

client = AsyncLandingAIADE()

async def main() -> None:
    response = await client.parse(
        document_url="/path/to/document.pdf",
        model="dpt-2-latest",
    )

    print("Extracted Markdown:")
    print(response.markdown)

    print("Extracted Chunks:")
    print(response.chunks)

asyncio.run(main())
I