Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,27 @@ examples:
- "Creating the DocumentAnalysisClient with an endpoint and API key.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_authentication.py )]-->\n\n<!-- literal_block {\"ids\": [],\
\ \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\"\
: \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_authentication.py\", \"xml:space\": \"preserve\"\
, \"force\": false, \"language\": \"python\", \"highlight_args\": {\"linenostart\"\
: 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials import\
\ AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\
\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\
AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\
\ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentAnalysisClient with\
\ a token credential.<!--[!code-python[Main](les\\v3.2_and_later\\sample_authentication.py\
\ )]-->\n\n<!-- literal_block {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\"\
: [], \"backrefs\": [], \"source\": \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\\
6\\\\azure-ai-formrecognizer-3.3.0\\\\samples\\\\v3.2_and_later\\\\sample_authentication.py\"\
, \"xml:space\": \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n \"\"\"DefaultAzureCredential\
\ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\
\ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\
\ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\
AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\
\ document_analysis_client = DocumentAnalysisClient(endpoint, credential)\n\n\
\ ````\n"
: \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\\Lib\\\\site-packages\\\
\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\\samples\\\\v3.2_and_later\\\
\\sample_authentication.py\", \"xml:space\": \"preserve\", \"force\": false, \"\
language\": \"python\", \"highlight_args\": {\"linenostart\": 1}, \"linenos\": false}\
\ -->\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\
\ from azure.ai.formrecognizer import DocumentAnalysisClient\n\n endpoint =\
\ os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\
]\n\n document_analysis_client = DocumentAnalysisClient(endpoint, AzureKeyCredential(key))\n\
\n ````\n\nCreating the DocumentAnalysisClient with a token credential.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_authentication.py )]-->\n\n<!-- literal_block {\"ids\": [],\
\ \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\"\
: \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\\Lib\\\\site-packages\\\
\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\\samples\\\\v3.2_and_later\\\
\\sample_authentication.py\", \"xml:space\": \"preserve\", \"force\": false, \"\
language\": \"python\", \"highlight_args\": {\"linenostart\": 1}, \"linenos\": false}\
\ -->\n\n````python\n\n \"\"\"DefaultAzureCredential will use the values from\
\ these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET\n\
\ \"\"\"\n from azure.ai.formrecognizer import DocumentAnalysisClient\n from\
\ azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\
]\n credential = DefaultAzureCredential()\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\
\ credential)\n\n ````\n"
methods:
- uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_analyze_document
name: begin_analyze_document
Expand Down Expand Up @@ -151,14 +152,15 @@ methods:
- "Analyze an invoice. For more samples see the *samples* folder.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_analyze_invoices.py )]-->\n\n<!-- literal_block {\"ids\"\
: [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\"\
: \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_analyze_invoices.py\", \"xml:space\": \"\
preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\": {\"\
linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials\
\ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\
\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\
AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\
\ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\
: \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\\Lib\\\\site-packages\\\
\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\\samples\\\\v3.2_and_later\\\
\\sample_analyze_invoices.py\", \"xml:space\": \"preserve\", \"force\": false,\
\ \"language\": \"python\", \"highlight_args\": {\"linenostart\": 1}, \"linenos\"\
: false} -->\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\
\ from azure.ai.formrecognizer import DocumentAnalysisClient\n\n endpoint\
\ = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\
]\n\n document_analysis_client = DocumentAnalysisClient(\n endpoint=endpoint,\
\ credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\
\ \"rb\") as f:\n poller = document_analysis_client.begin_analyze_document(\n\
\ \"prebuilt-invoice\", document=f, locale=\"en-US\"\n )\n invoices\
\ = poller.result()\n\n for idx, invoice in enumerate(invoices.documents):\n\
Expand Down Expand Up @@ -263,7 +265,8 @@ methods:
\ a custom document. For more samples see the *samples* folder.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_analyze_custom_documents.py )]-->\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"source\": \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
: [], \"source\": \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\
\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_analyze_custom_documents.py\", \"xml:space\"\
: \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials\
Expand Down Expand Up @@ -361,7 +364,8 @@ methods:
- "Analyze a receipt. For more samples see the *samples* folder.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_analyze_receipts_from_url.py )]-->\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"source\": \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
: [], \"source\": \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\
\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_analyze_receipts_from_url.py\", \"xml:space\"\
: \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials\
Expand Down Expand Up @@ -442,16 +446,16 @@ methods:
- "Classify a document. For more samples see the *samples* folder.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_classify_document.py )]-->\n\n<!-- literal_block {\"ids\"\
: [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\"\
: \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_classify_document.py\", \"xml:space\": \"\
preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\": {\"\
linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials\
\ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\
\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\
AZURE_FORM_RECOGNIZER_KEY\"]\n classifier_id = os.getenv(\"CLASSIFIER_ID\",\
\ classifier_id)\n\n document_analysis_client = DocumentAnalysisClient(\n \
\ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\
\ \"rb\") as f:\n poller = document_analysis_client.begin_classify_document(\n\
: \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\\Lib\\\\site-packages\\\
\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\\samples\\\\v3.2_and_later\\\
\\sample_classify_document.py\", \"xml:space\": \"preserve\", \"force\": false,\
\ \"language\": \"python\", \"highlight_args\": {\"linenostart\": 1}, \"linenos\"\
: false} -->\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\
\ from azure.ai.formrecognizer import DocumentAnalysisClient\n\n endpoint\
\ = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\
]\n classifier_id = os.getenv(\"CLASSIFIER_ID\", classifier_id)\n\n document_analysis_client\
\ = DocumentAnalysisClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\
\ )\n with open(path_to_sample_documents, \"rb\") as f:\n poller = document_analysis_client.begin_classify_document(\n\
\ classifier_id, document=f\n )\n result = poller.result()\n\
\n print(\"----Classified documents----\")\n for doc in result.documents:\n\
\ print(\n f\"Found document of type '{doc.doc_type or 'N/A'}'\
Expand Down Expand Up @@ -500,7 +504,8 @@ methods:
- "Classify a document. For more samples see the *samples* folder.<!--[!code-python[Main](les\\\
v3.2_and_later\\sample_classify_document_from_url.py )]-->\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"source\": \"D:\\\\a\\\\_work\\\\1\\\\s\\\\dist_temp\\\\6\\\\azure-ai-formrecognizer-3.3.0\\\
: [], \"source\": \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\\3.11.5\\\\x64\\\
\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\\5\\\\azure-ai-formrecognizer-3.3.0\\\
\\samples\\\\v3.2_and_later\\\\sample_classify_document_from_url.py\", \"xml:space\"\
: \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n from azure.core.credentials\
Expand Down
Loading