Registry / azure / azure-ai-contentunderstanding

azure-ai-contentunderstanding

JSON →
library1.1.0pypypi✓ verified 83d ago

Azure AI Content Understanding Python SDK (v1.1.0) from Microsoft. Provides client for analyzing and understanding content using Azure AI services. Supports synchronous and asynchronous analysis of documents, images, and text. Released on a monthly cadence.

pip install azure-ai-contentunderstanding
INSTALL
IMPORT
SIG · AZURE-AI-CONTENTUN
A
azure-ai-contentunderstanding
azurepythonv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ContentUnderstandingClient
from azure.ai.contentunderstanding import ContentUnderstandingClient
AnalysisResult
from azure.ai.contentunderstanding.models import AnalysisResult
AnalyzeOptions
from azure.ai.contentunderstanding.models import AnalyzeOptions
from azure.ai.contentunderstanding import AnalyzeOptions
AnalyzeOptions is in the models submodule, not top-level

Initializes client and analyzes a PDF document.

from azure.ai.contentunderstanding import ContentUnderstandingClient from azure.ai.contentunderstanding.models import AnalyzeOptions import os endpoint = os.environ.get('AZURE_CONTENT_UNDERSTANDING_ENDPOINT', '') credential = DefaultAzureCredential() client = ContentUnderstandingClient(endpoint, credential) # Analyze a document with open('sample.pdf', 'rb') as f: result = client.analyze(f, AnalyzeOptions(content_type='application/pdf')) print(result)
Debug
Known issues
breakingIn v1.1.0, the parameter 'content_type' in AnalyzeOptions is required for binary input; omitting it causes a 400 error.
fix
Always pass content_type='application/pdf' (or appropriate MIME) when providing binary data.
affects: >=1.1.0
deprecatedThe method 'begin_analyze' was replaced by 'analyze' in v1.0.0; 'begin_analyze' no longer exists.
fix
Use client.analyze() instead of client.begin_analyze().
affects: <1.0.0
gotchaDefaultAzureCredential requires environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET to be set. If not, it raises CredentialUnavailableError.
fix
Set the required environment variables or use a different credential class like AzureCliCredential.
affects: all
Errors
Common errors & fixes
AttributeError: module 'azure.ai.contentunderstanding' has no attribute 'ContentUnderstandingClient'
Import path is wrong; ContentUnderstandingClient is in the top-level package but the module may not be installed correctly.
fix
Ensure you've installed azure-ai-contentunderstanding and import with: from azure.ai.contentunderstanding import ContentUnderstandingClient
azure.core.exceptions.HttpResponseError: (InvalidRequest) 'content_type' is required for binary content
When passing binary data (e.g., BytesIO), AnalyzeOptions must specify content_type.
fix
Add content_type argument: AnalyzeOptions(content_type='application/pdf')
azure.identity._exceptions.CredentialUnavailableError: DefaultAzureCredential failed to retrieve a token
DefaultAzureCredential requires environment variables or managed identity; none are set.
fix
Set AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET or use AzureCliCredential()
Upgrade
Version history
1.1.0latest on PyPI · released Apr 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
34
OpenAI (training)
1
Resources
azure-ai-contentunderstanding — pip install azure-ai-contentunderstanding · libregistry