Azure AI Document Intelligence client library for Python - a cloud service that uses machine learning to analyze text and structured data from documents
76
Build a small helper module that uses the document intelligence service's raw HTTP pipeline to issue authenticated requests that bypass the convenience methods. The helpers should start a markdown-focused analysis run and retrieve results (markdown or searchable PDF) directly from the operation endpoint.
/documentintelligence/documentModels/{modelId}:analyze?api-version=<api_version> with a JSON body containing the document URL and outputContentFormat set to markdown, using the provided client pipeline so service authentication and policies apply. Returns the absolute operation-location value. @testAccept: text/markdown, and returns the full markdown content as a string. @testAccept: application/pdf and an optional pages query (e.g., pages=1-2) to fetch only selected pages. Returns the binary PDF bytes. @test@generates
def start_markdown_analysis(
client,
model_id: str,
document_url: str,
*,
api_version: str = "2024-11-30"
) -> str:
...
def get_markdown_result(client, operation_location: str) -> str:
...
def download_pdf(
client,
operation_location: str,
*,
pages: str | None = None
) -> bytes:
...Provides authenticated document intelligence pipeline and HTTP request/response helpers.
Install with Tessl CLI
npx tessl i tessl/pypi-azure-ai-documentintelligencedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10