# packages

pkgId: 7ea87995028dade475b417afaf1a69ec6a6a967e2178facd1cb48f4498cca458
name: python-azure-ai-translation-document
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Microsoft Azure Ai Translation Document Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-ai-translation-document-1.1.0-1.src.rpm
checksum_type: sha256
description:
  Azure Cognitive Services Document Translation is a cloud service that can be used to translate multiple and complex documents across languages and dialects while preserving original document structure and data format.
  Use the client library for Document Translation to:

  * Translate numerous, large files from an Azure Blob Storage container to a target container in your language of choice.
  * Check the translation status and progress of each document in the translation operation.
  * Apply a custom translation model or glossaries to tailor translation to your specific case.

  [Source code][python-dt-src]
  | [Package (PyPI)][python-dt-pypi]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-ai-translation-document/)
  | [API reference documentation][python-dt-ref-docs]
  | [Product documentation][python-dt-product-docs]
  | [Samples][python-dt-samples]



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_




  * Python 3.8 or later is required to use this package.
  * You must have an [Azure subscription][azure_subscription] and a
  [Translator resource][DT_resource] to use this package.



  Install the Azure Document Translation client library for Python with [pip][pip]:

  ```bash
  pip install --pre azure-ai-translation-document
  ```

  > Note: This version of the client library defaults to the v2024-05-01 version of the service



  The Document Translation feature supports [single-service access][single_service] only.
  To access the service, create a Translator resource.

  You can create the resource using

  **Option 1:** [Azure Portal][azure_portal_create_DT_resource]

  **Option 2:** [Azure CLI][azure_cli_create_DT_resource].
  Below is an example of how you can create a Translator resource using the CLI:

  ```bash


  az group create --name my-resource-group --location westus2
  ```

  ```bash

  az cognitiveservices account create \
      --name document-translation-resource \
      --custom-domain document-translation-resource \
      --resource-group my-resource-group \
      --kind TextTranslation \
      --sku S1 \
      --location westus2 \
      --yes
  ```



  In order to interact with the Document Translation feature service, you will need to create an instance of a client.
  An **endpoint** and **credential** are necessary to instantiate the client object.



  You can find the endpoint for your Translator resource using the
  [Azure Portal][azure_portal_get_endpoint].

  > Note that the service requires a custom domain endpoint. Follow the instructions in the above link to format your endpoint:
  > https://{NAME-OF-YOUR-RESOURCE}.cognitiveservices.azure.com/



  The API key can be found in the Azure Portal or by running the following Azure CLI command:

  ```az cognitiveservices account keys list --name "resource-name" --resource-group "resource-group-name"```



  To use an [API key][cognitive_authentication_api_key] as the `credential` parameter,
  pass the key as a string into an instance of [AzureKeyCredential][azure-key-credential].

  <!-- SNIPPET:sample_authentication.create_dt_client_with_key -->

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient

  endpoint = os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"]
  key = os.environ["AZURE_DOCUMENT_TRANSLATION_KEY"]

  document_translation_client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))
  ```

  <!-- END SNIPPET -->



  `AzureKeyCredential` authentication is used in the examples in this getting started guide, but you can also
  authenticate with Azure Active Directory using the [azure-identity][azure_identity] library.

  To use the [DefaultAzureCredential][default_azure_credential] type shown below, or other credential types provided
  with the Azure SDK, please install the `azure-identity` package:

  ```pip install azure-identity```

  You will also need to [register a new AAD application and grant access][register_aad_app] to your
  Translator resource by assigning the `"Cognitive Services User"` role to your service principal.

  Once completed, set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
  `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

  <!-- SNIPPET:sample_authentication.create_dt_client_with_aad -->

  ```python
  """DefaultAzureCredential will use the values from these environment
  variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
  """
  from azure.identity import DefaultAzureCredential
  from azure.ai.translation.document import DocumentTranslationClient

  endpoint = os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"]
  credential = DefaultAzureCredential()

  document_translation_client = DocumentTranslationClient(endpoint, credential)
  ```

  <!-- END SNIPPET -->



  The Document Translation service requires that you upload your files to an Azure Blob Storage source container and provide
  a target container where the translated documents can be written. Additional information about setting this up can be found in
  the service documentation:

  - [Set up Azure Blob Storage containers][source_containers] with your documents
  - Optionally apply [glossaries][glossary] or a [custom model for translation][custom_model]
  - Allow access to your storage account with either of the following options:
      - Generate [SAS tokens][sas_token] to your containers (or files) with the appropriate [permissions][sas_token_permissions]
      - Create and use a [managed identity][managed_identity] to grant access to your storage account



  Interaction with the Document Translation client library begins with an instance of the `DocumentTranslationClient`.
  The client provides operations for:

   - Creating a translation operation to translate documents in your source container(s) and write results to you target container(s).
   - Checking the status of individual documents in the translation operation and monitoring each document's progress.
   - Enumerating all past and current translation operations.
   - Identifying supported glossary and document formats.



  Input to the `begin_translation` client method can be provided in two different ways:

  1) A single source container with documents can be translated to a different language:

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient

  document_translation_client = DocumentTranslationClient("<endpoint>", AzureKeyCredential("<api_key>"))
  poller = document_translation_client.begin_translation("<sas_url_to_source>", "<sas_url_to_target>", "<target_language>")
  ```

  2) Or multiple different sources can be provided each with their own targets.

  <!-- SNIPPET:sample_translate_multiple_inputs.multiple_translation -->

  ```python
  import os
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient, DocumentTranslationInput, TranslationTarget

  endpoint = os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"]
  key = os.environ["AZURE_DOCUMENT_TRANSLATION_KEY"]
  source_container_url_1 = os.environ["AZURE_SOURCE_CONTAINER_URL_1"]
  source_container_url_2 = os.environ["AZURE_SOURCE_CONTAINER_URL_2"]
  target_container_url_fr = os.environ["AZURE_TARGET_CONTAINER_URL_FR"]
  target_container_url_ar = os.environ["AZURE_TARGET_CONTAINER_URL_AR"]
  target_container_url_es = os.environ["AZURE_TARGET_CONTAINER_URL_ES"]

  client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))

  poller = client.begin_translation(
      inputs=[
          DocumentTranslationInput(
              source_url=source_container_url_1,
              targets=[
                  TranslationTarget(target_url=target_container_url_fr, language="fr"),
                  TranslationTarget(target_url=target_container_url_ar, language="ar"),
              ],
          ),
          DocumentTranslationInput(
              source_url=source_container_url_2,
              targets=[TranslationTarget(target_url=target_container_url_es, language="es")],
          ),
      ]
  )
  result = poller.result()

  print(f"Status: {poller.status()}")
  print(f"Created on: {poller.details.created_on}")
  print(f"Last updated on: {poller.details.last_updated_on}")
  print(f"Total number of translations on documents: {poller.details.documents_total_count}")

  print("\nOf total documents...")
  print(f"{poller.details.documents_failed_count} failed")
  print(f"{poller.details.documents_succeeded_count} succeeded")

  for document in result:
      print(f"Document ID: {document.id}")
      print(f"Document status: {document.status}")
      if document.status == "Succeeded":
          print(f"Source document location: {document.source_document_url}")
          print(f"Translated document location: {document.translated_document_url}")
          print(f"Translated to language: {document.translated_to}\n")
      elif document.error:
          print(f"Error Code: {document.error.code}, Message: {document.error.message}\n")
  ```

  <!-- END SNIPPET -->

  > Note: the target_url for each target language must be unique.

  To translate documents under a folder, or only translate certain documents, see [sample_begin_translation_with_filters.py][sample_begin_translation_with_filters].
  See the service documentation for all [supported languages][supported_languages].



  Long-running operations are operations which consist of an initial request sent to the service to start an operation,
  followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has
  succeeded, to get the result.

  Methods that translate documents are modeled as long-running operations.
  The client exposes a `begin_<method-name>` method that returns a `DocumentTranslationLROPoller` or `AsyncDocumentTranslationLROPoller`. Callers should wait
  for the operation to complete by calling `result()` on the poller object returned from the `begin_<method-name>` method.
  Sample code snippets are provided to illustrate using long-running operations [below](#examples "Examples").



  The following section provides several code snippets covering some of the most common Document Translation tasks, including:

  * [Translate your documents](#translate-your-documents "Translate Your Documents")
  * [Translate multiple inputs](#translate-multiple-inputs "Translate Multiple Inputs")
  * [List translation operations](#list-translation-operations "List Translation Operations")



  Translate all the documents in your source container to the target container. To translate documents under a folder, or only translate certain documents, see [sample_begin_translation_with_filters.py][sample_begin_translation_with_filters].

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient

  endpoint = "https://<resource-name>.cognitiveservices.azure.com/"
  credential = AzureKeyCredential("<api_key>")
  source_container_sas_url_en = "<sas-url-en>"
  target_container_sas_url_es = "<sas-url-es>"

  document_translation_client = DocumentTranslationClient(endpoint, credential)

  poller = document_translation_client.begin_translation(source_container_sas_url_en, target_container_sas_url_es, "es")

  result = poller.result()

  print(f"Status: {poller.status()}")
  print(f"Created on: {poller.details.created_on}")
  print(f"Last updated on: {poller.details.last_updated_on}")
  print(f"Total number of translations on documents: {poller.details.documents_total_count}")

  print("\nOf total documents...")
  print(f"{poller.details.documents_failed_count} failed")
  print(f"{poller.details.documents_succeeded_count} succeeded")

  for document in result:
      print(f"Document ID: {document.id}")
      print(f"Document status: {document.status}")
      if document.status == "Succeeded":
          print(f"Source document location: {document.source_document_url}")
          print(f"Translated document location: {document.translated_document_url}")
          print(f"Translated to language: {document.translated_to}\n")
      else:
          print(f"Error Code: {document.error.code}, Message: {document.error.message}\n")
  ```



  Begin translating with documents in multiple source containers to multiple target containers in different languages.

  <!-- SNIPPET:sample_translate_multiple_inputs.multiple_translation -->

  ```python
  import os
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient, DocumentTranslationInput, TranslationTarget

  endpoint = os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"]
  key = os.environ["AZURE_DOCUMENT_TRANSLATION_KEY"]
  source_container_url_1 = os.environ["AZURE_SOURCE_CONTAINER_URL_1"]
  source_container_url_2 = os.environ["AZURE_SOURCE_CONTAINER_URL_2"]
  target_container_url_fr = os.environ["AZURE_TARGET_CONTAINER_URL_FR"]
  target_container_url_ar = os.environ["AZURE_TARGET_CONTAINER_URL_AR"]
  target_container_url_es = os.environ["AZURE_TARGET_CONTAINER_URL_ES"]

  client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))

  poller = client.begin_translation(
      inputs=[
          DocumentTranslationInput(
              source_url=source_container_url_1,
              targets=[
                  TranslationTarget(target_url=target_container_url_fr, language="fr"),
                  TranslationTarget(target_url=target_container_url_ar, language="ar"),
              ],
          ),
          DocumentTranslationInput(
              source_url=source_container_url_2,
              targets=[TranslationTarget(target_url=target_container_url_es, language="es")],
          ),
      ]
  )
  result = poller.result()

  print(f"Status: {poller.status()}")
  print(f"Created on: {poller.details.created_on}")
  print(f"Last updated on: {poller.details.last_updated_on}")
  print(f"Total number of translations on documents: {poller.details.documents_total_count}")

  print("\nOf total documents...")
  print(f"{poller.details.documents_failed_count} failed")
  print(f"{poller.details.documents_succeeded_count} succeeded")

  for document in result:
      print(f"Document ID: {document.id}")
      print(f"Document status: {document.status}")
      if document.status == "Succeeded":
          print(f"Source document location: {document.source_document_url}")
          print(f"Translated document location: {document.translated_document_url}")
          print(f"Translated to language: {document.translated_to}\n")
      elif document.error:
          print(f"Error Code: {document.error.code}, Message: {document.error.message}\n")
  ```

  <!-- END SNIPPET -->



  Enumerate over the translation operations submitted for the resource.

  <!-- SNIPPET:sample_list_translations.list_translations -->

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.translation.document import DocumentTranslationClient

  endpoint = os.environ["AZURE_DOCUMENT_TRANSLATION_ENDPOINT"]
  key = os.environ["AZURE_DOCUMENT_TRANSLATION_KEY"]

  client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))
  operations = client.list_translation_statuses()

  for operation in operations:
      print(f"ID: {operation.id}")
      print(f"Status: {operation.status}")
      print(f"Created on: {operation.created_on}")
      print(f"Last updated on: {operation.last_updated_on}")
      print(f"Total number of operations on documents: {operation.documents_total_count}")
      print(f"Total number of characters charged: {operation.total_characters_charged}")

      print("\nOf total documents...")
      print(f"{operation.documents_failed_count} failed")
      print(f"{operation.documents_succeeded_count} succeeded")
      print(f"{operation.documents_canceled_count} canceled\n")
  ```

  <!-- END SNIPPET -->

  To see how to use the Document Translation client library with Azure Storage Blob to upload documents, create SAS tokens
  for your containers, and download the finished translated documents, see this [sample][sample_translation_with_azure_blob].
  Note that you will need to install the [azure-storage-blob][azure_storage_blob] library to run this sample.



  The following section provides some insights for some advanced translation features such as glossaries and custom translation models.



  Glossaries are domain-specific dictionaries. For example, if you want to translate some medical-related documents, you may need support for the many words, terminology, and idioms in the medical field which you can't find in the standard translation dictionary, or you simply need specific translation. This is why Document Translation provides support for glossaries.



  Document Translation supports glossaries in the following formats:

  |**File Type**|**Extension**|**Description**|**Samples**|
  |---------------|---------------|---------------|---------------|
  |Tab-Separated Values/TAB|.tsv, .tab|Read more on [wikipedia][tsv_files_wikipedia]|[glossary_sample.tsv][sample_tsv_file]|
  |Comma-Separated Values|.csv|Read more on [wikipedia][csv_files_wikipedia]|[glossary_sample.csv][sample_csv_file]|
  |Localization Interchange File Format|.xlf, .xliff|Read more on [wikipedia][xlf_files_wikipedia]|[glossary_sample.xlf][sample_xlf_file]|

  View all supported formats [here][supported_glossary_formats].



  In order to use glossaries with Document Translation, you first need to upload your glossary file to a blob container, and then provide the SAS URL to the file as in the code samples [sample_translation_with_glossaries.py][sample_translation_with_glossaries].



  Instead of using Document Translation's engine for translation, you can use your own custom Azure machine/deep learning model.



  For more info on how to create, provision, and deploy your own custom Azure translation model, please follow the instructions here: [Build, deploy, and use a custom model for translation][custom_translation_article]



  In order to use a custom translation model with Document Translation, you first
  need to create and deploy your model, then follow the code sample [sample_translation_with_custom_model.py][sample_translation_with_custom_model] to use with Document Translation.





  Document Translation client library will raise exceptions defined in [Azure Core][azure_core_exceptions].



  This library uses the standard
  [logging][python_logging] library for logging.

  Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level.

  Detailed `DEBUG` level logging, including request/response bodies and **unredacted**
  headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument.

  See full SDK logging documentation with examples [here][sdk_logging_docs].



  Optional keyword arguments can be passed in at the client and per-operation level.
  The azure-core [reference documentation][azure_core_ref_docs]
  describes available configurations for retries, logging, transport protocols, and more.



  The following section provides several code snippets illustrating common patterns used in the Document Translation Python client library.
  More samples can be found under the [samples][samples] directory.



  These code samples show common scenario operations with the Azure Document Translation client library.

  * Client authentication: [sample_authentication.py][sample_authentication]
  * Begin translating documents: [sample_begin_translation.py][sample_begin_translation]
  * Translate with multiple inputs: [sample_translate_multiple_inputs.py][sample_translate_multiple_inputs]
  * Check the status of documents: [sample_check_document_statuses.py][sample_check_document_statuses]
  * List all submitted translation operations: [sample_list_translations.py][sample_list_translations]
  * Apply a custom glossary to translation: [sample_translation_with_glossaries.py][sample_translation_with_glossaries]
  * Use Azure Blob Storage to set up translation resources: [sample_translation_with_azure_blob.py][sample_translation_with_azure_blob]



  This library also includes a complete set of async APIs. To use them, you must
  first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp/). Async clients
  are found under the `azure.ai.translation.document.aio` namespace.

  * Client authentication: [sample_authentication_async.py][sample_authentication_async]
  * Begin translating documents: [sample_begin_translation_async.py][sample_begin_translation_async]
  * Translate with multiple inputs: [sample_translate_multiple_inputs_async.py][sample_translate_multiple_inputs_async]
  * Check the status of documents: [sample_check_document_statuses_async.py][sample_check_document_statuses_async]
  * List all submitted translation operations: [sample_list_translations_async.py][sample_list_translations_async]
  * Apply a custom glossary to translation: [sample_translation_with_glossaries_async.py][sample_translation_with_glossaries_async]
  * Use Azure Blob Storage to set up translation resources: [sample_translation_with_azure_blob_async.py][sample_translation_with_azure_blob_async]



  For more extensive documentation on Azure Cognitive Services Document Translation, see the [Document Translation documentation][python-dt-product-docs] on docs.microsoft.com.



  This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].

  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.

  <!-- LINKS -->

  [python-dt-src]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/azure/ai/translation/document
  [python-dt-pypi]: https://aka.ms/azsdk/python/texttranslation/pypi
  [python-dt-product-docs]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview
  [python-dt-ref-docs]: https://aka.ms/azsdk/python/documenttranslation/docs
  [python-dt-samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples

  [azure_subscription]: https://azure.microsoft.com/free/
  [DT_resource]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/overview
  [single_service]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=singleservice%2Cwindows
  [pip]: https://pypi.org/project/pip/
  [azure_portal_create_DT_resource]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation
  [azure_cli_create_DT_resource]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli?tabs=windows
  [azure-key-credential]: https://aka.ms/azsdk/python/core/azurekeycredential
  [supported_languages]: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
  [source_containers]: https://aka.ms/azsdk/documenttranslation/sas-permissions
  [custom_model]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model
  [glossary]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats
  [sas_token]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer
  [sas_token_permissions]: https://aka.ms/azsdk/documenttranslation/sas-permissions
  [azure_storage_blob]: https://pypi.org/project/azure-storage-blob/

  [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs
  [azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
  [python_logging]: https://docs.python.org/3/library/logging.html
  [azure_cli_endpoint_lookup]: https://docs.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show
  [azure_portal_get_endpoint]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-sdk?tabs=dotnet&pivots=programming-language-python
  [cognitive_authentication_api_key]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-sdk?tabs=dotnet&pivots=programming-language-python
  [register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory
  [custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain
  [azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
  [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [managed_identity]: https://aka.ms/azsdk/documenttranslation/managed-identity
  [sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/sdk/azure-sdk-logging

  [samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples
  [sample_authentication]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_authentication.py
  [sample_authentication_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_authentication_async.py
  [sample_begin_translation]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_begin_translation.py
  [sample_begin_translation_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_begin_translation_async.py
  [sample_translate_multiple_inputs]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_translate_multiple_inputs.py
  [sample_translate_multiple_inputs_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translate_multiple_inputs_async.py
  [sample_check_document_statuses]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_check_document_statuses.py
  [sample_check_document_statuses_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_check_document_statuses_async.py
  [sample_list_translations]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_list_translations.py
  [sample_list_translations_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_list_translations_async.py
  [sample_translation_with_glossaries]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_glossaries.py
  [sample_translation_with_glossaries_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_glossaries_async.py
  [sample_translation_with_azure_blob]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_azure_blob.py
  [sample_translation_with_azure_blob_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_azure_blob_async.py
  [sample_translation_with_custom_model]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py
  [sample_translation_with_custom_model_async]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_custom_model_async.py
  [sample_begin_translation_with_filters]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/sample_begin_translation_with_filters.py

  [supported_glossary_formats]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats
  [custom_translation_article]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model
  [tsv_files_wikipedia]: https://wikipedia.org/wiki/Tab-separated_values
  [xlf_files_wikipedia]: https://wikipedia.org/wiki/XLIFF
  [csv_files_wikipedia]: https://wikipedia.org/wiki/Comma-separated_values
  [sample_tsv_file]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/assets/glossary_sample.tsv
  [sample_csv_file]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/assets/glossary_sample.csv
  [sample_xlf_file]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-document/samples/assets/glossary_sample.xlf

  [cla]: https://cla.microsoft.com
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  [coc_contact]: mailto:opencode@microsoft.com


pkgId: c2ec042b23cc84bb143f7b2ef677cba8e67b051f99cd59d85cec9b6fb2cbda17
name: python-azure-ai-translation-text
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Microsoft Azure Ai Translation Text Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-ai-translation-text-1.0.1-1.src.rpm
checksum_type: sha256
description:
  Text Translation is a cloud-based REST API feature of the Translator service that uses neural machine translation technology to enable quick and accurate source-to-target text translation in real time across all supported languages.

  Use the Text Translation client library for Python to:

  * Return a list of languages supported by Translate, Transliterate, and Dictionary operations.

  * Render single source-language text to multiple target-language texts with a single request.

  * Convert text of a source language in letters of a different script.

  * Return equivalent words for the source term in the target language.

  * Return grammatical structure and context examples for the source term and target term pair.

  [Source code][python-dt-src]
  | [Package (PyPI)][python-dt-pypi]
  | [API reference documentation][python-dt-ref-docs]
  | [Product documentation][python-dt-product-docs]
  | [Samples][python-dt-samples]





  * Python 3.7 or later is required to use this package.
  * An existing Translator service or Cognitive Services resource.



  Install the Azure Text Translation client library for Python with [pip][pip]:

  ```bash
  pip install azure-ai-translation-text
  ```



  You can create Translator resource following [Create a Translator resource][translator_resource_create].



  Interaction with the service using the client library begins with creating an instance of the [TextTranslationClient][translator_client_class] class. You will need an **API key** or ``TokenCredential`` to instantiate a client object. For more information regarding authenticating with cognitive services, see [Authenticate requests to Translator Service][translator_auth].



  You can get the `endpoint`, `API key` and `Region` from the Cognitive Services resource or Translator service resource information in the [Azure Portal][azure_portal].

  Alternatively, use the [Azure CLI][azure_cli] snippet below to get the API key from the Translator service resource.

  ```PowerShell
  az cognitiveservices account keys list --resource-group <your-resource-group-name> --name <your-resource-name>
  ```



  Once you have the value for the API key and Region, create an `AzureKeyCredential`. This will allow you to
  update the API key without creating a new client.

  With the value of the `endpoint`, `credential` and a `region`, you can create the [TextTranslationClient][client_sample]:

  <!-- SNIPPET: sample_text_translation_client.create_text_translation_client_with_credential -->

  ```python
  credential = AzureKeyCredential(apikey)
  text_translator = TextTranslationClient(credential=credential, region=region)
  ```

  <!-- END SNIPPET -->





  A `TextTranslationClient` is the primary interface for developers using the Text Translation client library.  It provides both synchronous and asynchronous operations to access a specific use of text translator, such as get supported languages detection or text translation.



  A **text element** (`string`), is a single unit of input to be processed by the translation models in the Translator service. Operations on `TextTranslationClient` may take a single text element or a collection of text elements.
  For text element length limits, maximum requests size, and supported text encoding see [here][translator_limits].



  The following section provides several code snippets using the `client` [created above](#create-a-texttranslationclient-using-an-api-key-and-region-credential), and covers the main features present in this client library. Although most of the snippets below make use of synchronous service calls, keep in mind that the Text Translation for Python library package supports both synchronous and asynchronous APIs.



  Gets the set of languages currently supported by other operations of the Translator.

  <!-- SNIPPET: sample_text_translation_languages.get_text_translation_languages -->

  ```python
  try:
      response = text_translator.get_supported_languages()

      print(
          f"Number of supported languages for translate operation: {len(response.translation) if response.translation is not None else 0}"
      )
      print(
          f"Number of supported languages for transliterate operation: {len(response.transliteration) if response.transliteration is not None else 0}"
      )
      print(
          f"Number of supported languages for dictionary operations: {len(response.dictionary) if response.dictionary is not None else 0}"
      )

      if response.translation is not None:
          print("Translation Languages:")
          for key, value in response.translation.items():
              print(f"{key} -- name: {value.name} ({value.native_name})")

      if response.transliteration is not None:
          print("Transliteration Languages:")
          for key, value in response.transliteration.items():
              print(f"{key} -- name: {value.name}, supported script count: {len(value.scripts)}")

      if response.dictionary is not None:
          print("Dictionary Languages:")
          for key, value in response.dictionary.items():
              print(f"{key} -- name: {value.name}, supported target languages count: {len(value.translations)}")

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
      raise
  ```

  <!-- END SNIPPET -->

  For samples on using the `languages` endpoint refer to more samples [here][languages_sample].

  Please refer to the service documentation for a conceptual discussion of [languages][languages_doc].



  Renders single source-language text to multiple target-language texts with a single request.

  <!-- SNIPPET: sample_text_translation_translate.get_text_translation_multiple_languages -->

  ```python
  try:
      to_language = ["cs", "es", "de"]
      input_text_elements = ["This is a test"]

      response = text_translator.translate(body=input_text_elements, to_language=to_language)
      translation = response[0] if response else None

      if translation:
          detected_language = translation.detected_language
          if detected_language:
              print(
                  f"Detected languages of the input text: {detected_language.language} with score: {detected_language.score}."
              )
          for translated_text in translation.translations:
              print(f"Text was translated to: '{translated_text.to}' and the result is: '{translated_text.text}'.")

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
  ```

  <!-- END SNIPPET -->


  For samples on using the `translate` endpoint refer to more samples [here][translate_sample].

  Please refer to the service documentation for a conceptual discussion of [translate][translate_doc].



  Converts characters or letters of a source language to the corresponding characters or letters of a target language.

  <!-- SNIPPET: sample_text_translation_transliterate.get_text_transliteration -->

  ```python
  try:
      language = "zh-Hans"
      from_script = "Hans"
      to_script = "Latn"
      input_text_elements = ["这是个测试。"]

      response = text_translator.transliterate(
          body=input_text_elements,
          language=language,
          from_script=from_script,
          to_script=to_script,
      )
      transliteration = response[0] if response else None

      if transliteration:
          print(
              f"Input text was transliterated to '{transliteration.script}' script. Transliterated text: '{transliteration.text}'."
          )

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
      raise
  ```

  <!-- END SNIPPET -->
  For samples on using the `transliterate` endpoint refer to more samples [here][transliterate_sample].

  Please refer to the service documentation for a conceptual discussion of [transliterate][transliterate_doc].



  Identifies the positioning of sentence boundaries in a piece of text.

  <!-- SNIPPET: sample_text_translation_translate.get_text_translation_sentence_length -->

  ```python
  try:
      include_sentence_length = True
      to_language = ["cs"]
      input_text_elements = ["The answer lies in machine translation. This is a test."]

      response = text_translator.translate(
          body=input_text_elements, to_language=to_language, include_sentence_length=include_sentence_length
      )
      translation = response[0] if response else None

      if translation:
          detected_language = translation.detected_language
          if detected_language:
              print(
                  f"Detected languages of the input text: {detected_language.language} with score: {detected_language.score}."
              )
          for translated_text in translation.translations:
              print(f"Text was translated to: '{translated_text.to}' and the result is: '{translated_text.text}'.")
              if translated_text.sent_len:
                  print(f"Source Sentence length: {translated_text.sent_len.src_sent_len}")
                  print(f"Translated Sentence length: {translated_text.sent_len.trans_sent_len}")

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
  ```

  <!-- END SNIPPET -->

  For samples on using the `break sentence` endpoint refer to more samples [here][breaksentence_sample].

  Please refer to the service documentation for a conceptual discussion of [break sentence][breaksentence_doc].



  Returns equivalent words for the source term in the target language.

  <!-- SNIPPET: sample_text_translation_dictionary_lookup.get_text_translation_dictionary_lookup -->

  ```python
  try:
      from_language = "en"
      to_language = "es"
      input_text_elements = ["fly"]

      response = text_translator.lookup_dictionary_entries(
          body=input_text_elements, from_language=from_language, to_language=to_language
      )
      dictionary_entry = response[0] if response else None

      if dictionary_entry:
          print(f"For the given input {len(dictionary_entry.translations)} entries were found in the dictionary.")
          print(
              f"First entry: '{dictionary_entry.translations[0].display_target}', confidence: {dictionary_entry.translations[0].confidence}."
          )

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
      raise
  ```

  <!-- END SNIPPET -->

  For samples on using the `dictionary lookup` endpoint refer to more samples [here][dictionarylookup_sample].

  Please refer to the service documentation for a conceptual discussion of [dictionary lookup][dictionarylookup_doc].



  Returns grammatical structure and context examples for the source term and target term pair.

  <!-- SNIPPET: sample_text_translation_dictionary_examples.get_text_translation_dictionary_examples -->

  ```python
  try:
      from_language = "en"
      to_language = "es"
      input_text_elements = [DictionaryExampleTextItem(text="fly", translation="volar")]

      response = text_translator.lookup_dictionary_examples(
          body=input_text_elements, from_language=from_language, to_language=to_language
      )
      dictionary_entry = response[0] if response else None

      if dictionary_entry:
          print(f"For the given input {len(dictionary_entry.examples)} entries were found in the dictionary.")
          print(
              f"First example: '{dictionary_entry.examples[0].target_prefix}{dictionary_entry.examples[0].target_term}{dictionary_entry.examples[0].target_suffix}'."
          )

  except HttpResponseError as exception:
      if exception.error is not None:
          print(f"Error Code: {exception.error.code}")
          print(f"Message: {exception.error.message}")
  raise
  ```

  <!-- END SNIPPET -->

  For samples on using the `dictionary examples` endpoint refer to more samples [here][dictionaryexamples_sample].

  Please refer to the service documentation for a conceptual discussion of [dictionary examples][dictionaryexamples_doc].



  When you interact with the Translator Service using the TextTranslator client library, errors returned by the Translator service correspond to the same HTTP status codes returned for REST API requests.

  For example, if you submit a translation request without a target translate language, a `400` error is returned, indicating "Bad Request".

  You can find the different error codes returned by the service in the [Service Documentation][service_errors].



  If you encounter any bugs or have suggestions, please file an issue in the
  [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
  section of the project.



  More samples can be found under the [samples][samples] directory.



  This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].

  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.

  <!-- LINKS -->

  [python-dt-src]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/azure/ai/translation/text
  [python-dt-pypi]: https://aka.ms/azsdk/python/texttranslation/pypi
  [python-dt-product-docs]: https://learn.microsoft.com/azure/cognitive-services/translator/
  [python-dt-ref-docs]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-reference
  [python-dt-samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples

  [pip]: https://pypi.org/project/pip/
  [azure_cli]: https://docs.microsoft.com/cli/azure
  [azure_portal]: https://portal.azure.com

  [translator_resource_create]: https://learn.microsoft.com/azure/cognitive-services/Translator/create-translator-resource

  [translator_client_class]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_client.py

  [translator_auth]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-reference#authentication
  [translator_limits]: https://learn.microsoft.com/azure/cognitive-services/translator/request-limits
  [service_errors]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-reference#errors

  [languages_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-languages
  [translate_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-translate
  [transliterate_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-transliterate
  [breaksentence_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-break-sentence
  [dictionarylookup_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-dictionary-lookup
  [dictionaryexamples_doc]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-dictionary-examples

  [client_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_client.py
  [languages_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_languages.py
  [translate_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_translate.py
  [transliterate_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_transliterate.py
  [breaksentence_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_break_sentence.py
  [dictionarylookup_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_dictionary_lookup.py
  [dictionaryexamples_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples/sample_text_translation_dictionary_examples.py

  [samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/translation/azure-ai-translation-text/samples

  [cla]: https://cla.microsoft.com
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  [coc_contact]: mailto:opencode@microsoft.com


pkgId: 594f489e87a126c82ddf4fecdcd06464e7be604a83028b83074680d574551cdb
name: python-azure-ai-vision-face
arch: src
version: 1.0.0b1
epoch: 0
release: 1
summary: Microsoft Azure Ai Vision Face Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-ai-vision-face-1.0.0b1-1.src.rpm
checksum_type: sha256
description:
  The Azure AI Face service provides AI algorithms that detect, recognize, and analyze human faces in images. It includes the following main features:

  - Face detection and analysis
  - Liveness detection
  - Face recognition
    - Face verification ("one-to-one" matching)
  - Find similar faces
  - Group faces

  [Source code][source_code]
  | [Package (PyPI)][face_pypi]
  | [API reference documentation][face_ref_docs]
  | [Product documentation][face_product_docs]
  | [Samples][face_samples]





  - Python 3.8 or later is required to use this package.
  - You need an [Azure subscription][azure_sub] to use this package.
  - Your Azure account must have a `Cognitive Services Contributor` role assigned in order for you to agree to the responsible AI terms and create a resource. To get this role assigned to your account, follow the steps in the [Assign roles][azure_role_assignment] documentation, or contact your administrator.
  - Once you have sufficient permissions to control your Azure subscription, you need either
    * an [Azure Face account][azure_portal_list_face_account] or
    * an [Azure AI services multi-service account][azure_portal_list_cognitive_service_account]



  Azure AI Face supports both [multi-service][azure_cognitive_service_account] and single-service access. Create an Azure AI services multi-service account if you plan to access multiple Azure AI services under a single endpoint/key. For Face access only, create a Face resource.

  * To create a new Face or Azure AI services multi-service account, you can use [Azure Portal][azure_portal_create_face_account], [Azure PowerShell][quick_start_create_account_via_azure_powershell], or [Azure CLI][quick_start_create_account_via_azure_cli].



  ```bash
  python -m pip install azure-ai-vision-face
  ```



  In order to interact with the Face service, you will need to create an instance of a client.
  An **endpoint** and **credential** are necessary to instantiate the client object.

  Both key credential and Microsoft Entra ID credential are supported to authenticate the client.
  For enhanced security, we strongly recommend utilizing Microsoft Entra ID credential for authentication in the production environment, while AzureKeyCredential should be reserved exclusively for the testing environment.



  You can find the endpoint for your Face resource using the Azure Portal or Azure CLI:

  ```bash

  az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "properties.endpoint"
  ```

  Either a regional endpoint or a custom subdomain can be used for authentication. They are formatted as follows:

  ```
  Regional endpoint: https://<region>.api.cognitive.microsoft.com/
  Custom subdomain: https://<resource-name>.cognitiveservices.azure.com/
  ```

  A regional endpoint is the same for every resource in a region. A complete list of supported regional endpoints can be consulted [here][regional_endpoints]. Please note that regional endpoints do not support Microsoft Entra ID authentication. If you'd like migrate your resource to use custom subdomain, follow the instructions [here][how_to_migrate_resource_to_custom_subdomain].

  A custom subdomain, on the other hand, is a name that is unique to the resource. Once created and linked to a resource, it cannot be modified.




  `AzureKeyCredential` authentication is used in the examples in this getting started guide, but you can also authenticate with Microsoft Entra ID using the [azure-identity][azure_sdk_python_identity] library.
  Note that regional endpoints do not support Microsoft Entra ID authentication. Create a [custom subdomain][custom_subdomain] name for your resource in order to use this type of authentication.

  To use the [DefaultAzureCredential][azure_sdk_python_default_azure_credential] type shown below, or other credential types provided with the Azure SDK, please install the `azure-identity` package:

  ```
  pip install azure-identity
  ```

  You will also need to [register a new Microsoft Entra ID application and grant access][register_aad_app] to Face by assigning the `"Cognitive Services User"` role to your service principal.

  Once completed, set the values of the client ID, tenant ID, and client secret of the Microsoft Entra ID application as environment variables:
  `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

  ```python
  """DefaultAzureCredential will use the values from these environment
  variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
  """
  from azure.ai.vision.face import FaceClient
  from azure.identity import DefaultAzureCredential

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = DefaultAzureCredential()

  face_client = FaceClient(endpoint, credential)
  ```



  To use an API key as the `credential` parameter, pass the key as a string into an instance of [AzureKeyCredential][azure_sdk_python_azure_key_credential].
  You can get the API key for your Face resource using the [Azure Portal][get_key_via_azure_portal] or [Azure CLI][get_key_via_azure_cli]:

  ```bash

  az cognitiveservices account keys list --name "<resource-name>" --resource-group "<resource-group-name>"
  ```

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceClient

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = AzureKeyCredential("<api_key>")
  face_client = FaceClient(endpoint, credential)
  ```






  `FaceClient` provides operations for:

   - Face detection and analysis: Detect human faces in an image and return the rectangle coordinates of their locations,
     and optionally with landmarks, and face-related attributes. This operation is required as a first step in all the
     other face recognition scenarios.
   - Face recognition: Confirm that a user is who they claim to be based on how closely their face data matches the target face.
     It includes Face verification ("one-to-one" matching).
   - Finding similar faces from a smaller set of faces that look similar to the target face.
   - Grouping faces into several smaller groups based on similarity.




  `FaceSessionClient` is provided to interact with sessions which is used for Liveness detection.

   - Create, query, and delete the session.
   - Query the liveness and verification result.
   - Query the audit result.




  The following section provides several code snippets covering some of the most common Face tasks, including:

  * [Detecting faces in an image](#face-detection "Face Detection")
  * [Determining if a face in an video is real (live) or fake (spoof)](#liveness-detection "Liveness Detection")


  Detect faces and analyze them from an binary data. The latest model is the most accurate and recommended to be used.
  For the detailed differences between different versions of **Detection** and **Recognition** model, please refer to the following links.
  * [Detection model][evaluate_different_detection_models]
  * [Recognition model][recommended_recognition_model]

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceClient
  from azure.ai.vision.face.models import (
      FaceDetectionModel,
      FaceRecognitionModel,
      FaceAttributeTypeDetection03,
      FaceAttributeTypeRecognition04,
  )

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_client:
      sample_file_path = "<your image file>"
      with open(sample_file_path, "rb") as fd:
          file_content = fd.read()

      result = face_client.detect(
          file_content,
          detection_model=FaceDetectionModel.DETECTION_03,  # The latest detection model.
          recognition_model=FaceRecognitionModel.RECOGNITION_04,  # The latest recognition model.
          return_face_id=True,
          return_face_attributes=[
              FaceAttributeTypeDetection03.HEAD_POSE,
              FaceAttributeTypeDetection03.MASK,
              FaceAttributeTypeRecognition04.QUALITY_FOR_RECOGNITION,
          ],
          return_face_landmarks=True,
          return_recognition_model=True,
          face_id_time_to_live=120,
      )

      print(f"Detect faces from the file: {sample_file_path}")
      for idx, face in enumerate(result):
          print(f"----- Detection result: #{idx+1} -----")
          print(f"Face: {face.as_dict()}")
  ```


  Face Liveness detection can be used to determine if a face in an input video stream is real (live) or fake (spoof).
  The goal of liveness detection is to ensure that the system is interacting with a physically present live person at
  the time of authentication. The whole process of authentication is called a session.

  There are two different components in the authentication: a frontend application and an app server/orchestrator.
  Before uploading the video stream, the app server has to create a session, and then the frontend client could upload
  the payload with a `session authorization token` to call the liveness detection. The app server can query for the
  liveness detection result and audit logs anytime until the session is deleted.

  The Liveness detection operation can not only confirm if the input is live or spoof, but also verify whether the input
  belongs to the expected person's face, which is called **liveness detection with face verification**. For the detail
  information, please refer to the [tutorial][liveness_tutorial].

  This package is only responsible for app server to create, query, delete a session and get audit logs. For how to
  integrate the UI and the code into your native frontend application, please follow instructions in the [tutorial][liveness_tutorial].

  Here is an example to create and get the liveness detection result of a session.
  ```python
  import uuid

  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceSessionClient
  from azure.ai.vision.face.models import CreateLivenessSessionContent, LivenessOperationMode

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceSessionClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_session_client:
      
      print("Create a new liveness session.")
      created_session = face_session_client.create_liveness_session(
          CreateLivenessSessionContent(
              liveness_operation_mode=LivenessOperationMode.PASSIVE,
              device_correlation_id=str(uuid.uuid4()),
              send_results_to_client=False,
              auth_token_time_to_live_in_seconds=60,
          )
      )
      print(f"Result: {created_session}")

      
      print("Get the liveness detection result.")
      liveness_result = face_session_client.get_liveness_session_result(created_session.session_id)
      print(f"Result: {liveness_result}")
  ```

  Here is another example for the liveness detection with face verification.
  ```python
  import uuid

  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceSessionClient
  from azure.ai.vision.face.models import CreateLivenessSessionContent, LivenessOperationMode

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceSessionClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_session_client:
      sample_file_path = "<your verify image file>"
      with open(sample_file_path, "rb") as fd:
          file_content = fd.read()

      
      print("Create a new liveness with verify session with verify image.")

      created_session = face_session_client.create_liveness_with_verify_session(
          CreateLivenessSessionContent(
              liveness_operation_mode=LivenessOperationMode.PASSIVE,
              device_correlation_id=str(uuid.uuid4()),
              send_results_to_client=False,
              auth_token_time_to_live_in_seconds=60,
          ),
          verify_image=file_content,
      )
      print(f"Result: {created_session}")

      
      print("Get the liveness detection and verification result.")
      liveness_result = face_session_client.get_liveness_with_verify_session_result(created_session.session_id)
      print(f"Result: {liveness_result}")
  ```





  Face client library will raise exceptions defined in [Azure Core][python_azure_core_exceptions].
  Error codes and messages raised by the Face service can be found in the [service documentation][face_errors].



  This library uses the standard [logging][python_logging] library for logging.

  Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level.

  Detailed `DEBUG` level logging, including request/response bodies and **unredacted**
  headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument.

  See full SDK logging documentation with examples [here][sdk_logging_docs].

  ```python
  import sys
  import logging

  from azure.ai.vision.face import FaceClient
  from azure.core.credentials import AzureKeyCredential

  logging.basicConfig(level=logging.DEBUG,
                      format='s - s - s - s',
                      stream=sys.stdout)

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = AzureKeyCredential("<api_key>")
  face_client = FaceClient(endpoint, credential)

  face.detect(..., logging_enable=True)
  ```



  Optional keyword arguments can be passed in at the client and per-operation level.
  The azure-core [reference documentation][azure_core_ref_docs] describes available configurations for retries, logging, transport protocols, and more.





  See the [Sample README][face_samples] for several code snippets illustrating common patterns used in the Face Python API.



  For more extensive documentation on Azure AI Face, see the [Face documentation][face_product_docs] on learn.microsoft.com.



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the Code of Conduct FAQ or contact opencode@microsoft.com with any
  additional questions or comments.

  <!-- LINKS -->
  [source_code]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/azure/ai/vision/face
  [face_pypi]: https://aka.ms/azsdk-python-face-pkg
  [face_ref_docs]: https://aka.ms/azsdk-python-face-ref
  [face_product_docs]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity
  [face_samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/samples

  [azure_sub]: https://azure.microsoft.com/free/
  [azure_role_assignment]: https://learn.microsoft.com/azure/role-based-access-control/role-assignments-steps
  [azure_portal_list_face_account]: https://portal.azure.com/#blade/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/Face
  [azure_portal_list_cognitive_service_account]: https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/AllInOne
  [azure_cognitive_service_account]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal#supported-services-with-a-multi-service-resource
  [azure_portal_create_face_account]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesFace
  [quick_start_create_account_via_azure_cli]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azcli
  [quick_start_create_account_via_azure_powershell]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azpowershell

  [get_key_via_azure_portal]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal#get-the-keys-for-your-resource
  [get_key_via_azure_cli]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azcli#get-the-keys-for-your-resource
  [regional_endpoints]: https://azure.microsoft.com/global-infrastructure/services/?products=cognitive-services
  [how_to_migrate_resource_to_custom_subdomain]: https://learn.microsoft.com/azure/ai-services/cognitive-services-custom-subdomains#how-does-this-impact-existing-resources
  [azure_sdk_python_azure_key_credential]: https://aka.ms/azsdk/python/core/azurekeycredential
  [azure_sdk_python_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
  [custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain
  [azure_sdk_python_default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal

  [face_verification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#verification
  [face_identification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#identification
  [find_similar]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#find-similar-faces
  [use_person_directory_structure]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/use-persondirectory

  [evaluate_different_detection_models]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model#evaluate-different-models
  [recommended_recognition_model]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model#recommended-model
  [liveness_tutorial]: https://learn.microsoft.com/azure/ai-services/computer-vision/tutorials/liveness

  [python_azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
  [face_errors]: https://aka.ms/face-error-codes-and-messages
  [python_logging]: https://docs.python.org/3/library/logging.html
  [sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/sdk/azure-sdk-logging
  [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs

  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
  [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
  [azure_identity_pip]: https://pypi.org/project/azure-identity/
  [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [pip]: https://pypi.org/project/pip/


pkgId: e99faf36eaaeafe102a704c13b9e0650e8fd38dafb69389f0e9d9ef4e771303f
name: python-azure-ai-vision-face
arch: src
version: 1.0.0b2
epoch: 0
release: 1
summary: Microsoft Azure Ai Vision Face Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-ai-vision-face-1.0.0b2-1.src.rpm
checksum_type: sha256
description:
  The Azure AI Face service provides AI algorithms that detect, recognize, and analyze human faces in images. It includes the following main features:

  - Face detection and analysis
  - Liveness detection
  - Face recognition
    - Face verification ("one-to-one" matching)
    - Face identification ("one-to-many" matching)
  - Find similar faces
  - Group faces

  [Source code][source_code]
  | [Package (PyPI)][face_pypi]
  | [API reference documentation][face_ref_docs]
  | [Product documentation][face_product_docs]
  | [Samples][face_samples]





  - Python 3.8 or later is required to use this package.
  - You need an [Azure subscription][azure_sub] to use this package.
  - Your Azure account must have a `Cognitive Services Contributor` role assigned in order for you to agree to the responsible AI terms and create a resource. To get this role assigned to your account, follow the steps in the [Assign roles][azure_role_assignment] documentation, or contact your administrator.
  - Once you have sufficient permissions to control your Azure subscription, you need either
    * an [Azure Face account][azure_portal_list_face_account] or
    * an [Azure AI services multi-service account][azure_portal_list_cognitive_service_account]



  Azure AI Face supports both [multi-service][azure_cognitive_service_account] and single-service access. Create an Azure AI services multi-service account if you plan to access multiple Azure AI services under a single endpoint/key. For Face access only, create a Face resource.

  * To create a new Face or Azure AI services multi-service account, you can use [Azure Portal][azure_portal_create_face_account], [Azure PowerShell][quick_start_create_account_via_azure_powershell], or [Azure CLI][quick_start_create_account_via_azure_cli].



  ```bash
  python -m pip install azure-ai-vision-face
  ```



  In order to interact with the Face service, you will need to create an instance of a client.
  An **endpoint** and **credential** are necessary to instantiate the client object.

  Both key credential and Microsoft Entra ID credential are supported to authenticate the client.
  For enhanced security, we strongly recommend utilizing Microsoft Entra ID credential for authentication in the production environment, while AzureKeyCredential should be reserved exclusively for the testing environment.



  You can find the endpoint for your Face resource using the Azure Portal or Azure CLI:

  ```bash

  az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "properties.endpoint"
  ```

  Either a regional endpoint or a custom subdomain can be used for authentication. They are formatted as follows:

  ```
  Regional endpoint: https://<region>.api.cognitive.microsoft.com/
  Custom subdomain: https://<resource-name>.cognitiveservices.azure.com/
  ```

  A regional endpoint is the same for every resource in a region. A complete list of supported regional endpoints can be consulted [here][regional_endpoints]. Please note that regional endpoints do not support Microsoft Entra ID authentication. If you'd like migrate your resource to use custom subdomain, follow the instructions [here][how_to_migrate_resource_to_custom_subdomain].

  A custom subdomain, on the other hand, is a name that is unique to the resource. Once created and linked to a resource, it cannot be modified.




  `AzureKeyCredential` authentication is used in the examples in this getting started guide, but you can also authenticate with Microsoft Entra ID using the [azure-identity][azure_sdk_python_identity] library.
  Note that regional endpoints do not support Microsoft Entra ID authentication. Create a [custom subdomain][custom_subdomain] name for your resource in order to use this type of authentication.

  To use the [DefaultAzureCredential][azure_sdk_python_default_azure_credential] type shown below, or other credential types provided with the Azure SDK, please install the `azure-identity` package:

  ```
  pip install azure-identity
  ```

  You will also need to [register a new Microsoft Entra ID application and grant access][register_aad_app] to Face by assigning the `"Cognitive Services User"` role to your service principal.

  Once completed, set the values of the client ID, tenant ID, and client secret of the Microsoft Entra ID application as environment variables:
  `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

  ```python
  """DefaultAzureCredential will use the values from these environment
  variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
  """
  from azure.ai.vision.face import FaceClient
  from azure.identity import DefaultAzureCredential

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = DefaultAzureCredential()

  face_client = FaceClient(endpoint, credential)
  ```



  To use an API key as the `credential` parameter, pass the key as a string into an instance of [AzureKeyCredential][azure_sdk_python_azure_key_credential].
  You can get the API key for your Face resource using the [Azure Portal][get_key_via_azure_portal] or [Azure CLI][get_key_via_azure_cli]:

  ```bash

  az cognitiveservices account keys list --name "<resource-name>" --resource-group "<resource-group-name>"
  ```

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceClient

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = AzureKeyCredential("<api_key>")
  face_client = FaceClient(endpoint, credential)
  ```






  `FaceClient` provides operations for:

   - Face detection and analysis: Detect human faces in an image and return the rectangle coordinates of their locations,
     and optionally with landmarks, and face-related attributes. This operation is required as a first step in all the
     other face recognition scenarios.
   - Face recognition: Confirm that a user is who they claim to be based on how closely their face data matches the target face.
     It includes Face verification ("one-to-one" matching).
   - Finding similar faces from a smaller set of faces that look similar to the target face.
   - Grouping faces into several smaller groups based on similarity.



  `FaceAdministrationClient` is provided to interact with the following data structures that hold data on faces and
  person for Face recognition:

   - `large_face_list`: It is a list of faces which can hold faces and used by [find similar faces][find_similar].
     - It can up to 1,000,000 faces.
     - Training (`begin_train()`) is required before calling `find_similar_from_large_face_list()`.
   - `large_person_group`: It is a container which can hold person objects, and is used by face recognition.
     - It can up to 1,000,000 person objects, with each person capable of holding up to 248 faces. The total person objects in all `large_person_group` should not exceed 1,000,000,000.
     - For [face verification][face_verification], call `verify_from_large_person_group()`.
     - For [face identification][face_identification], training (`begin_train()`) is required before calling `identify_from_large_person_group()`.



  `FaceSessionClient` is provided to interact with sessions which is used for Liveness detection.

   - Create, query, and delete the session.
   - Query the liveness and verification result.
   - Query the audit result.



  Long-running operations are operations which consist of an initial request sent to the service to start an operation,
  followed by polling the service at intervals to determine whether the operation has completed or failed, and if it has
  succeeded, to get the result.

  Methods that train a group (LargeFaceList or LargePersonGroup) are modeled as long-running operations.
  The client exposes a `begin_<method-name>` method that returns an `LROPoller` or `AsyncLROPoller`. Callers should wait
  for the operation to complete by calling `result()` on the poller object returned from the `begin_<method-name>` method.
  Sample code snippets are provided to illustrate using long-running operations [below](#examples "Examples").



  The following section provides several code snippets covering some of the most common Face tasks, including:

  * [Detecting faces in an image](#face-detection "Face Detection")
  * [Identifying the specific face from a LargePersonGroup](#face-recognition-from-largepersongroup "Face Recognition from LargePersonGroup")
  * [Determining if a face in an video is real (live) or fake (spoof)](#liveness-detection "Liveness Detection")


  Detect faces and analyze them from an binary data. The latest model is the most accurate and recommended to be used.
  For the detailed differences between different versions of **Detection** and **Recognition** model, please refer to the following links.
  * [Detection model][evaluate_different_detection_models]
  * [Recognition model][recommended_recognition_model]

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceClient
  from azure.ai.vision.face.models import (
      FaceDetectionModel,
      FaceRecognitionModel,
      FaceAttributeTypeDetection03,
      FaceAttributeTypeRecognition04,
  )

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_client:
      sample_file_path = "<your image file>"
      with open(sample_file_path, "rb") as fd:
          file_content = fd.read()

      result = face_client.detect(
          file_content,
          detection_model=FaceDetectionModel.DETECTION03,  # The latest detection model.
          recognition_model=FaceRecognitionModel.RECOGNITION04,  # The latest recognition model.
          return_face_id=True,
          return_face_attributes=[
              FaceAttributeTypeDetection03.HEAD_POSE,
              FaceAttributeTypeDetection03.MASK,
              FaceAttributeTypeRecognition04.QUALITY_FOR_RECOGNITION,
          ],
          return_face_landmarks=True,
          return_recognition_model=True,
          face_id_time_to_live=120,
      )

      print(f"Detect faces from the file: {sample_file_path}")
      for idx, face in enumerate(result):
          print(f"----- Detection result: #{idx+1} -----")
          print(f"Face: {face.as_dict()}")
  ```



  Identify a face against a defined LargePersonGroup.

  First, we have to use `FaceAdministrationClient` to create a `LargePersonGroup`, add a few `Person` to it, and then register faces with these `Person`.

  ```python
  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceAdministrationClient, FaceClient
  from azure.ai.vision.face.models import FaceDetectionModel, FaceRecognitionModel


  def read_file_content(file_path: str):
      with open(file_path, "rb") as fd:
          file_content = fd.read()

      return file_content


  endpoint = "<your endpoint>"
  key = "<your api key>"

  large_person_group_id = "lpg_family"

  with FaceAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_admin_client:
      print(f"Create a large person group with id: {large_person_group_id}")
      face_admin_client.large_person_group.create(
          large_person_group_id, name="My Family", recognition_model=FaceRecognitionModel.RECOGNITION04
      )

      print("Create a Person Bill and add a face to him.")
      bill_person_id = face_admin_client.large_person_group.create_person(
          large_person_group_id, name="Bill", user_data="Dad"
      ).person_id
      bill_image_file_path = "./samples/images/Family1-Dad1.jpg"
      face_admin_client.large_person_group.add_face(
          large_person_group_id,
          bill_person_id,
          read_file_content(bill_image_file_path),
          detection_model=FaceDetectionModel.DETECTION03,
          user_data="Dad-0001",
      )

      print("Create a Person Clare and add a face to her.")
      clare_person_id = face_admin_client.large_person_group.create_person(
          large_person_group_id, name="Clare", user_data="Mom"
      ).person_id
      clare_image_file_path = "./samples/images/Family1-Mom1.jpg"
      face_admin_client.large_person_group.add_face(
          large_person_group_id,
          clare_person_id,
          read_file_content(clare_image_file_path),
          detection_model=FaceDetectionModel.DETECTION03,
          user_data="Mom-0001",
      )
  ```

  Before doing the identification, we need to train the LargePersonGroup first.
  ```python
      print(f"Start to train the large person group: {large_person_group_id}.")
      poller = face_admin_client.large_person_group.begin_train(large_person_group_id)

      
      
      training_result = poller.result()
  ```

  When the training operation is completed successfully, we can identify the faces in this LargePersonGroup through
  `FaceClient`.
  ```python
  with FaceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_client:
      
      target_image_file_path = "./samples/images/identification1.jpg"
      detect_result = face_client.detect(
          read_file_content(target_image_file_path),
          detection_model=FaceDetectionModel.DETECTION03,
          recognition_model=FaceRecognitionModel.RECOGNITION04,
          return_face_id=True,
      )
      target_face_ids = list(f.face_id for f in detect_result)

      
      result = face_client.identify_from_large_person_group(
          face_ids=target_face_ids, large_person_group_id=large_person_group_id
      )
      for idx, r in enumerate(result):
          print(f"----- Identification result: #{idx+1} -----")
          print(f"{r.as_dict()}")
  ```

  Finally, use `FaceAdministrationClient` to remove the large person group if you don't need it anymore.
  ```python
  with FaceAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_admin_client:
      print(f"Delete the large person group: {large_person_group_id}")
      face_admin_client.large_person_group.delete(large_person_group_id)
  ```


  Face Liveness detection can be used to determine if a face in an input video stream is real (live) or fake (spoof).
  The goal of liveness detection is to ensure that the system is interacting with a physically present live person at
  the time of authentication. The whole process of authentication is called a session.

  There are two different components in the authentication: a frontend application and an app server/orchestrator.
  Before uploading the video stream, the app server has to create a session, and then the frontend client could upload
  the payload with a `session authorization token` to call the liveness detection. The app server can query for the
  liveness detection result and audit logs anytime until the session is deleted.

  The Liveness detection operation can not only confirm if the input is live or spoof, but also verify whether the input
  belongs to the expected person's face, which is called **liveness detection with face verification**. For the detail
  information, please refer to the [tutorial][liveness_tutorial].

  This package is only responsible for app server to create, query, delete a session and get audit logs. For how to
  integrate the UI and the code into your native frontend application, please follow instructions in the [tutorial][liveness_tutorial].

  Here is an example to create and get the liveness detection result of a session.
  ```python
  import uuid

  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceSessionClient
  from azure.ai.vision.face.models import CreateLivenessSessionContent, LivenessOperationMode

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceSessionClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_session_client:
      
      print("Create a new liveness session.")
      created_session = face_session_client.create_liveness_session(
          CreateLivenessSessionContent(
              liveness_operation_mode=LivenessOperationMode.PASSIVE,
              device_correlation_id=str(uuid.uuid4()),
              send_results_to_client=False,
              auth_token_time_to_live_in_seconds=60,
          )
      )
      print(f"Result: {created_session}")

      
      print("Get the liveness detection result.")
      liveness_result = face_session_client.get_liveness_session_result(created_session.session_id)
      print(f"Result: {liveness_result}")
  ```

  Here is another example for the liveness detection with face verification.
  ```python
  import uuid

  from azure.core.credentials import AzureKeyCredential
  from azure.ai.vision.face import FaceSessionClient
  from azure.ai.vision.face.models import CreateLivenessSessionContent, LivenessOperationMode

  endpoint = "<your endpoint>"
  key = "<your api key>"

  with FaceSessionClient(endpoint=endpoint, credential=AzureKeyCredential(key)) as face_session_client:
      sample_file_path = "<your verify image file>"
      with open(sample_file_path, "rb") as fd:
          file_content = fd.read()

      
      print("Create a new liveness with verify session with verify image.")

      created_session = face_session_client.create_liveness_with_verify_session(
          CreateLivenessSessionContent(
              liveness_operation_mode=LivenessOperationMode.PASSIVE,
              device_correlation_id=str(uuid.uuid4()),
              send_results_to_client=False,
              auth_token_time_to_live_in_seconds=60,
          ),
          verify_image=file_content,
      )
      print(f"Result: {created_session}")

      
      print("Get the liveness detection and verification result.")
      liveness_result = face_session_client.get_liveness_with_verify_session_result(created_session.session_id)
      print(f"Result: {liveness_result}")
  ```





  Face client library will raise exceptions defined in [Azure Core][python_azure_core_exceptions].
  Error codes and messages raised by the Face service can be found in the [service documentation][face_errors].



  This library uses the standard [logging][python_logging] library for logging.

  Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level.

  Detailed `DEBUG` level logging, including request/response bodies and **unredacted**
  headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument.

  See full SDK logging documentation with examples [here][sdk_logging_docs].

  ```python
  import sys
  import logging

  from azure.ai.vision.face import FaceClient
  from azure.core.credentials import AzureKeyCredential

  logging.basicConfig(level=logging.DEBUG,
                      format='s - s - s - s',
                      stream=sys.stdout)

  endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
  credential = AzureKeyCredential("<api_key>")
  face_client = FaceClient(endpoint, credential)

  face.detect(..., logging_enable=True)
  ```



  Optional keyword arguments can be passed in at the client and per-operation level.
  The azure-core [reference documentation][azure_core_ref_docs] describes available configurations for retries, logging, transport protocols, and more.





  See the [Sample README][face_samples] for several code snippets illustrating common patterns used in the Face Python API.



  For more extensive documentation on Azure AI Face, see the [Face documentation][face_product_docs] on learn.microsoft.com.



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the Code of Conduct FAQ or contact opencode@microsoft.com with any
  additional questions or comments.

  <!-- LINKS -->
  [source_code]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/azure/ai/vision/face
  [face_pypi]: https://aka.ms/azsdk-python-face-pkg
  [face_ref_docs]: https://aka.ms/azsdk-python-face-ref
  [face_product_docs]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity
  [face_samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/samples

  [azure_sub]: https://azure.microsoft.com/free/
  [azure_role_assignment]: https://learn.microsoft.com/azure/role-based-access-control/role-assignments-steps
  [azure_portal_list_face_account]: https://portal.azure.com/#blade/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/Face
  [azure_portal_list_cognitive_service_account]: https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/AllInOne
  [azure_cognitive_service_account]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal#supported-services-with-a-multi-service-resource
  [azure_portal_create_face_account]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesFace
  [quick_start_create_account_via_azure_cli]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azcli
  [quick_start_create_account_via_azure_powershell]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azpowershell

  [get_key_via_azure_portal]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azportal#get-the-keys-for-your-resource
  [get_key_via_azure_cli]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azcli#get-the-keys-for-your-resource
  [regional_endpoints]: https://azure.microsoft.com/global-infrastructure/services/?products=cognitive-services
  [how_to_migrate_resource_to_custom_subdomain]: https://learn.microsoft.com/azure/ai-services/cognitive-services-custom-subdomains#how-does-this-impact-existing-resources
  [azure_sdk_python_azure_key_credential]: https://aka.ms/azsdk/python/core/azurekeycredential
  [azure_sdk_python_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
  [custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain
  [azure_sdk_python_default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal

  [face_verification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#verification
  [face_identification]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#identification
  [find_similar]: https://learn.microsoft.com/azure/ai-services/computer-vision/overview-identity#find-similar-faces
  [use_person_directory_structure]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/use-persondirectory

  [evaluate_different_detection_models]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model#evaluate-different-models
  [recommended_recognition_model]: https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model#recommended-model
  [liveness_tutorial]: https://learn.microsoft.com/azure/ai-services/computer-vision/tutorials/liveness

  [python_azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
  [face_errors]: https://aka.ms/face-error-codes-and-messages
  [python_logging]: https://docs.python.org/3/library/logging.html
  [sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/sdk/azure-sdk-logging
  [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs

  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
  [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
  [azure_identity_pip]: https://pypi.org/project/azure-identity/
  [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [pip]: https://pypi.org/project/pip/


pkgId: 7629663d687069c9a414bfe24538f26475aae23e7d7fd9c99eef796ccc324336
name: python-azure-ai-vision-imageanalysis
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Microsoft Azure Ai Vision Imageanalysis Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-ai-vision-imageanalysis-1.0.0-1.src.rpm
checksum_type: sha256
description:
  The Image Analysis service provides AI algorithms for processing images and returning information about their content. In a single service call, you can extract one or more visual features from the image simultaneously, including getting a caption for the image, extracting text shown in the image (OCR) and detecting objects. For more information on the service and the supported visual features, see [Image Analysis overview](https://learn.microsoft.com/azure/ai-services/computer-vision/overview-image-analysis?tabs=4-0), and the [Concepts](https://learn.microsoft.com/azure/ai-services/computer-vision/concept-tag-images-40) page.

  Use the Image Analysis client library to:

  * Authenticate against the service
  * Set what features you would like to extract
  * Upload an image for analysis, or send an image URL
  * Get the analysis result

  [Product documentation](https://learn.microsoft.com/azure/ai-services/computer-vision/overview-image-analysis?tabs=4-0)
  | [Samples](https://aka.ms/azsdk/image-analysis/samples/python)
  | [Vision Studio](https://aka.ms/vision-studio/image-analysis)
  | [API reference documentation](https://aka.ms/azsdk/image-analysis/ref-docs/python)
  | [Package (Pypi)](https://aka.ms/azsdk/image-analysis/package/pypi)
  | [SDK source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/azure/ai/vision/imageanalysis)





  * [Python 3.8](https://www.python.org/) or later installed, including [pip](https://pip.pypa.io/en/stable/).
  * An [Azure subscription](https://azure.microsoft.com/free).
  * A [Computer Vision resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision) deployed to your Azure subscription. Note that in order to run Image Analysis with the `Caption` or `Dense Captions` features, the Computer Vision resource needs to be from a GPU-supported region. See this [document](https://learn.microsoft.com/azure/ai-services/computer-vision/concept-describe-images-40) for a list of supported regions.
  * An endpoint URL. It can be found in the "overview" tab of your Computer Vision resource in the Azure portal, and has the form `https://your-resource-name.cognitiveservices.azure.com` where `your-resource-name` is your unique Computer Vision resource name. The samples below assume the environment variable `VISION_ENDPOINT` has been set to this value.
  * For API key authentication, you will need the key. It can be found in the "overview" tab of your Computer Vision resource in the Azure portal. It's a 32-character Hexadecimal number. The samples below assume the environment variable `VISION_KEY` has been set to this value.
  * For Entra ID authentication, your application needs an object that implements the [TokenCredential](https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential) interface. Samples below use [DefaultAzureCredential](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential). To get that working, you will need:
    * The role `Cognitive Services User` assigned to you. Role assigned can be done via the "Access Control (IAM)" tab of your Computer Vision resource in the Azure portal.
    * [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) installed.
    * You are logged into your Azure account by running `az login`.
    * Note that if you have multiple Azure subscriptions, the subscription that contains your Computer Vision resource must be your default subscription. Run `az account list --output table` to list all you subscription and see which one is the default. Run `az account set --subscription "Your Subscription ID or Name"` to change your default subscription.

  Also note that the client library does not directly read the `VISION_ENDPOINT` and `VISION_KEY`environment variables mentioned above at run time. The endpoint and key (for API key authentication) must be provided to the constructor of the `ImageAnalysisClient` in your code. The sample code below reads environment variables to promote the practice of not hard-coding secrets in your source code.



  ```bash
  pip install azure-ai-vision-imageanalysis
  ```





  Once you defined the two environment variables, this Python code will create and authenticate a synchronous `ImageAnalysisClient` using key:

  <!-- SNIPPET:sample_caption_image_file.create_client -->

  ```python
  import os
  from azure.ai.vision.imageanalysis import ImageAnalysisClient
  from azure.ai.vision.imageanalysis.models import VisualFeatures
  from azure.core.credentials import AzureKeyCredential



  try:
      endpoint = os.environ["VISION_ENDPOINT"]
      key = os.environ["VISION_KEY"]
  except KeyError:
      print("Missing environment variable 'VISION_ENDPOINT' or 'VISION_KEY'")
      print("Set them before running this sample.")
      exit()



  client = ImageAnalysisClient(
      endpoint=endpoint,
      credential=AzureKeyCredential(key)
  )
  ```

  <!-- END SNIPPET -->



  To use the [DefaultAzureCredential](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python) provider shown below, or other credential providers, install the `azure-identity` package:

  ```bash
  pip install azure.identity
  ```

  Assuming you defined the environment variable `VISION_ENDPOINT` mentioned above, this Python code will create and authenticate a synchronous `ImageAnalysisClient` using Entra ID:

  <!-- SNIPPET:sample_caption_image_file_entra_id_auth.create_client -->

  ```python
  import os
  from azure.ai.vision.imageanalysis import ImageAnalysisClient
  from azure.ai.vision.imageanalysis.models import VisualFeatures
  from azure.identity import DefaultAzureCredential


  try:
      endpoint = os.environ["VISION_ENDPOINT"]
  except KeyError:
      print("Missing environment variable 'VISION_ENDPOINT'.")
      print("Set it before running this sample.")
      exit()



  client = ImageAnalysisClient(
      endpoint=endpoint,
      credential=DefaultAzureCredential(exclude_interactive_browser_credential=False),
  )
  ```

  <!-- END SNIPPET -->



  A synchronous client supports synchronous analysis methods, meaning they will block until the service responds with analysis results. The code snippets below all use synchronous methods because it's easier for a getting-started guide. The SDK offers equivalent asynchronous APIs which are often preferred. To create an asynchronous client, do the following:

  * Install the additional package [aiohttp](https://pypi.org/project/aiohttp/):
      ```bash
      pip install aiohttp
      ```
  * Update the above code to import `ImageAnalysisClient` from the `azure.ai.vision.imageanalysis.aio`:
      ```python
      from azure.ai.vision.imageanalysis.aio import ImageAnalysisClient
      ```
  * If you are using Entra ID authentication with `DefaultAzureCredential`, update the above code to import `DefaultAzureCredential` from `azure.identity.aio`:
      ```python
      from azure.identity.aio import DefaultAzureCredential
      ```





  Once you've initialized an `ImageAnalysisClient`, you need to select one or more visual features to analyze. The options are specified by the enum class `VisualFeatures`. The following features are supported:

  1. `VisualFeatures.CAPTION` ([Examples](#generate-an-image-caption-for-an-image-file) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Generate a human-readable sentence that describes the content of an image.
  1. `VisualFeatures.READ` ([Examples](#extract-text-from-an-image-file) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Also known as Optical Character Recognition (OCR). Extract printed or handwritten text from images. **Note**: For extracting text from PDF, Office, and HTML documents and document images, use the Document Intelligence service with the [Read model](https://learn.microsoft.com/azure/ai-services/document-intelligence/concept-read?view=doc-intel-4.0.0). This model is optimized for text-heavy digital and scanned documents with an asynchronous REST API that makes it easy to power your intelligent document processing scenarios. This service is separate from the Image Analysis service and has its own SDK.
  1. `VisualFeatures.DENSE_CAPTIONS` ([Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Dense Captions provides more details by generating one-sentence captions for up to 10 different regions in the image, including one for the whole image.
  1. `VisualFeatures.TAGS` ([Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Extract content tags for thousands of recognizable objects, living beings, scenery, and actions that appear in images.
  1. `VisualFeatures.OBJECTS` ([Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Object detection. This is similar to tagging, but focused on detecting physical objects in the image and returning their location.
  1. `VisualFeatures.SMART_CROPS` ([Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Used to find a representative sub-region of the image for thumbnail generation, with priority given to include faces.
  1. `VisualFeatures.PEOPLE` ([Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples)): Detect people in the image and return their location.

  For more information about these features, see [Image Analysis overview](https://learn.microsoft.com/azure/ai-services/computer-vision/overview-image-analysis?tabs=4-0), and the [Concepts](https://learn.microsoft.com/azure/ai-services/computer-vision/concept-tag-images-40) page.



  The `ImageAnalysisClient` has two overloads for the method `analyze`:
  * Analyze an image from an input [bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects) object. The client will upload the image to the service as part of the REST request.
  * Analyze an image from a publicly-accessible URL. The client will send the image URL to the service. The service will fetch the image.

  The examples below show how to do both. The `analyze` from an input `bytes` object examples populate the `bytes` object by loading an image from a file on disk.



  Image Analysis works on images that meet the following requirements:
  * The image must be presented in JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, or MPO format
  * The file size of the image must be less than 20 megabytes (MB)
  * The dimensions of the image must be greater than 50 x 50 pixels and less than 16,000 x 16,000 pixels




  The following sections provide code snippets covering these common Image Analysis scenarios:

  * [Generate an image caption for an image file](#generate-an-image-caption-for-an-image-file)
  * [Generate an image caption for an image URL](#generate-an-image-caption-for-an-image-url)
  * [Extract text (OCR) from an image file](#extract-text-from-an-image-file)
  * [Extract text (OCR) from an image URL](#extract-text-from-an-image-url)

  These snippets use the synchronous `client` from [Create and authenticate the client](#create-and-authenticate-the-client).

  See the [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples) folder for fully working samples for all visual features, including asynchronous clients.



  This example demonstrates how to generate a one-sentence caption for the image file `sample.jpg` using the `ImageAnalysisClient`. The synchronous (blocking) `analyze` method call returns an `ImageAnalysisResult` object with a `caption` property of type `CaptionResult`. It contains the generated caption and its confidence score in the range [0, 1]. By default the caption may contain gender terms such as "man", "woman", or "boy", "girl". You have the option to request gender-neutral terms such as "person" or "child" by setting `gender_neutral_caption = True` when calling `analyze`.

  Notes:
  * Caption is only available in some Azure regions. See [Prerequisites](#prerequisites).
  * Caption is only supported in English at the moment.

  <!-- SNIPPET:sample_caption_image_file.caption -->

  ```python

  with open("sample.jpg", "rb") as f:
      image_data = f.read()


  result = client.analyze(
      image_data=image_data,
      visual_features=[VisualFeatures.CAPTION],
      gender_neutral_caption=True,  # Optional (default is False)
  )


  print("Image analysis results:")
  print(" Caption:")
  if result.caption is not None:
      print(f"   '{result.caption.text}', Confidence {result.caption.confidence:.4f}")
  ```

  <!-- END SNIPPET -->

  To generate captions for additional images, simply call `analyze` multiple times. You can use the same `ImageAnalysisClient` do to multiple analysis calls.



  This example is similar to the above, expect it calls the `analyze` method and provides a [publicly accessible image URL](https://aka.ms/azsdk/image-analysis/sample.jpg) instead of a file name.

  <!-- SNIPPET:sample_caption_image_url.caption -->

  ```python

  result = client.analyze_from_url(
      image_url="https://aka.ms/azsdk/image-analysis/sample.jpg",
      visual_features=[VisualFeatures.CAPTION],
      gender_neutral_caption=True,  # Optional (default is False)
  )


  print("Image analysis results:")
  print(" Caption:")
  if result.caption is not None:
      print(f"   '{result.caption.text}', Confidence {result.caption.confidence:.4f}")
  ```

  <!-- END SNIPPET -->



  This example demonstrates how to extract printed or hand-written text for the image file `sample.jpg` using the `ImageAnalysisClient`. The synchronous (blocking) `analyze` method call returns an `ImageAnalysisResult` object with a `read` property of type `ReadResult`. It includes a list of text lines and a bounding polygon surrounding each text line. For each line, it also returns a list of words in the text line and a bounding polygon surrounding each word.

  <!-- SNIPPET:sample_ocr_image_file.read -->

  ```python

  with open("sample.jpg", "rb") as f:
      image_data = f.read()


  result = client.analyze(
      image_data=image_data,
      visual_features=[VisualFeatures.READ]
  )


  print("Image analysis results:")
  print(" Read:")
  if result.read is not None:
      for line in result.read.blocks[0].lines:
          print(f"   Line: '{line.text}', Bounding box {line.bounding_polygon}")
          for word in line.words:
              print(f"     Word: '{word.text}', Bounding polygon {word.bounding_polygon}, Confidence {word.confidence:.4f}")
  ```

  <!-- END SNIPPET -->

  To extract text for additional images, simply call `analyze` multiple times. You can use the same ImageAnalysisClient do to multiple analysis calls.

  **Note**: For extracting text from PDF, Office, and HTML documents and document images, use the Document Intelligence service with the [Read model](https://learn.microsoft.com/azure/ai-services/document-intelligence/concept-read?view=doc-intel-4.0.0). This model is optimized for text-heavy digital and scanned documents with an asynchronous REST API that makes it easy to power your intelligent document processing scenarios. This service is separate from the Image Analysis service and has its own SDK.



  This example is similar to the above, expect it calls the `analyze` method and provides a [publicly accessible image URL](https://aka.ms/azsdk/image-analysis/sample.jpg) instead of a file name.

  <!-- SNIPPET:sample_ocr_image_url.read -->

  ```python

  result = client.analyze_from_url(
      image_url="https://aka.ms/azsdk/image-analysis/sample.jpg",
      visual_features=[VisualFeatures.READ]
  )


  print("Image analysis results:")
  print(" Read:")
  if result.read is not None:
      for line in result.read.blocks[0].lines:
          print(f"   Line: '{line.text}', Bounding box {line.bounding_polygon}")
          for word in line.words:
              print(f"     Word: '{word.text}', Bounding polygon {word.bounding_polygon}, Confidence {word.confidence:.4f}")
  ```

  <!-- END SNIPPET -->






  The `analyze` methods raise an [HttpResponseError](https://learn.microsoft.com/python/api/azure-core/azure.core.exceptions.httpresponseerror) exception for a non-success HTTP status code response from the service. The exception's `status_code` will be the HTTP response status code. The exception's `error.message` contains a detailed message that will allow you to diagnose the issue:

  ```python
  try:
      result = client.analyze( ... )
  except HttpResponseError as e:
      print(f"Status code: {e.status_code}")
      print(f"Reason: {e.reason}")
      print(f"Message: {e.error.message}")
  ```

  For example, when you provide a wrong authentication key:
  ```
  Status code: 401
  Reason: PermissionDenied
  Message: Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.
  ```

  Or when you provide an image URL that does not exist or not accessible:
  ```
  Status code: 400
  Reason: Bad Request
  Message: The provided image url is not accessible.
  ```



  The client uses the standard [Python logging library](https://docs.python.org/3/library/logging.html). The SDK logs HTTP request and response details, which may be useful in troubleshooting. To log to stdout, add the following:

  <!-- SNIPPET:sample_analyze_all_image_file.logging -->

  ```python
  import sys
  import logging



  logger = logging.getLogger("azure")


  logger.setLevel(logging.INFO)


  handler = logging.StreamHandler(stream=sys.stdout)


  logger.addHandler(handler)


  formatter = logging.Formatter("s:s:s:s")
  handler.setFormatter(formatter)
  ```

  <!-- END SNIPPET -->

  By default logs redact the values of URL query strings, the values of some HTTP request and response headers (including `Ocp-Apim-Subscription-Key` which holds the key), and the request and response payloads. To create logs without redaction, set the method argument `logging_enable = True` when you create `ImageAnalysisClient`, or when you call `analyze` on the client.

  <!-- SNIPPET:sample_analyze_all_image_file.create_client_with_logging -->

  ```python

  client = ImageAnalysisClient(
      endpoint=endpoint,
      credential=AzureKeyCredential(key),
      logging_enable=True
  )
  ```

  <!-- END SNIPPET -->

  None redacted logs are generated for log level `logging.DEBUG` only. Be sure to protect none redacted logs to avoid compromising security. For more information see [Configure logging in the Azure libraries for Python](https://aka.ms/azsdk/python/logging)




  * Have a look at the [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/vision/azure-ai-vision-imageanalysis/samples) folder, containing fully runnable Python code for Image Analysis (all visual features, synchronous and asynchronous clients, from image file or URL).



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct). For more information,
  see the Code of Conduct FAQ or contact opencode@microsoft.com with any
  additional questions or comments.


  <!-- Note: I did not use LINKS section here with a list of `[link-label](link-url)` because these
  links don't work in the Sphinx generated documentation. The index.html page of these docs
  include this README, but with broken links.-->


pkgId: 69f91c358a88f64a6f41969624e0625e082d55b0c80adbcd931396795df73759
name: python-azure-appconfiguration
arch: src
version: 1.7.1
epoch: 0
release: 1
summary: Microsoft App Configuration Data Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/appconfiguration/azure-appconfiguration
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-appconfiguration-1.7.1-1.src.rpm
checksum_type: sha256
description:
  Azure App Configuration is a managed service that helps developers centralize their application configurations simply and securely.

  Modern programs, especially programs running in a cloud, generally have many components that are distributed in nature. Spreading configuration settings across these components can lead to hard-to-troubleshoot errors during an application deployment. Use App Configuration to securely store all the settings for your application in one place.

  Use the client library for App Configuration to create and manage application configuration settings.

  [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration)
  | [Package (Pypi)][package]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-appconfiguration/)
  | [API reference documentation](https://learn.microsoft.com/python/api/azure-appconfiguration/azure.appconfiguration?view=azure-python)
  | [Product documentation][appconfig_docs]





  Install the Azure App Configuration client library for Python with pip:

  ```
  pip install azure-appconfiguration
  ```



  * Python 3.8 or later is required to use this package.
  * You need an [Azure subscription][azure_sub], and a [Configuration Store][configuration_store] to use this package.

  To create a Configuration Store, you can use the Azure Portal or [Azure CLI][azure_cli].

  After that, create the Configuration Store:

  ```Powershell
  az appconfig create --name <config-store-name> --resource-group <resource-group-name> --location eastus
  ```



  In order to interact with the App Configuration service, you'll need to create an instance of the
  [AzureAppConfigurationClient][configuration_client_class] class. To make this possible,
  you can either use the connection string of the Configuration Store or use an AAD token.





  Use the [Azure CLI][azure_cli] snippet below to get the connection string from the Configuration Store.

  ```Powershell
  az appconfig credential list --name <config-store-name>
  ```

  Alternatively, get the connection string from the Azure Portal.



  Once you have the value of the connection string, you can create the AzureAppConfigurationClient:

  <!-- SNIPPET:hello_world_sample.create_app_config_client -->

  ```python
  import os
  from azure.appconfiguration import AzureAppConfigurationClient

  CONNECTION_STRING = os.environ["APPCONFIGURATION_CONNECTION_STRING"]


  client = AzureAppConfigurationClient.from_connection_string(CONNECTION_STRING)
  ```

  <!-- END SNIPPET -->



  Here we demonstrate using [DefaultAzureCredential][default_cred_ref]
  to authenticate as a service principal. However, [AzureAppConfigurationClient][configuration_client_class]
  accepts any [azure-identity][azure_identity] credential. See the
  [azure-identity][azure_identity] documentation for more information about other
  credentials.


  This [Azure CLI][azure_cli] snippet shows how to create a
  new service principal. Before using it, replace "your-application-name" with
  the appropriate name for your service principal.

  Create a service principal:
  ```Bash
  az ad sp create-for-rbac --name http://my-application --skip-assignment
  ```

  > Output:
  > ```json
  > {
  >     "appId": "generated app id",
  >     "displayName": "my-application",
  >     "name": "http://my-application",
  >     "password": "random password",
  >     "tenant": "tenant id"
  > }
  > ```

  Use the output to set **AZURE_CLIENT_ID** ("appId" above), **AZURE_CLIENT_SECRET**
  ("password" above) and **AZURE_TENANT_ID** ("tenant" above) environment variables.
  The following example shows a way to do this in Bash:
  ```Bash
  export AZURE_CLIENT_ID="generated app id"
  export AZURE_CLIENT_SECRET="random password"
  export AZURE_TENANT_ID="tenant id"
  ```

  Assign one of the applicable [App Configuration roles](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-authorization-azure-ad) to the service principal.


  Once the **AZURE_CLIENT_ID**, **AZURE_CLIENT_SECRET** and
  **AZURE_TENANT_ID** environment variables are set,
  [DefaultAzureCredential][default_cred_ref] will be able to authenticate the
  [AzureAppConfigurationClient][configuration_client_class].

  Constructing the client also requires your configuration store's URL, which you can
  get from the Azure CLI or the Azure Portal. In the Azure Portal, the URL can be found listed as the service "Endpoint"

  ```python
  from azure.identity import DefaultAzureCredential
  from azure.appconfiguration import AzureAppConfigurationClient

  credential = DefaultAzureCredential()

  client = AzureAppConfigurationClient(base_url="your_endpoint_url", credential=credential)
  ```





  A Configuration Setting is the fundamental resource within a Configuration Store. In its simplest form it is a key and a value. However, there are additional properties such as the modifiable content type and tags fields that allow the value to be interpreted or associated in different ways.

  The [Label][label_concept] property of a Configuration Setting provides a way to separate Configuration Settings into different dimensions. These dimensions are user defined and can take any form. Some common examples of dimensions to use for a label include regions, semantic versions, or environments. Many applications have a required set of configuration keys that have varying values as the application exists across different dimensions.

  For example, MaxRequests may be 100 in "NorthAmerica", and 200 in "WestEurope". By creating a Configuration Setting named MaxRequests with a label of "NorthAmerica" and another, only with a different value, in the "WestEurope" label, an application can seamlessly retrieve Configuration Settings as it runs in these two dimensions.

  Properties of a Configuration Setting:

  ```python
  key : str
  label : str
  content_type : str
  value : str
  last_modified : str
  read_only : bool
  tags : dict
  etag : str
  ```



  Azure App Configuration allows users to create a point-in-time snapshot of their configuration store, providing them with the ability to treat settings as one consistent version. This feature enables applications to hold a consistent view of configuration, ensuring that there are no version mismatches to individual settings due to reading as updates were made. Snapshots are immutable, ensuring that configuration can confidently be rolled back to a last-known-good configuration in the event of a problem.



  The following sections provide several code snippets covering some of the most common Configuration Service tasks, including:

  * [Create a Configuration Setting](#create-a-configuration-setting)
  * [Get a Configuration Setting](#get-a-configuration-setting)
  * [Delete a Configuration Setting](#delete-a-configuration-setting)
  * [List Configuration Settings](#list-configuration-settings)
  * [Create a Snapshot](#create-a-snapshot)
  * [Get a Snapshot](#get-a-snapshot)
  * [Archive a Snapshot](#archive-a-snapshot)
  * [Recover a Snapshot](#recover-a-snapshot)
  * [List Snapshots](#list-snapshots)
  * [List Configuration Settings of a Snapshot](#list-configuration-settings-of-a-snapshot)
  * [Async APIs](#async-apis)



  Create a Configuration Setting to be stored in the Configuration Store.
  There are two ways to store a Configuration Setting:

  - add_configuration_setting creates a setting only if the setting does not already exist in the store.

  <!-- SNIPPET:hello_world_sample.create_config_setting -->

  ```python
  config_setting = ConfigurationSetting(
      key="MyKey", label="MyLabel", value="my value", content_type="my content type", tags={"my tag": "my tag value"}
  )
  added_config_setting = client.add_configuration_setting(config_setting)
  ```

  <!-- END SNIPPET -->

  - set_configuration_setting creates a setting if it doesn't exist or overrides an existing setting.

  <!-- SNIPPET:hello_world_sample.set_config_setting -->

  ```python
  added_config_setting.value = "new value"
  added_config_setting.content_type = "new content type"
  updated_config_setting = client.set_configuration_setting(added_config_setting)
  ```

  <!-- END SNIPPET -->



  - Set a configuration setting to be read-only.

  <!-- SNIPPET:read_only_sample.set_read_only -->

  ```python
  read_only_config_setting = client.set_read_only(updated_config_setting)
  ```

  <!-- END SNIPPET -->

  - Clear read-only for a configuration setting.

  <!-- SNIPPET:read_only_sample.clear_read_only -->

  ```python
  read_write_config_setting = client.set_read_only(updated_config_setting, False)
  ```

  <!-- END SNIPPET -->



  Get a previously stored Configuration Setting.

  <!-- SNIPPET:hello_world_sample.get_config_setting -->

  ```python
  fetched_config_setting = client.get_configuration_setting(key="MyKey", label="MyLabel")
  ```

  <!-- END SNIPPET -->



  Delete an existing Configuration Setting.

  <!-- SNIPPET:hello_world_sample.delete_config_setting -->

  ```python
  client.delete_configuration_setting(key="MyKey", label="MyLabel")
  ```

  <!-- END SNIPPET -->



  List all configuration settings filtered with label_filter and/or key_filter and/or tags_filter.

  <!-- SNIPPET:list_configuration_settings_sample.list_configuration_settings -->

  ```python
  config_settings = client.list_configuration_settings(key_filter="MyKey*", tags_filter=["my tag1=my tag1 value"])
  for config_setting in config_settings:
      print(config_setting)
  ```

  <!-- END SNIPPET -->



  List revision history of configuration settings filtered with label_filter and/or key_filter and/or tags_filter.

  <!-- SNIPPET:list_revision_sample.list_revisions -->

  ```python
  items = client.list_revisions(key_filter="MyKey", tags_filter=["my tag=my tag value"])
  for item in items:
      print(item)
  ```

  <!-- END SNIPPET -->



  List labels of all configuration settings.

  <!-- SNIPPET:list_labels_sample.list_labels -->

  ```python
  print("List all labels in resource")
  config_settings = client.list_labels()
  for config_setting in config_settings:
      print(config_setting)

  print("List labels by exact match")
  config_settings = client.list_labels(name="my label1")
  for config_setting in config_settings:
      print(config_setting)

  print("List labels by wildcard")
  config_settings = client.list_labels(name="my label*")
  for config_setting in config_settings:
      print(config_setting)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.create_snapshot -->

  ```python
  from azure.appconfiguration import ConfigurationSettingsFilter

  filters = [ConfigurationSettingsFilter(key="my_key1", label="my_label1")]
  response = client.begin_create_snapshot(name=snapshot_name, filters=filters)
  created_snapshot = response.result()
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.get_snapshot -->

  ```python
  received_snapshot = client.get_snapshot(name=snapshot_name)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.archive_snapshot -->

  ```python
  archived_snapshot = client.archive_snapshot(name=snapshot_name)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.recover_snapshot -->

  ```python
  recovered_snapshot = client.recover_snapshot(name=snapshot_name)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.list_snapshots -->

  ```python
  for snapshot in client.list_snapshots():
      print(snapshot)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:snapshot_sample.list_configuration_settings_for_snapshot -->

  ```python
  for config_setting in client.list_configuration_settings(snapshot_name=snapshot_name):
      print(config_setting)
  ```

  <!-- END SNIPPET -->



  Async client is supported.
  To use the async client library, import the AzureAppConfigurationClient from package azure.appconfiguration.aio instead of azure.appconfiguration.

  <!-- SNIPPET:hello_world_sample_async.create_app_config_client -->

  ```python
  import os
  from azure.appconfiguration.aio import AzureAppConfigurationClient

  CONNECTION_STRING = os.environ["APPCONFIGURATION_CONNECTION_STRING"]


  client = AzureAppConfigurationClient.from_connection_string(CONNECTION_STRING)
  ```

  <!-- END SNIPPET -->

  This async AzureAppConfigurationClient has the same method signatures as the sync ones except that they're async.\
  For instance, retrieve a Configuration Setting asynchronously:

  <!-- SNIPPET:hello_world_sample_async.get_config_setting -->

  ```python
  fetched_config_setting = await client.get_configuration_setting(key="MyKey", label="MyLabel")
  ```

  <!-- END SNIPPET -->

  To list configuration settings, call `list_configuration_settings` operation synchronously and iterate over the returned async iterator asynchronously:

  <!-- SNIPPET:list_configuration_settings_sample_async.list_configuration_settings -->

  ```python
  config_settings = client.list_configuration_settings(key_filter="MyKey*", tags_filter=["my tag1=my tag1 value"])
  async for config_setting in config_settings:
      print(config_setting)
  ```

  <!-- END SNIPPET -->



  See the [troubleshooting guide][troubleshooting_guide] for details on how to diagnose various failure scenarios.





  Several App Configuration client library samples are available to you in this GitHub repository.  These include:
  - [Hello world](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py)
  - [List configuration settings](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_configuration_settings_sample_async.py)
  - [Make a configuration setting readonly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/read_only_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/hello_world_sample_async.py)
  - [Read revision history](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/list_revision_sample_async.py)
  - [Get a setting if changed](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/conditional_operation_sample_async.py)
  - [Create, retrieve and update status of a configuration settings snapshot](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/snapshot_sample_async.py)
  - [Send custom HTTP requests](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/send_request_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/send_request_sample_async.py)
  - [Update AzureAppConfigurationClient sync_token](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/sync_token_sample.py) / [Async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/sync_token_sample_async.py)

   For more details see the [samples README](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/samples/README.md).



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any
  additional questions or comments.

  <!-- LINKS -->
  [appconfig_docs]: https://docs.microsoft.com/azure/azure-app-configuration/
  [appconfig_rest]: https://github.com/Azure/AppConfiguration#rest-api-reference
  [azure_cli]: https://docs.microsoft.com/cli/azure
  [azure_sub]: https://azure.microsoft.com/free/
  [configuration_client_class]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py
  [package]: https://pypi.org/project/azure-appconfiguration/
  [configuration_store]: https://azure.microsoft.com/services/app-configuration/
  [default_cred_ref]: https://aka.ms/azsdk-python-identity-default-cred-ref
  [azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
  [cla]: https://cla.microsoft.com
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  [coc_contact]: mailto:opencode@microsoft.com
  [troubleshooting_guide]: https://aka.ms/azsdk/python/appconfiguration/troubleshoot
  [label_concept]: https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value#label-keys







  - Fixed a bug in serializing/deserializing tags filter in `ConfigurationSnapshot`.




  - Added operation `list_labels()` for listing configuration setting labels.
  - Supported filtering by configuration setting tags in `list_configuration_settings()` and `list_revisions()`.
  - Added a new property tags to ConfigurationSettingsFilter to support filtering settings with tags filter for snapshot.


  - Fixed a bug where the `feature_id` of `FeatureFlagConfigurationSetting` will be different from `id` customer field, and may overwrite the original customer-defined value if different from the `FeatureFlagConfigurationSetting` key suffix.


  - Updated the default `api_version` to "2023-11-01".
  - Published enum `LabelFields` and model `ConfigurationSettingLabel`.
  - Published enum `SnapshotFields`, and accepted the type for `fields` parameter in `get_snapshot()` and `list_snapshots()`.
  - Published enum `ConfigurationSettingFields`, and accepted the type for `fields` parameter in `list_configuration_settings()` and `list_revisions()`.
  - Published enum `SnapshotComposition`, and accepted the type for `ConfigurationSnapshot` property `composition_type` and `begion_create_snapshot()` kwarg `composition_type`.




  - Exposed `send_request()` method in each client to send custom requests using the client's existing pipeline.
  - Supported to get page ETag while iterating `list_configuration_setting()` result by page.


  - Fixed a bug in consuming "etag" value in sync operation `set_configuration_setting()`.
  - Changed invalid default value `None` to `False` for property `enabled` in `FeatureFlagConfigurationSetting`.
  - Fixed the issue that `description`, `display_name` and other customer fields are missing when de/serializing `FeatureFlagConfigurationSetting` objects.




  - Changed invalid default value `None` to `False` for property `enabled` in `FeatureFlagConfigurationSetting`.
  - Fixed the issue that `description`, `display_name` and other customer fields are missing when de/serializing `FeatureFlagConfigurationSetting` objects.




  - Exposed `send_request()` method in each client to send custom requests using the client's existing pipeline.
  - Supported to get page ETag while iterating `list_configuration_setting()` result by page.


  - Fixed a bug in consuming "etag" value in sync operation `set_configuration_setting()`.




  - Supported datetime type for keyword argument `accept_datetime` in `get_snapshot_configuration_settings()`, `list_snapshot_configuration_settings()` and `list_revisions()`.
  - Bumped minimum dependency on `azure-core` to `>=1.28.0`.
  - Updated the default `api_version` to "2023-10-01".
  - Removed `etag` keyword documentation in `set_read_only()` as it's not in use.
  - Added support for Python 3.12.
  - Python 3.7 is no longer supported. Please use Python version 3.8 or later.




  - Renamed parameter `name` in `list_snapshot_configuration_settings()` to `snapshot_name`.
  - Removed keyword argument `accept_datetime` in `list_snapshot_configuration_settings()`.
  - Moved operation `list_snapshot_configuration_settings()` to an overload of `list_configuration_settings()`, and moved the parameter `snapshot_name` to keyword.
  - Published enum `SnapshotStatus`, and accepted the type for `status` parameter in `list_snapshots()` and `status` property in `Snapshot` model.
  - Renamed model `Snapshot` to `ConfigurationSnapshot`.
  - Renamed model `ConfigurationSettingFilter` to `ConfigurationSettingsFilter`.




  - Fixed a bug in deserializing and serializing Snapshot when `filters` property is `None`.
  - Fixed a bug when creating `FeatureFlagConfigurationSetting` from SDK but having an error in portal.([#31326](https://github.com/Azure/azure-sdk-for-python/issues/31326))




  - Added support for `Snapshot` CRUD operations.


  - Fixed async `update_sync_token()` to use async/await keywords.


  - Bumped minimum dependency on `azure-core` to `>=1.25.0`.
  - Updated the default `api_version` to "2022-11-01-preview".




  - Python 2.7 is no longer supported. Please use Python version 3.7 or later.
  - Bumped minimum dependency on `azure-core` to `>=1.24.0`.
  - Changed the default async transport from `AsyncioRequestsTransport` to the one used in current `azure-core` (`AioHttpTransport`). ([#26427](https://github.com/Azure/azure-sdk-for-python/issues/26427))
  - Dropped `msrest` requirement.
  - Added dependency `isodate` with version range `>=0.6.0`.




  - Fixed the issue that data was persisted according to an incorrect schema/in an incorrect format ([#20518](https://github.com/Azure/azure-sdk-for-python/issues/20518))

    `SecretReferenceConfigurationSetting` in 1.2.0 used "secret_uri" rather than "uri" as the schema keywords which
    broken inter-operation of `SecretReferenceConfigurationSetting` between SDK and the portal.

    Please:
    - Use 1.3.0+ for any `SecretReferenceConfigurationSetting` uses.
    - Call a get method for existing `SecretReferenceConfigurationSetting`s and set them back to correct the format.



  * Added `FeatureFlagConfigurationSetting` and `SecretReferenceConfigurationSetting` models
  * `AzureAppConfigurationClient` can now be used as a context manager.
  * Added `update_sync_token()` to update sync tokens from Event Grid notifications.




  - Added context manager functionality to the sync and async `AzureAppConfigurationClient`s.


  - Fixed a deserialization bug for `FeatureFlagConfigurationSetting` and `SecretReferenceConfigurationSetting`.





  - Added method `update_sync_token()` to include sync tokens from EventGrid notifications.
  - Added `SecretReferenceConfigurationSetting` type to represent a configuration setting that references a KeyVault Secret.
  - Added `FeatureFlagConfigurationSetting` type to represent a configuration setting that controls a feature flag.





  - Improved error message if Connection string secret has incorrect padding. ([#14140](https://github.com/Azure/azure-sdk-for-python/issues/14140))





  - Added match condition support for `set_read_only()` method. ([#13276](https://github.com/Azure/azure-sdk-for-python/issues/13276))





  - Doc & Sample fixes





  - Added AAD auth support. ([#8924](https://github.com/Azure/azure-sdk-for-python/issues/8924))



  - `list_configuration_settings()` & `list_revisions()` now take string key/label filter instead of keys/labels list. ([#9066](https://github.com/Azure/azure-sdk-for-python/issues/9066))





  - Added sync-token support. ([#8418](https://github.com/Azure/azure-sdk-for-python/issues/8418))



  - Combined set_read_only & clear_read_only to be set_read_only(True/False). ([#8453](https://github.com/Azure/azure-sdk-for-python/issues/8453))





  - `etag` and `match_condition` of `delete_configuration_setting()` are now keyword argument only. ([#8161](https://github.com/Azure/azure-sdk-for-python/issues/8161))



  - Added conditional operation support
  - Added `set_read_only()` and `clear_read_only()` methods



  - New azure app configuration


pkgId: 24a806a38b64b36625720d36aa42259d03bb0747cf9c38aabefdbabb5b6f03e8
name: python-azure-appconfiguration-provider
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: Microsoft App Configuration Provider Library for Python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-appconfiguration-provider-1.3.0-1.src.rpm
checksum_type: sha256
description:
  Azure App Configuration is a managed service that helps developers centralize their application configurations simply and securely. This provider adds additional functionality above the azure-sdk-for-python.

  Using the provider enables loading sets of configurations from an Azure App Configuration store in a managed way.





  Use the [Azure CLI][azure_cli] snippet below to get the connection string from the Configuration Store.

  ```Powershell
  az appconfig credential list --name <config-store-name>
  ```

  Alternatively, get the connection string from the Azure Portal.



  You can create a client with a connection string:

  ```python
  from azure.appconfiguration.provider import load

  config = load(connection_string="your-connection-string")
  ```

  or with AAD:

  ```python
  from azure.appconfiguration.provider import load

  config = load(endpoint="your-endpoint", credential=DefaultAzureCredential())
  ```

  these providers will by default load all configurations with `(No Label)` from your configuration store into a dictionary of key/values.



  Currently the Azure App Configuration Provider enables:

  * Connecting to an App Configuration Store using a connection string or Azure Active Directory.
  * Selecting multiple sets of configurations using `SettingSelector`.
  * Loading Feature Flags
  * Dynamic Refresh
  * Geo-Replication support
  * Trim prefixes off key names.
  * Resolving Key Vault References, requires AAD.
  * Secret Resolver, resolve Key Vault References locally without connecting to Key Vault.
  * Json Content Type



  List of features we are going to add to the Python Provider in the future.

  * Configuration Placeholders





  You can refine or expand the configurations loaded from your store by using `SettingSelector`s. Setting selectors provide a way to pass a key filter and label filter into the provider.

  ```python
  from azure.appconfiguration.provider import load, SettingSelector
  from azure.identity import DefaultAzureCredential

  selects = {SettingSelector(key_filter="*", label_filter="\0"), SettingSelector(key_filter="*", label_filter="dev")}
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), selects=selects)
  ```

  In this example all configuration with empty label and the dev label are loaded. Because the dev selector is listed last, any configurations from dev take priority over those with `(No Label)` when duplicates are found.



  The provider can be configured to refresh configurations from the store on a set interval. This is done by providing a `refresh_on` to the provider, which is a list of key(s) that will be watched for changes, and when they do change a refresh can happen. `refresh_interval` is the period of time in seconds between refreshes. `on_refresh_success` is a callback that will be called only if a change is detected and no error happens. `on_refresh_error` is a callback that will be called when a refresh fails.

  ```python
  from azure.appconfiguration.provider import load, WatchKey
  import os

  connection_string = os.environ.get("APPCONFIGURATION_CONNECTION_STRING")

  def my_callback_on_success():
      
      ...

  def my_callback_on_fail(error):
      
      ...

  config = load(
      connection_string=connection_string,
      refresh_on=[WatchKey("Sentinel")],
      refresh_interval=60,
      on_refresh_success=my_callback_on_success,
      on_refresh_error=my_callback_on_fail,
      **kwargs,
  )
  ```

  In this example, the sentinel key will be checked for changes no sooner than every 60 seconds. In order to check for changes, the provider's `refresh` method needs to be called.

  ```python
  config.refresh()
  ```

  Once the provider is refreshed, the configurations can be accessed as normal. And if any changes have been made it will be updated with the latest values. If the `refresh_interval` hasn't passed since the last refresh check, the provider will not check for changes.

  For additional info check out [Dynamic Refresh](https://learn.microsoft.com/azure/azure-app-configuration/enable-dynamic-configuration-python) on MS Learn.



  You can trim the prefix off of keys by providing a list of trimmed key prefixes to the provider. For example, if you have the key(s) like `/application/message` in your configuration store, you could trim `/application/` from them.

  ```python
  from azure.appconfiguration.provider import load
  from azure.identity import DefaultAzureCredential

  trim_prefixes={"/application/"}
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), trim_prefixes=trim_prefixes)
  print(config["message"])
  ```



  Key Vault References can be resolved by providing credentials to your key vault to the provider using `AzureAppConfigurationKeyVaultOptions`.



  You can provide `AzureAppConfigurationKeyVaultOptions` with a credential and all key vault references will be resolved with it. The provider will attempt to connect to any key vault referenced with the credential provided.

  ```python
  from azure.appconfiguration.provider import load, AzureAppConfigurationKeyVaultOptions
  from azure.identity import DefaultAzureCredential

  key_vault_options = AzureAppConfigurationKeyVaultOptions(credential=DefaultAzureCredential())
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), key_vault_options=key_vault_options)
  ```



  You can provide `AzureAppConfigurationKeyVaultOptions` with a list of `SecretClients`.

  ```python
  from azure.appconfiguration.provider import load, AzureAppConfigurationKeyVaultOptions
  from azure.identity import DefaultAzureCredential

  key_vault_options = AzureAppConfigurationKeyVaultOptions(
      client_configs={key_vault_uri: {'credential': credential}})
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), key_vault_options=key_vault_options)
  ```



  If no Credentials or Clients are provided a secret resolver can be used. Secret resolver provides a way to return any value you want to a key vault reference.

  ```python
  from azure.appconfiguration.provider import load, AzureAppConfigurationKeyVaultOptions
  from azure.identity import DefaultAzureCredential

  def secret_resolver(uri):
      return "From Secret Resolver"

  key_vault_options = AzureAppConfigurationKeyVaultOptions(
      secret_resolver=secret_resolver)
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), key_vault_options=key_vault_options)
  ```



  The Azure App Configuration Provider library will automatically discover the provided configuration store's replicas and use the replicas if any issue arises. From more information see [Geo-Replication](https://learn.microsoft.com/azure/azure-app-configuration/howto-geo-replication).

  Replica discovery is enabled by default. If you want to disable it, you can set `replica_discovery_enabled` to `False`.

  ```python
  from azure.appconfiguration.provider import load
  from azure.identity import DefaultAzureCredential

  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), replica_discovery_enabled=False)
  ```



  Feature Flags can be loaded from config stores using the provider. Feature flags are loaded as a dictionary of key/value pairs stored in the provider under the `feature_management`, then `feature_flags`.

  ```python
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), feature_flags_enabled=True)
  alpha = config["feature_management"]["feature_flags"]["Alpha"]
  print(alpha["enabled"])
  ```

  By default all feature flags with no label are loaded when `feature_flags_enabled` is set to `True`. . If you want to load feature flags with a specific label you can use `SettingSelector` to filter the feature flags.

  ```python
  from azure.appconfiguration.provider import load, SettingSelector

  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), feature_flags_enabled=True, feature_flag_selectors=[SettingSelector(key_filter="*", label_filter="dev")])
  alpha = config["feature_management"]["feature_flags"]["Alpha"]
  print(alpha["enabled"])
  ```

  To enable refresh for feature flags you need to enable refresh. This will allow the provider to refresh feature flags the same way it refreshes configurations. Unlike configurations, all loaded feature flags are monitored for changes and will cause a refresh. Refresh of configuration settings and feature flags are independent of each other. Both are trigged by the `refresh` method, but a feature flag changing will not cause a refresh of configurations and vice versa. Also, if refresh for configuration settings is not enabled, feature flags can still be enabled for refresh.

  ```python
  config = load(endpoint=endpoint, credential=DefaultAzureCredential(), feature_flags_enabled=True, feature_flag_refresh_enabled=True)

  ...

  config.refresh()
  ```







  Check out our Django and Flask examples to see how to use the provider in a web application.







  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit <https://cla.microsoft.com>.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the Code of Conduct FAQ or contact <opencode@microsoft.com> with any
  additional questions or comments.

  [azure_cli]: https://learn.microsoft.com/cli/azure/appconfig
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/








  * Added support for auto failover between replicas.
  * Added support for auto discovery of replicas.





  * Enable loading of feature flags with `feature_flag_enabled`
  * Select Feature Flags to load with `feature_flag_selectors`
  * Enable/Disable Feature Flag Refresh with `feature_flag_refresh_enabled`



  * Fixes issue where loading configurations were slower due to returning a copy of the configurations.





  * New API for Azure App Configuration Provider, `refresh`, which can be used to refresh the configuration from the Azure App Configuration service. `refresh` by default can check every 30 seconds for changes to specified sentinel keys. If a change is detected then all configurations are reloaded. Sentinel keys can be set by passing a list of `SentinelKey`'s to `refresh_on`.
  * Added new options `on_refresh_success` and `on_refresh_failure` callbacks to the load method. These callbacks are called when the refresh method successfully refreshes the configuration or fails to refresh the configuration.



  * Verifies that the `refresh_interval` is at least 1 second.





  - Added on_refresh_success callback to load method. This callback is called when the refresh method successfully refreshes the configuration.
  - Added minimum up time. This is the minimum amount of time the provider will try to be up before throwing an error. This is to prevent quick restart loops.



  - Fixes issue where the refresh timer only reset after a change was found.



  - Renamed the type `SentinelKey` to be `WatchKey`.





  * Added support for `keyvault_credential`, `keyvault_client_configs`, and `secret_resolver` as `kwargs` instead of using `AzureAppConfigurationKeyVaultOptions`.



  * Fixes issue where `user_agent` was required to be set.
  * Fixes issue where correlation context info is wrong on refresh.





  * New API for Azure App Configuration Provider, `refresh`, which can be used to refresh the configuration from the Azure App Configuration service. `refresh` by default can check every 30 seconds for changes to specified sentinel keys. If a change is detected then all configurations are reloaded. Sentinel keys can be set by passing  a list of `SentinelKey`'s to `refresh_on`.
  * Added support for customer provided user agent prefix.



  * Updated to use AZURE_APP_CONFIGURATION_TRACING_DISABLED environment variable to disable tracing.
  * Changed the maximum number of retries to 2 from the default of 3 retries.
  * Changed the maximum back off time between retries to 1 minute from the default of 2 minutes.
  * Bumped minimum dependency on `azure-core` to `>=1.25.0`




  * Renamed `load_provider` to `load`
  * Added `AzureAppConfigurationKeyVaultOptions` to take in a `client_configs` a Mapping of endpoints to client kwargs instead of taking in the whole client.
  * Removed `AzureAppConfigurationKeyVaultOptions` `secret_clients`, `client_configs` should be used instead.
  * Made key_filter and label_filter kwargs for Setting Selector
  * Renamed `trimmed_key_prefixes` to `trim_prefixes`


  * Made EMPTY_LABEL a constant. i.e. "\0"




  * Added Async Support
  * Added missing methods for Mapping API
  * Made load method properties unordered.


  * Changes how load works. Moves if from AzureAppConfigurationProvider.load to load_provider.
  * Removed custom Key Vault Error
  * Removed unneeded __repr__ and copy methods.
  * All Feature Flags are added to there own key and have there prefix removed


  * Fixed Issue where Key Vault Clients couldn't be set in some situations


  * Updated method docs
  * Fixed load doc that used `selector` instead of `selects`.
  * Fixed CLI link in Readme.



  New Azure App Configuration Provider

  Provides additional support above the Azure App Configuration SDK. Enables:
  * Connecting to an Azure App Configuration store
  * Selecting multiple keys using Setting Selector
  * Resolve Key Vault References when supplied AzureAppConfigurationKeyVaultOptions

  The Azure App Configuration Provider once loaded returns a dictionary of key/value pairs to use in configuration.

  ```python
  endpoint = "https://<your-store>.azconfig.io"
  default_credential = DefaultAzureCredential()
  config = AzureAppConfigurationProvider.load(
      endpoint=endpoint, credential=default_credential)
  print(config["message"])
  ```

url:
  https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/appconfiguration/azure-appconfiguration-provider


pkgId: 4f0142251cf445af20cd1ae08f791da3faa30e979e36cc78eb35bbd7e5886509
name: python-azure-applicationinsights
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Microsoft Azure Application Insights Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-applicationinsights-0.1.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Use the [azure-monitor-query](https://pypi.org/project/azure-monitor-query/) package instead.

  For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/ai-to-monitor-query).





  * This package is no longer maintained. Use the [azure-monitor-query](https://pypi.org/project/azure-monitor-query/) package instead.



  - Initial Release


pkgId: 0d4538c9c78f9fba97039407111366f80e29b6382b0c9bd8a5c330d6f45e955f
name: python-azure-batch
arch: src
version: 14.2.0
epoch: 0
release: 1
summary: Microsoft Azure Batch Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-batch-14.2.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Batch Client Library.

  This package has been tested with Python 3.6+

  For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all



  For code examples, see [the Batch samples repo](https://github.com/Azure/azure-batch-samples/tree/master/Python)
  on GitHub or see [Batch](https://docs.microsoft.com/python/api/overview/azure/batch)
  on docs.microsoft.com.




  If you encounter any bugs or have suggestions, please file an issue in the
  [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
  section of the project.


  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-batch%2FREADME.png)








  - Added `UpgradePolicy` to `CloudPool` definition for pool creation
    - Added `AutomaticOSUpgradePolicy` to include configuration parameters for automatic OS upgrades
    - Added `RollingUpgradePolicy` to include configuration parameters for rolling upgrades





  - Added ResourceTags support to Pool Creation so users are able to specify resource tags for a pool. This feature is currently only supported for pool creation but will be updatable in the future.
    - Added `resourceTags` property to `PoolSpecification` definition
    - Added `resourceTags` property to `CloudPool` definition

  - Added `SecurityProfile` support to Pool Creation. Trusted Launch provides advanced security to Guest OS preventing boot-kits/rootkits (like un-signed driver or kernel modification) to be introduced into boot-chain.
    - Added `serviceArtifactReference` and `securityProfile` property to `VirtualMachineConfiguration` definition

  - Added `ServiceArtifactReference` and `OSDisk` support to Pool Creation
    - Added `standardssd_lrs` value to `StorageAccountType` enum
    - Added `caching`, `managedDisk`, `diskSizeGB`, and `writeAcceleratorEnabled` property to `NodePlacementPolicyType` definition
    - Added `scaleSetVmResourceID` property to `VirtualMachineInfo` definition





  - Added boolean property `enableAcceleratedNetworking` to `NetworkConfiguration`.
    - This property determines whether this pool should enable accelerated networking, with default value as False.
    - Whether this feature can be enabled is also related to whether an operating system/VM instance is supported, which should align with AcceleratedNetworking Policy ([AcceleratedNetworking Limitations and constraints](https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview?tabs=redhat#limitations-and-constraints)).
  - Added boolean property `enableAutomaticUpgrade` to `VMExtension`.
    - This property determines whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
  - Added a new property `type` to `ContainerConfiguration`. Possible values include: `dockerCompatible` and `criCompatible`.



  - Removed lifetime statistics API. This API is no longer supported.
    - Removed `job.get_all_lifetime_statistics` API.
    - Removed `pool.get_all_lifetime_statistics` API.



  - Deprecating `CertificateOperations` related methods.
    - This operation is deprecating and will be removed after February 2024. Please use [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.





  - Added new custom enum type `NodeCommunicationMode`.
    - This property determines how a pool communicates with the Batch service.
    - Possible values: Default, Classic, Simplified.
  - Added properties `current_node_communication_mode` and `target_node_communication_mode` of type `NodeCommunicationMode` to `CloudPool`.
  - Added property `target_node_communication_mode` of type `NodeCommunicationMode` to `PoolSpecification`, `PoolAddParameter`, `PoolPatchParameter`, and `PoolUpdatePropertiesParameter`.





  - Added property uploadHeaders to `OutputFileBlobContainerDestination`.
    - Allows users to set custom HTTP headers on resource file uploads.
    - Array of type HttpHeader (also being added).
  - Added boolean property `allow_task_preemption` to `JobSpecification`, `CloudJob`, `JobAddParameter`, `JobPatchParameter`, `JobUpdateParameter`
    - Mark Tasks as preemptible for higher priority Tasks (requires Comms-Enabled or Single Tenant Pool).
  - Replaced comment (title, description, etc.) references of "low-priority" with "Spot/Low-Priority", to reflect new service behavior.
    - No API change required.
    - Low-Priority Compute Nodes (VMs) will continue to be used for User Subscription pools (and only User Subscription pools), as before.
    - Spot Compute Nodes (VMs) will now be used for Batch Managed (and only Batch Managed pools) pools.
    - Relevant docs:
      - https://docs.microsoft.com/azure/batch/nodes-and-pools
      - https://docs.microsoft.com/azure/batch/batch-spot-vms





  - Add ability to assign user-assigned managed identities to `CloudPool`. These identities will be made available on each node in the pool, and can be used to access various resources.
  - Added `identity_reference` property to the following models to support accessing resources via managed identity:
    - `AzureBlobFileSystemConfiguration`
    - `OutputFileBlobContainerDestination`
    - `ContainerRegistry`
    - `ResourceFile`
    - `UploadBatchServiceLogsConfiguration`
  - Added new `compute_node_extension` operations to `BatchServiceClient` for getting/listing VM extensions on a node
  - Added new `extensions` property to `VirtualMachineConfiguration` on `CloudPool` to specify virtual machine extensions for nodes
  - Added the ability to specify availability zones using a new property `node_placement_configuration` on `VirtualMachineConfiguration`
  - Added new `os_disk` property to `VirtualMachineConfiguration`, which contains settings for the operating system disk of the Virtual Machine.
    - The `placement` property on `DiffDiskSettings` specifies the ephemeral disk placement for operating system disks for all VMs in the pool. Setting it to "CacheDisk" will store the ephemeral OS disk on the VM cache.
  - Added `max_parallel_tasks` property on `CloudJob` to control the maximum allowed tasks per job (defaults to -1, meaning unlimited).
  - Added `virtual_machine_info` property on `ComputeNode` which contains information about the current state of the virtual machine, including the exact version of the marketplace image the VM is using.




  - **[Breaking]** Replaced property `maxTasksPerNode` with `taskSlotsPerNode` on the pool. Using this property tasks in a job can consume a dynamic amount of slots allowing for more fine-grained control over resource consumption.
  - **[Breaking]** Changed the response type of `GetTaskCounts` to return `TaskCountsResult`, which is a complex object containing the previous `TaskCounts` object and a new `TaskSlotCounts` object providing similar information in the context of slots being used.
  - Added property `requiredSlots` to the task allowing user to specify how many slots on a node it should take up.




  - Added ability to encrypt `ComputeNode` disk drives using the new `disk_encryption_configuration` property of `VirtualMachineConfiguration`.
  - **[Breaking]** The `virtual_machine_id` property of `ImageReference` can now only refer to a Shared Image Gallery image.
  - **[Breaking]** Pools can now be provisioned without a public IP using the new `public_ip_address_configuration` property of `NetworkConfiguration`.
    - The `public_ips` property of `NetworkConfiguration` has moved in to `public_ip_address_configuration` as well. This property can only be specified if `ip_provisioning_type` is `UserManaged`.


  This version of the Batch .NET client library targets version 2020-03-01.11.0 of the Azure Batch REST API.



  - Using REST API version 2019-08-01.10.0.
      * Added ability to specify a collection of public IPs on `NetworkConfiguration` via the new `public_ips` property. This guarantees nodes in the Pool will have an IP from the list user provided IPs.
      * Added ability to mount remote file-systems on each node of a pool via the `mount_configuration` property on `CloudPool`.
      * Shared Image Gallery images can now be specified on the `virtual_machine_image_id` property of `ImageReference` by referencing the image via its ARM ID.
      * **Breaking** When not specified, the default value for `wait_for_success` on `StartTask` is now `True` (was `False`).
      * **Breaking** When not specified, the default value for `scope` on `AutoUserSpecification` is now always `Pool` (was `Task` on Windows nodes, `Pool` on Linux nodes).



  - Using REST API version 2019-06-01.9.0.
      * **Breaking** Replaced `AccountOperations.list_node_agent_skus` with `AccountOperations.list_supported_images`. `list_supported_images` contains all of the same information originally available in `list_node_agent_skus` but in a clearer format. New non-verified images are also now returned. Additional information about `capabilities` and `batch_support_end_of_life` is accessible on the `ImageInformation` object returned by `list_supported_images`.
      * Now support network security rules blocking network access to a `CloudPool` based on the source port of the traffic. This is done via the `source_port_ranges` property on `network_security_group_rules`.
      * When running a container, Batch now supports executing the task in the container working directory or in the Batch task working directory. This is controlled by the `working_directory` property on `TaskContainerSettings`.



  - Fix bug in TaskOperations.add_collection methods exception handling



  - Using REST API version 2018-12-01.8.0.
      * **Breaking** Removed support for the `upgrade_os` API on `CloudServiceConfiguration` pools.
          - Removed `PoolOperations.upgrade_os` API.
          - Renamed `target_os_version` to `os_version` and removed `current_os_version` on `CloudServiceConfiguration`.
          - Removed `upgrading` state from `PoolState` enum.
      * **Breaking** Removed `data_egress_gi_b` and `data_ingress_gi_b` from `PoolUsageMetrics`. These properties are no longer supported.
      * **Breaking** ResourceFile improvements
          * Added the ability specify an entire Azure Storage container in `ResourceFile`. There are now three supported modes for `ResourceFile`:
              - `http_url` creates a `ResourceFile` pointing to a single HTTP URL.
              - `storage_container_url` creates a `ResourceFile` pointing to the blobs under an Azure Blob Storage container.
              - `auto_storage_container_name` creates a `ResourceFile` pointing to the blobs under an Azure Blob Storage container in the Batch registered auto-storage account.
          * URLs provided to `ResourceFile` via the `http_url` property can now be any HTTP URL. Previously, these had to be an Azure Blob Storage URL.
          * The blobs under the Azure Blob Storage container can be filtered by `blob_prefix` property.
      * **Breaking** Removed `os_disk` property from `VirtualMachineConfiguration`. This property is no longer supported.
      * Pools which set the `dynamic_vnet_assignment_scope` on `NetworkConfiguration` to be `DynamicVNetAssignmentScope.job` can now dynamically assign a Virtual Network to each node the job's tasks run on. The specific Virtual Network to join the nodes to is specified in the new `network_configuration` property on `CloudJob` and `JobSpecification`.
          - Note: This feature is in public preview. It is disabled for all Batch accounts except for those which have contacted us and requested to be in the pilot.
      * The maximum lifetime of a task is now 180 days (previously it was 7).
      * Added support on Windows pools for creating users with a specific login mode (either `batch` or `interactive`) via `WindowsUserConfiguration.login_mode`.
      * The default task retention time for all tasks is now 7 days, previously it was infinite.
  - **Breaking** Renamed the `base_url` parameter to `batch_url` on `BatchServiceClient` class, and it is required now.



  **Bugfixes**

  - Fix authentication class to allow HTTP session to be re-used

  **Note**

  - azure-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)



  - Update operation TaskOperations.add_collection with the following added functionality:
      + Retry server side errors.
      + Automatically chunk lists of more than 100 tasks to multiple requests.
      + If tasks are too large to be submitted in chunks of 100, reduces number of tasks per request.
      + Add a parameter to specify number of threads to use when submitting tasks.



  - Using REST API version 2018-08-01.7.0.
      + Added `node_agent_info` in ComputeNode to return the node agent information
      + **Breaking** Removed the `validation_status` property from `TaskCounts`.
      + **Breaking** The default caching type for `DataDisk` and `OSDisk` is now `read_write` instead of `none`.
  - `BatchServiceClient` can be used as a context manager to keep the underlying HTTP session open for performance.
  - **Breaking** Model signatures are now using only keywords-arguments syntax. Each positional argument must be rewritten as a keyword argument.
  - **Breaking** The following operations signatures are changed:
     + Operation PoolOperations.enable_auto_scale
     + Operation TaskOperations.update
     + Operation ComputeNodeOperations.reimage
     + Operation ComputeNodeOperations.disable_scheduling
     + Operation ComputeNodeOperations.reboot
     + Operation JobOperations.terminate
  - Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.



  - Update some APIs' comments
  - New property `leaving_pool` in `node_counts` type.



  **Bugfixes**

  - Compatibility of the sdist with wheel 0.31.0
  - Compatibility with msrestazure 0.4.28



  - Fix regression on method `enable_auto_scale`.



  - Using REST API version 2018-03-01.6.1.
  - Added the ability to query pool node counts by state, via the new `list_pool_node_counts` method.
  - Added the ability to upload Azure Batch node agent logs from a particular node, via the `upload_batch_service_logs` method.
     + This is intended for use in debugging by Microsoft support when there are problems on a node.



  - Using REST API version 2017-09-01.6.0.
  - Added the ability to get a discount on Windows VM pricing if you have on-premises licenses for the OS SKUs you are deploying, via `license_type` on `VirtualMachineConfiguration`.
  - Added support for attaching empty data drives to `VirtualMachineConfiguration` based pools, via the new `data_disks` attribute on `VirtualMachineConfiguration`.
  - **Breaking** Custom images must now be deployed using a reference to an ARM Image, instead of pointing to .vhd files in blobs directly.
      + The new `virtual_machine_image_id` property on `ImageReference` contains the reference to the ARM Image, and `OSDisk.image_uris` no longer exists.
      + Because of this, `image_reference` is now a required attribute of `VirtualMachineConfiguration`.
  - **Breaking** Multi-instance tasks (created using `MultiInstanceSettings`) must now specify a `coordination_commandLine`, and `number_of_instances` is now optional and defaults to 1.
  - Added support for tasks run using Docker containers. To run a task using a Docker container you must specify a `container_configuration` on the `VirtualMachineConfiguration` for a pool, and then add `container_settings` on the Task.



  - Added a new operation `job.get_task_counts` to retrieve the number of tasks in each state.
  - Added suuport for inbound endpoint configuration on a pool - there is a new `pool_endpoint_configuration` attribute on `NetworkConfiguration`.
    This property is only supported on pools that use `virtual_machine_configuration`.
  - A `ComputeNode` now also has an `endpoint_configuration` attribute with the details of the applied endpoint configuration for that node.



  - Added support for the new low-priority node type; `AddPoolParameter` and `PoolSpecification` now have an additional property `target_low_priority_nodes`.
  - `target_dedicated` and `current_dedicated` on `CloudPool`, `AddPoolParameter` and `PoolSpecification` have been renamed to `target_dedicated_nodes` and `current_dedicated_nodes`.
  - `resize_error` on `CloudPool` is now a collection called `resize_errors`.
  - Added a new `is_dedicated` property on `ComputeNode`, which is `false` for low-priority nodes.
  - Added a new `allow_low_priority_node` property to `JobManagerTask`, which if `true` allows the `JobManagerTask` to run on a low-priority compute node.
  - `PoolResizeParameter` now takes two optional parameters, `target_dedicated_nodes` and `target_low_priority_nodes`, instead of one required parameter `target_dedicated`.
    At least one of these two parameters must be specified.
  - Added support for uploading task output files to persistent storage, via the `OutputFiles` property on `CloudTask` and `JobManagerTask`.
  - Added support for specifying actions to take based on a task's output file upload status, via the `file_upload_error` property on `ExitConditions`.
  - Added support for determining if a task was a success or a failure via the new `result` property on all task execution information objects.
  - Renamed `scheduling_error` on all task execution information objects to `failure_information`. `TaskFailureInformation` replaces `TaskSchedulingError` and is returned any
    time there is a task failure. This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature.
  - Renamed `SchedulingErrorCategory` enum to `ErrorCategory`.
  - Renamed `scheduling_error` on `ExitConditions` to `pre_processing_error` to more clearly clarify when the error took place in the task life-cycle.
  - Added support for provisioning application licenses to your pool, via a new `application_licenses` property on `PoolAddParameter`, `CloudPool` and `PoolSpecification`.
    Please note that this feature is in gated public preview, and you must request access to it via a support ticket.
  - The `ssh_private_key` attribute of a `UserAccount` object has been replaced with an expanded `LinuxUserConfiguration` object with additional settings for a user ID and group ID of the
    user account.
  - Removed `unmapped` enum state from `AddTaskStatus`, `CertificateFormat`, `CertificateVisibility`, `CertStoreLocation`, `ComputeNodeFillType`, `OSType`, and `PoolLifetimeOption` as they were not ever used.
  - Improved and clarified documentation.



  - This wheel package is now built with the azure wheel extension



  - AAD token authentication now supported.
  - Some operation names have changed (along with their associated parameter model classes):
      * pool.list_pool_usage_metrics -> pool.list_usage_metrics
      * pool.get_all_pools_lifetime_statistics -> pool.get_all_lifetime_statistics
      * job.get_all_jobs_lifetime_statistics -> job.get_all_lifetime_statistics
      * file.get_node_file_properties_from_task -> file.get_properties_from_task
      * file.get_node_file_properties_from_compute_node -> file.get_properties_from_compute_node
  - The attribute 'file_name' in relation to file operations has been renamed to 'file_path'.
  - Change in naming convention for enum values to use underscores: e.g. StartTaskState.waitingforstarttask -> StartTaskState.waiting_for_start_task.
  - Support for running tasks under a predefined or automatic user account. This includes tasks, job manager tasks, job preparation and release tasks and pool start tasks. This feature replaces the previous 'run_elevated' option on a task.
  - Tasks now have an optional scoped authentication token (only applies to tasks and job manager tasks).
  - Support for creating pools with a list of user accounts.
  - Support for creating pools using a custom VM image (only supported on accounts created with a "User Subscription" pool allocation mode).



  - Added support for task reactivation



  - Added support for joining a CloudPool to a virtual network on using the network_configuration property.
  - Added support for application package references on CloudTask and JobManagerTask.
  - Added support for automatically terminating jobs when all tasks complete or when a task fails, via the on_all_tasks_complete property and
    the CloudTask exit_conditions property.



  - Initial Release


pkgId: 5bd7c8f4d41aec5463f838a97e705e0042c73679523cf9db1c2abd4f42b39036
name: python-azure-batch-extensions
arch: src
version: 9.0.0
epoch: 0
release: 1
summary: Microsoft Azure Batch Extended Features
url: https://github.com/Azure/azure-batch-cli-extensions
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-batch-extensions-9.0.0-1.src.rpm
checksum_type: sha256
description:
  This project is a preview build of the Microsoft Azure command-line interface to demonstrate proposed features in Azure Batch.
  For further details on the Azure CLI, please check the `official documentation <https://docs.microsoft.com/en-us/cli/azure/install-azure-cli>`_.
  The purpose of this project is to allow customers to try out proposed Batch features and provide feedback to help shape the direction of the Batch service.
  The features presented here may not be compatible with other Batch client SDKs and tools, nor will they necessarily be adopted into the core Batch service.
  As these features are still in preview, they will be updated regularly, and refined based on customer feedback.
  Unfortunately this may result in occasional breaking changes, though every effort will be made to keep this to a minimum.


pkgId: 9ba9b34412a3e0d2257a505c0c78cc36f621dbadc9498c6de9da9e9e5644f955
name: python-azure-cli
arch: src
version: 2.67.0
epoch: 0
release: 1
summary: Microsoft Azure Command-Line Tools
url: https://github.com/Azure/azure-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cli-2.67.0-1.src.rpm
checksum_type: sha256
description:
  A great cloud needs great tools; we're excited to introduce *Azure CLI*, our next generation multi-platform command line experience for Azure.


pkgId: cbeeb359a71e28607c859495d4e19a83cd58178c7e71e4e3439fed292b6ae147
name: python-azure-cli-command-modules-nspkg
arch: src
version: 2.0.3
epoch: 0
release: 1
summary: Microsoft Azure CLI Command Modules Namespace Package
url: https://github.com/Azure/azure-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cli-command-modules-nspkg-2.0.3-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure CLI command module namespace package.
  This package is not intended to be installed directly by the end user.
  It provides the necessary files for other packages to extend the azure cli command module namespaces.


pkgId: 2ae546fdeaf98dce4c3ad72d6066994b441556f6e884856e8576d9f8013f76b4
name: python-azure-cli-nspkg
arch: src
version: 3.0.4
epoch: 0
release: 1
summary: Microsoft Azure CLI Namespace Package
url: https://github.com/Azure/azure-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cli-nspkg-3.0.4-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure CLI namespace package.
  This package is not intended to be installed directly by the end user.
  It provides the necessary files for other packages to extend the azure cli namespaces.


pkgId: 0b16160c304cbd9ddbd814072ff844f422606aa5d40225e0a522115194a243c4
name: python-azure-cli-telemetry
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Microsoft Azure CLI Telemetry Package
url: https://github.com/Azure/azure-cli
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cli-telemetry-1.1.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure CLI Telemetry package. It is not intended to be installed directly by the end user.
  This package includes:
  1. Support API for Azure CLI to gather telemetry.
  2. Telemetry upload process.


pkgId: d982289e576afb0382daccc3806e868c74a76b17e84e5fce690b5f7586fdf938
name: python-azure-cognitiveservices-anomalydetector
arch: src
version: 0.3.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Anomaly Detector Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-anomalydetector-0.3.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Use the [azure-ai-anomalydetector](https://pypi.org/project/azure-ai-anomalydetector/) package instead for latest features and support.






  This package is no longer being maintained. Use the [azure-ai-anomalydetector](https://pypi.org/project/azure-ai-anomalydetector/) package instead for latest features and support.



  **Features**

    - Added `change_point_detect` method to the client.
    - Added new models `ChangePointDetectRequest` and `ChangePointDetectResponse`



  **Bugfixes**

    - Fix some syntax error in the initial release



    - Initial Release


pkgId: e5845eda799ef4bc1053a820114d0192b9c4cbb1adabc3454a0b55654dd73610
name: python-azure-cognitiveservices-knowledge-qnamaker
arch: src
version: 0.3.1
epoch: 0
release: 1
summary: Microsoft Azure QnA Maker Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-knowledge-qnamaker-0.3.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Use the [azure-ai-language-questionanswering](https://pypi.org/project/azure-ai-language-questionanswering/) package instead.

  For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/azure-ai-language-questionanswering).







  - This package is no longer being maintained. Use the [azure-ai-language-questionanswering](https://pypi.org/project/azure-ai-language-questionanswering/) package instead.

  - For migration instructions, see the [migration guide](https://aka.ms/azsdk/python/migrate/azure-ai-language-questionanswering).



  **Features**

  - `QnAMakerClient` now consolidates both authoring and runtime.
  - Support for `5.0.0.preview.1` API version



  **Features**

  - New client `QnAMakerRuntimeClient` in `azure.cognitiveservices.knowledge.qnamaker.runtime`

  **Breaking changes**

  - The `QnAMakerClient` client moved from namespace `azure.cognitiveservices.knowledge.qnamaker` to `azure.cognitiveservices.knowledge.qnamaker.authoring`



  * Initial Release


pkgId: 6bdc26d85f6d9adcdacab05862adb78cdc02b83e0c4dce25fdc62943446c0e2d
name: python-azure-cognitiveservices-language-luis
arch: src
version: 0.7.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services LUIS Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-language-luis-0.7.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Use the [azure-ai-language-conversations](https://pypi.org/project/azure-ai-language-conversations/) package instead.








  - This package is no longer being maintained. Use the [azure-ai-language-conversations](https://pypi.org/project/azure-ai-language-conversations/) package instead.



  *Authoring*



    - Model JSONEntity has a new parameter children
    - Model EntityLabel has a new parameter children
    - Model EntityPrediction has a new parameter children
    - Model EntityLabelObject has a new parameter children
    - Model ModelFeatureInformation has a new parameter is_required



    - Operation ExamplesOperations.add has a new signature
    - Operation ExamplesOperations.batch has a new signature
    - Operation ExamplesOperations.list has a new signature
    - Operation ModelOperations.list_entity_suggestions has a new signature
    - Operation ModelOperations.list_intent_suggestions has a new signature
    - Operation ModelOperations.delete_entity_feature has a new signature
    - Operation ModelOperations.delete_intent_feature has a new signature
    - Operation FeaturesOperations.add_entity_feature has a new signature
    - Operation FeaturesOperations.add_intent_feature has a new signature
    - Removed operation group PermissionsOperations



  *Authoring*

  **Features**

    - Added operation AppsOperations.import_v2_app
    - Added operation AppsOperations.import_lu_format
    - Added operation VersionsOperations.import_v2_app
    - Added operation VersionsOperations.export_lu_format
    - Added operation VersionsOperations.import_lu_format

  **Breaking changes**

    - Operation AzureAccountsOperations.get_assigned has a new signature (added arm_token parameter)
    - Operation AzureAccountsOperations.assign_to_app has a new signature (added arm_token parameter)
    - Operation AzureAccountsOperations.remove_from_app has a new signature (added arm_token parameter)
    - Operation AzureAccountsOperations.list_user_luis_accounts has a new signature (added arm_token parameter)



  *Authoring*

  **Features**

    - Model HierarchicalChildEntity has a new parameter children
    - Model HierarchicalChildEntity has a new parameter instance_of
    - Model PatternFeatureInfo has a new parameter
      enabled_for_all_models
    - Model PhraseListFeatureInfo has a new parameter
      enabled_for_all_models
    - Model PhraselistCreateObject has a new parameter
      enabled_for_all_models
    - Model PhraselistUpdateObject has a new parameter
      enabled_for_all_models
    - Model JSONModelFeature has a new parameter enabled_for_all_models
    - Model ChildEntity has a new parameter children
    - Model ChildEntity has a new parameter instance_of
    - Model ChildEntity has a new parameter type_id
    - Model ChildEntity has a new parameter readable_type
    - Model FeatureInfoObject has a new parameter
      enabled_for_all_models
    - Model LuisApp has a new parameter phraselists
    - Model LuisApp has a new parameter hierarchicals
    - Model HierarchicalModel has a new parameter features
    - Added operation ModelOperations.get_intent_features
    - Added operation ModelOperations.replace_intent_features
    - Added operation ModelOperations.update_entity_child
    - Added operation ModelOperations.add_entity_child
    - Added operation ModelOperations.delete_entity_feature
    - Added operation ModelOperations.delete_intent_feature
    - Added operation ModelOperations.replace_entity_features
    - Added operation ModelOperations.get_entity_features
    - Added operation FeaturesOperations.add_intent_feature
    - Added operation FeaturesOperations.add_entity_feature

  **Breaking changes**

    - Operation ModelOperations.update_hierarchical_entity has a new
      signature
    - Operation ModelOperations.add_entity has a new signature
    - Model LuisApp no longer has parameter model_features
    - Removed operation ModelOperations.add_hierarchical_entity
    - Removed operation ModelOperations.add_composite_entity
    - Removed operation ModelOperations.add_hierarchical_entity_child
    - Removed operation ModelOperations.update_entity
    - Removed operation
      FeaturesOperations.list_application_version_pattern_features



  **Features**

    - Added operation PredictionOperations.get_slot_prediction
    - Added operation PredictionOperations.get_version_prediction

  **Breaking changes** - Parameter score of model Sentiment is now
  required - Model EntityLabel no longer has parameter role - Model
  EntityLabel no longer has parameter role_id - Model JSONEntity no
  longer has parameter role - Model EntityLabelObject no longer has
  parameter role - Model CompositeEntityModel has a new signature -
  Removed operation PredictionOperations.resolve



  *Authoring*

  **Bugfixes**

    - Removed duplicate enum



  *Authoring*

  **Features**

    - Model EntityLabelObject has a new parameter role
    - Model JSONEntity has a new parameter role
    - Model EntityLabel has a new parameter role
    - Model EntityLabel has a new parameter role_id



  *Authoring*

  **Features**

    - Model ProductionOrStagingEndpointInfo has a new parameter
      failed_regions
    - Model EndpointInfo has a new parameter failed_regions
    - Added operation PatternOperations.list_patterns
    - Added operation PatternOperations.list_intent_patterns
    - Added operation ModelOperations.list_pattern_any_entity_roles
    - Added operation ModelOperations.list_regex_entity_infos
    - Added operation ModelOperations.list_pattern_any_entity_infos
    - Added operation ModelOperations.list_composite_entity_roles
    - Added operation ModelOperations.list_entity_suggestions
    - Added operation ModelOperations.list_hierarchical_entity_roles
    - Added operation ModelOperations.list_prebuilt_entity_roles
    - Added operation ModelOperations.list_entity_roles
    - Added operation ModelOperations.list_regex_entity_roles
    - Added operation ModelOperations.list_intent_suggestions
    - Added operation
      ModelOperations.list_custom_prebuilt_entity_roles
    - Added operation ModelOperations.list_closed_list_entity_roles
    - Added operation
      FeaturesOperations.list_application_version_pattern_features
    - Added operation
      AppsOperations.package_published_application_as_gzip
    - Added operation
      AppsOperations.package_trained_application_as_gzip
    - Added operation group SettingsOperations
    - Added operation group AzureAccountsOperations

  **Breaking changes**

    - Operation AppsOperations.update_settings has a new signature
    - Operation AppsOperations.delete has a new signature
    - Operation AppsOperations.publish has a new signature
    - Model ApplicationPublishObject no longer has parameter region
    - Removed operation PatternOperations.get_intent_patterns
    - Removed operation PatternOperations.get_patterns
    - Removed operation ModelOperations.get_regex_entity_roles
    - Removed operation
      ModelOperations.get_custom_prebuilt_entity_roles
    - Removed operation ModelOperations.get_pattern_any_entity_infos
    - Removed operation ModelOperations.get_prebuilt_entity_roles
    - Removed operation ModelOperations.get_composite_entity_roles
    - Removed operation ModelOperations.get_pattern_any_entity_roles
    - Removed operation ModelOperations.get_entity_roles
    - Removed operation ModelOperations.get_regex_entity_infos
    - Removed operation ModelOperations.get_entity_suggestions
    - Removed operation ModelOperations.get_closed_list_entity_roles
    - Removed operation ModelOperations.get_intent_suggestions
    - Removed operation ModelOperations.get_hierarchical_entity_roles
    - Model ApplicationSettingUpdateObject has a new signature

  *Runtime*

  **Features**

    - Model LuisResult has a new parameter connected_service_result



    - Initial Release


pkgId: 375ac18014e05cd70fafa7be15fc3b8b6a5b86738d35b83e738f2c0e885e95a8
name: python-azure-cognitiveservices-language-nspkg
arch: src
version: 3.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Language Namespace Package [Internal]
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-language-nspkg-3.0.1-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services Language namespace package.
  This package is not intended to be installed directly by the end user.
  Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 <https://www.python.org/dev/peps/pep-0420/>` as namespace package strategy.
  To avoid issues with package servers that does not support `python_requires`, a Python 3 package is installed but is empty.
  It provides the necessary files for other packages to extend the azure.cognitiveservices.language namespace.
  If you are looking to install the Azure client libraries, see the
  `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: 23619608142f9cb1199870552b35fa29a770c0cfff0172f999a7e14af7be0d64
name: python-azure-cognitiveservices-language-textanalytics
arch: src
version: 0.2.2
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Text Analytics Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-language-textanalytics-0.2.2-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Please install the [azure-ai-textanalytics](https://pypi.org/project/azure-ai-textanalytics/) package for the latest features and support.






  - This package is no longer being maintained. Please install the [azure-ai-textanalytics](https://pypi.org/project/azure-ai-textanalytics/) package for the latest features and support.



  - There is a newer version of this package. Please install the [azure-ai-textanalytics](https://pypi.org/project/azure-ai-textanalytics/) package for the latest features and support.



  **Features**

    - Client class can be used as a context manager to keep the underlying
      HTTP session open for performance
    - New method "entities"
    - Model KeyPhraseBatchResultItem has a new parameter statistics
    - Model KeyPhraseBatchResult has a new parameter statistics
    - Model LanguageBatchResult has a new parameter statistics
    - Model LanguageBatchResultItem has a new parameter statistics
    - Model SentimentBatchResult has a new parameter statistics

  **Breaking changes**

    - TextAnalyticsAPI main client has been renamed TextAnalyticsClient
    - TextAnalyticsClient parameter is no longer a region but a complete
      endpoint

  **General Breaking changes**

  This version uses a next-generation code generator that *might*
  introduce breaking changes.

    - Model signatures now use only keyword-argument syntax. All
      positional arguments must be re-written as keyword-arguments. To
      keep auto-completion in most cases, models are now generated for
      Python 2 and Python 3. Python 3 uses the "*" syntax for
      keyword-only arguments.
    - Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to
      improve the behavior when unrecognized enum values are encountered.
      While this is not a breaking change, the distinctions are important,
      and are documented here:
      <https://docs.python.org/3/library/enum.html#others> At a glance:
        - "is" should not be used at all.
        - "format" will return the string value, where "%s" string
          formatting will return `NameOfEnum.stringvalue`. Format syntax
          should be prefered.

  **Bugfixes**

    - Compatibility of the sdist with wheel 0.31.0



    - Initial Release


pkgId: 8f61f5e62b758fafc9a7d9618f4d692d6147e6d5a4fe4eb6972895ecf888c248
name: python-azure-cognitiveservices-nspkg
arch: src
version: 3.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Namespace Package [Internal]
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-nspkg-3.0.1-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services namespace package.
  This package is not intended to be installed directly by the end user.
  Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 <https://www.python.org/dev/peps/pep-0420/>` as namespace package strategy.
  To avoid issues with package servers that does not support `python_requires`, a Python 3 package is installed but is empty.
  It provides the necessary files for other packages to extend the azure.cognitiveservices namespace.
  If you are looking to install the Azure client libraries, see the
  `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: 38cb810c60757470174a6359b5958d14371bfc11a8ded418bcd98407b566d9ab
name: python-azure-cognitiveservices-personalizer
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: Microsoft Azure Personalizer Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-personalizer-0.1.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Personalizer Client Library.
  This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
  For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: 41f192d37fe9ea9a0ef60ee6d125ebea44e543584d8a11c5a71a6b494d18d18a
name: python-azure-cognitiveservices-search-entitysearch
arch: src
version: 2.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Entity Search Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-search-entitysearch-2.0.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Please refer to the samples in the [Bing Search for Python repo](https://github.com/microsoft/bing-search-sdk-for-python/tree/main) instead.

  For additional support, please open a new issue in the [Issues](https://github.com/microsoft/bing-search-sdk-for-python/issues) section of the Microsoft Bing Search SDK for Python repo.








  - This package is no longer being maintained. Please refer to the samples in the [Bing Search for Python repo](https://github.com/microsoft/bing-search-sdk-for-python/tree/main) instead.

  For additional support, please open a new issue in the [Issues](https://github.com/microsoft/bing-search-sdk-for-python/issues) section of the Microsoft Bing Search SDK for Python repo.



  **Breaking changes**

    - EntitySearchAPI main client has been renamed EntitySearchClient

  **General Breaking Changes**

  This version uses a next-generation code generator that might introduce
  breaking changes if from some import. In summary, some modules were
  incorrectly visible/importable and have been renamed. This fixed several
  issues caused by usage of classes that were not supposed to be used in
  the first place. EntitySearchClient cannot be imported from
  azure.cognitiveservices.search.entitysearch.entity_search_api anymore
  (import from azure.cognitiveservices.search.entitysearch works like
  before) EntitySearchClientConfiguration import has been moved from
  azure.cognitiveservices.search.entitysearch.entity_search_api to
  azure.cognitiveservices.search.entitysearch A model MyClass from a
  "models" sub-module cannot be imported anymore using
  azure.cognitiveservices.search.entitysearch.models.my_class (import
  from azure.cognitiveservices.search.entitysearch.models works like
  before) An operation class MyClassOperations from an operations
  sub-module cannot be imported anymore using
  azure.cognitiveservices.search.entitysearch.operations.my_class_operations
  (import from azure.cognitiveservices.search.entitysearch.operations
  works like before) Last but not least, HTTP connection pooling is now
  enabled by default. You should always use a client as a context manager,
  or call close(), or use no more than one client per process.



  **Features**

    - Client class can be used as a context manager to keep the underlying
      HTTP session open for performance

  **General Breaking changes**

  This version uses a next-generation code generator that *might*
  introduce breaking changes.

    - Model signatures now use only keyword-argument syntax. All
      positional arguments must be re-written as keyword-arguments. To
      keep auto-completion in most cases, models are now generated for
      Python 2 and Python 3. Python 3 uses the "*" syntax for
      keyword-only arguments.
    - Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to
      improve the behavior when unrecognized enum values are encountered.
      While this is not a breaking change, the distinctions are important,
      and are documented here:
      <https://docs.python.org/3/library/enum.html#others> At a glance:
        - "is" should not be used at all.
        - "format" will return the string value, where "%s" string
          formatting will return `NameOfEnum.stringvalue`. Format syntax
          should be prefered.
    - New Long Running Operation:
        - Return type changes from
          `msrestazure.azure_operation.AzureOperationPoller` to
          `msrest.polling.LROPoller`. External API is the same.
        - Return type is now **always** a `msrest.polling.LROPoller`,
          regardless of the optional parameters used.
        - The behavior has changed when using `raw=True`. Instead of
          returning the initial call result as `ClientRawResponse`,
          without polling, now this returns an LROPoller. After polling,
          the final resource will be returned as a `ClientRawResponse`.
        - New `polling` parameter. The default behavior is
          `Polling=True` which will poll using ARM algorithm. When
          `Polling=False`, the response of the initial call will be
          returned without polling.
        - `polling` parameter accepts instances of subclasses of
          `msrest.polling.PollingMethod`.
        - `add_done_callback` will no longer raise if called after
          polling is finished, but will instead execute the callback right
          away.



    - Initial Release


pkgId: fdbd7230199553f95473efab563677d34aeb465c537e178f5dce40361924bf92
name: python-azure-cognitiveservices-search-newssearch
arch: src
version: 2.0.0
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services News Search Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-search-newssearch-2.0.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services News Search Client Library.
  This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
  For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: 3e4a089f6c073da949b0330d00237232413f61fa29b4c3076317ad676aad3c60
name: python-azure-cognitiveservices-search-nspkg
arch: src
version: 3.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Search Namespace Package [Internal]
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-search-nspkg-3.0.1-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services Search namespace package.
  This package is not intended to be installed directly by the end user.
  Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 <https://www.python.org/dev/peps/pep-0420/>` as namespace package strategy.
  To avoid issues with package servers that does not support `python_requires`, a Python 3 package is installed but is empty.
  It provides the necessary files for other packages to extend the azure.cognitiveservices.search namespace.
  If you are looking to install the Azure client libraries, see the
  `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: 50ca4f2a22449871ebb805ab73b63a9ca15ac83ec2f96aae4640d6f57de0d52b
name: python-azure-cognitiveservices-search-websearch
arch: src
version: 2.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Web Search Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-search-websearch-2.0.1-1.src.rpm
checksum_type: sha256
description:
  This package is no longer being maintained. Please refer to the samples in the [Bing Search for Python repo](https://github.com/microsoft/bing-search-sdk-for-python/tree/main) instead.

  For additional support, please open a new issue in the [Issues](https://github.com/microsoft/bing-search-sdk-for-python/issues) section of the Microsoft Bing Search SDK for Python repo.








  - This package is no longer being maintained. Please refer to the samples in the [Bing Search for Python repo](https://github.com/microsoft/bing-search-sdk-for-python/tree/main) instead.

  For additional support, please open a new issue in the [Issues](https://github.com/microsoft/bing-search-sdk-for-python/issues) section of the Microsoft Bing Search SDK for Python repo.



  **Breaking changes**

    - WebSearchAPI main client has been renamed WebSearchClient

  **General Breaking Changes**

  This version uses a next-generation code generator that might introduce
  breaking changes if from some import. In summary, some modules were
  incorrectly visible/importable and have been renamed. This fixed several
  issues caused by usage of classes that were not supposed to be used in
  the first place. WebSearchClient cannot be imported from
  azure.cognitiveservices.search.websearch.web_search_api anymore
  (import from azure.cognitiveservices.search.websearch works like before)
  WebSearchClientConfiguration import has been moved from
  azure.cognitiveservices.search.websearch.web_search_api to
  azure.cognitiveservices.search.websearch A model MyClass from a "models"
  sub-module cannot be imported anymore using
  azure.cognitiveservices.search.websearch.models.my_class (import from
  azure.cognitiveservices.search.websearch.models works like before) An
  operation class MyClassOperations from an operations sub-module cannot
  be imported anymore using
  azure.cognitiveservices.search.websearch.operations.my_class_operations
  (import from azure.cognitiveservices.search.websearch.operations works
  like before) Last but not least, HTTP connection pooling is now enabled
  by default. You should always use a client as a context manager, or call
  close(), or use no more than one client per process.



  **Features**

    - Client class can be used as a context manager to keep the underlying
      HTTP session open for performance

  **General Breaking changes**

  This version uses a next-generation code generator that *might*
  introduce breaking changes.

    - Model signatures now use only keyword-argument syntax. All
      positional arguments must be re-written as keyword-arguments. To
      keep auto-completion in most cases, models are now generated for
      Python 2 and Python 3. Python 3 uses the "*" syntax for
      keyword-only arguments.
    - Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to
      improve the behavior when unrecognized enum values are encountered.
      While this is not a breaking change, the distinctions are important,
      and are documented here:
      <https://docs.python.org/3/library/enum.html#others> At a glance:
        - "is" should not be used at all.
        - "format" will return the string value, where "%s" string
          formatting will return `NameOfEnum.stringvalue`. Format syntax
          should be prefered.
    - New Long Running Operation:
        - Return type changes from
          `msrestazure.azure_operation.AzureOperationPoller` to
          `msrest.polling.LROPoller`. External API is the same.
        - Return type is now **always** a `msrest.polling.LROPoller`,
          regardless of the optional parameters used.
        - The behavior has changed when using `raw=True`. Instead of
          returning the initial call result as `ClientRawResponse`,
          without polling, now this returns an LROPoller. After polling,
          the final resource will be returned as a `ClientRawResponse`.
        - New `polling` parameter. The default behavior is
          `Polling=True` which will poll using ARM algorithm. When
          `Polling=False`, the response of the initial call will be
          returned without polling.
        - `polling` parameter accepts instances of subclasses of
          `msrest.polling.PollingMethod`.
        - `add_done_callback` will no longer raise if called after
          polling is finished, but will instead execute the callback right
          away.



    - Initial Release


pkgId: f04cfead2a0a5472c54da81c146407657c6eb5189c3e7464e2f65db712dee1f5
name: python-azure-cognitiveservices-vision-contentmoderator
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Content Moderator Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-contentmoderator-1.0.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services Content Moderator Client Library.
  This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
  For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


pkgId: fd3b86c973383219d3a862bd41261964628cac3369c319d3273e345c04525a7c
name: python-azure-cognitiveservices-vision-contentmoderator
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Content Moderator Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-contentmoderator-1.0.1-1.src.rpm
checksum_type: sha256
description:
  This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024. To receive updates on new features and non-security bug fixes, upgrade to the replacement package, [azure-ai-contentsafety](https://pypi.org/project/azure-ai-contentsafety/).








  - This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024. To receive updates on new features and non-security bug fixes, upgrade to the replacement package, [azure-ai-contentsafety](https://pypi.org/project/azure-ai-contentsafety/).





    - Initial stable release



    - Initial Release


pkgId: f10ef221108120af7b05d384d82a60e0b3bc983e67da86881e4904d776817dc7
name: python-azure-cognitiveservices-vision-customvision
arch: src
version: 3.1.0
epoch: 0
release: 1
summary: Microsoft Azure Custom Vision Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-customvision-3.1.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Custom Vision Client Library.
  This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
  For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).




  For code examples, see [Custom Vision](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
  on docs.microsoft.com.




  If you encounter any bugs or have suggestions, please file an issue in the
  [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
  section of the project.


  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-customvision%2FREADME.png)






  *Training 3.4-preview*

  **Features**

    - Support for `3.4-preview` API version.



  *Training 3.3*

  **Features**

    - Model ImageUrlCreateBatch has a new parameter metadata
    - Model ImageIdCreateBatch has a new parameter metadata
    - Model Prediction has a new parameter tag_type
    - Model ImageFileCreateBatch has a new parameter metadata
    - Model Image has a new parameter metadata
    - Added operation get_images
    - Added operation update_image_metadata
    - Added operation get_artifact
    - Added operation get_image_count

  **Breaking changes**

    - Operation import_project has a new signature
    - Operation publish_iteration has a new signature
    - Operation create_images_from_files has a new signature
    - Operation create_images_from_urls has a new signature
    - Operation create_images_from_predictions has a new signature

  *Prediction 3.1*

  **Features**

    - Model Prediction has a new parameter tag_type



  **Features**

    - Model Iteration has a new parameter training_time_in_minutes
    - Model ProjectSettings has a new parameter image_processing_settings
    - Model ProjectSettings has a new parameter detection_parameters
    - Model ProjectSettings has a new parameter use_negative_set
    - Model Project has a new parameter status
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_url
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_url
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_url_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_url_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image
    - Added operation group CustomVisionTrainingClientOperationsMixin

  **Breaking changes**

  - Credentials are now longer a simple string, but a `msrest.authentication.ApiKeyCredentials` instance instead

  **General Breaking changes**

  This version uses a next-generation code generator that *might*
  introduce breaking changes if from some import. In summary, some modules
  were incorrectly visible/importable and have been renamed. This fixed
  several issues caused by usage of classes that were not supposed to be
  used in the first place.

    - CustomVisionPredictionClient cannot be imported from `azure.cognitiveservices.vision.customvision.prediction.custom_vision_prediction_client`
      anymore (import from `azure.cognitiveservices.vision.customvision.prediction` works like before)
    - CustomVisionPredictionClientConfiguration import has been moved from
      `azure.cognitiveservices.vision.customvision.prediction.custom_vision_prediction_client` to `azure.cognitiveservices.vision.customvision.prediction`
    - A model `MyClass` from a "models" sub-module cannot be imported
      anymore using `azure.cognitiveservices.vision.customvision.prediction.models.my_class` (import from
      `azure.cognitiveservices.vision.customvision.prediction.models` works like before)
    - An operation class `MyClassOperations` from an `operations`
      sub-module cannot be imported anymore using
      `azure.cognitiveservices.vision.customvision.operations.prediction.my_class_operations` (import
      from `azure.cognitiveservices.vision.customvision.prediction.operations` works like before)
    - CustomVisionTrainingClient cannot be imported from `azure.cognitiveservices.vision.customvision.training.custom_vision_training_client`
      anymore (import from `azure.cognitiveservices.vision.customvision.training` works like before)
    - CustomVisionTrainingClientConfiguration import has been moved from
      `azure.cognitiveservices.vision.customvision.training.custom_vision_training_client` to `azure.cognitiveservices.vision.customvision.training`
    - A model `MyClass` from a "models" sub-module cannot be imported
      anymore using `azure.cognitiveservices.vision.customvision.training.models.my_class` (import from
      `azure.cognitiveservices.vision.customvision.training.models` works like before)
    - An operation class `MyClassOperations` from an `operations`
      sub-module cannot be imported anymore using
      `azure.cognitiveservices.vision.customvision.operations.training.my_class_operations` (import
      from `azure.cognitiveservices.vision.customvision.training.operations` works like before)

  Last but not least, HTTP connection pooling is now enabled by default.
  You should always use a client as a context manager, or call close(), or
  use no more than one client per process.



  This is a stable release of the Cognitive Services Custom Vision SDK.

  **Training**

    - Added an advanced training option to set a budget to train longer
      for improved iteration performance.
    - Added additional export options targetting Vision AI Dev Kit and
      Docker ARM for Raspberry Pi.

  **Prediction**

    - PredictImage and PredictImageUrl have been replaced with project
      type specific calls. ClassifyImage and ClassifyImageUrl for image
      classification projects. DetectImage and DetectImageUrl for object
      detection projects .
    - Prediction methods now take a name to designate which published
      iteration to use. Iterations can be published using the Custom
      Vision Training SDK.



    - The API client name was changed from TrainingAPI to
      CustomVisionTrainingClient, in keeping with other Azure SDKs.
    - The way the Azure region is specfied has changed. Specifically, the
      AzureRegion property was dropped in favor of an Endpoint property.
      If you were previously specifying an AzureRegion value, you should
      now specify
      Endpoint=`https://{AzureRegion}.api.cognitive.microsoft.com`
      instead. This change ensures better global coverage.
    - Added ONNX 1.2 as an export option
    - Added negative tag support.



  **Features**

    - Added ability to create Multilabel or Multiclass image
      classification projects
    - Fixes and improvements to Docker container export and export
      pipeline to know when a newer version is available



  **Breaking changes**

    - Expect many breaking changes. As a preview package, we don't detail,
      but updated samples are available at:[cognitive-services-python-sdk-samples](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples)

  **Features**

    - Adding support for object detection projects and expanded export
      functionality for image classification projects
    - Client class can be used as a context manager to keep the underlying
      HTTP session open for performance

  **Bugfixes**

    - Compatibility of the sdist with wheel 0.31.0

  Internal API version moved from 1.2 to 2.0



    - Initial Release


pkgId: cb309839c51bb3ed25a777de1f7030a4b2139a5053075e2a11a6a93d70428f79
name: python-azure-cognitiveservices-vision-customvision
arch: src
version: 3.1.1
epoch: 0
release: 1
summary: Microsoft Azure Custom Vision Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-customvision-3.1.1-1.src.rpm
checksum_type: sha256
description:
  This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024.








  - This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024.



  *Training 3.4-preview*



    - Support for `3.4-preview` API version.



  *Training 3.3*

  **Features**

    - Model ImageUrlCreateBatch has a new parameter metadata
    - Model ImageIdCreateBatch has a new parameter metadata
    - Model Prediction has a new parameter tag_type
    - Model ImageFileCreateBatch has a new parameter metadata
    - Model Image has a new parameter metadata
    - Added operation get_images
    - Added operation update_image_metadata
    - Added operation get_artifact
    - Added operation get_image_count

  **Breaking changes**

    - Operation import_project has a new signature
    - Operation publish_iteration has a new signature
    - Operation create_images_from_files has a new signature
    - Operation create_images_from_urls has a new signature
    - Operation create_images_from_predictions has a new signature

  *Prediction 3.1*

  **Features**

    - Model Prediction has a new parameter tag_type



  **Features**

    - Model Iteration has a new parameter training_time_in_minutes
    - Model ProjectSettings has a new parameter image_processing_settings
    - Model ProjectSettings has a new parameter detection_parameters
    - Model ProjectSettings has a new parameter use_negative_set
    - Model Project has a new parameter status
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_url
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_url
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image_url_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_url_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image_with_no_store
    - Added operation CustomVisionPredictionClientOperationsMixin.classify_image
    - Added operation CustomVisionPredictionClientOperationsMixin.detect_image
    - Added operation group CustomVisionTrainingClientOperationsMixin

  **Breaking changes**

  - Credentials are now longer a simple string, but a `msrest.authentication.ApiKeyCredentials` instance instead

  **General Breaking changes**

  This version uses a next-generation code generator that *might*
  introduce breaking changes if from some import. In summary, some modules
  were incorrectly visible/importable and have been renamed. This fixed
  several issues caused by usage of classes that were not supposed to be
  used in the first place.

    - CustomVisionPredictionClient cannot be imported from `azure.cognitiveservices.vision.customvision.prediction.custom_vision_prediction_client`
      anymore (import from `azure.cognitiveservices.vision.customvision.prediction` works like before)
    - CustomVisionPredictionClientConfiguration import has been moved from
      `azure.cognitiveservices.vision.customvision.prediction.custom_vision_prediction_client` to `azure.cognitiveservices.vision.customvision.prediction`
    - A model `MyClass` from a "models" sub-module cannot be imported
      anymore using `azure.cognitiveservices.vision.customvision.prediction.models.my_class` (import from
      `azure.cognitiveservices.vision.customvision.prediction.models` works like before)
    - An operation class `MyClassOperations` from an `operations`
      sub-module cannot be imported anymore using
      `azure.cognitiveservices.vision.customvision.operations.prediction.my_class_operations` (import
      from `azure.cognitiveservices.vision.customvision.prediction.operations` works like before)
    - CustomVisionTrainingClient cannot be imported from `azure.cognitiveservices.vision.customvision.training.custom_vision_training_client`
      anymore (import from `azure.cognitiveservices.vision.customvision.training` works like before)
    - CustomVisionTrainingClientConfiguration import has been moved from
      `azure.cognitiveservices.vision.customvision.training.custom_vision_training_client` to `azure.cognitiveservices.vision.customvision.training`
    - A model `MyClass` from a "models" sub-module cannot be imported
      anymore using `azure.cognitiveservices.vision.customvision.training.models.my_class` (import from
      `azure.cognitiveservices.vision.customvision.training.models` works like before)
    - An operation class `MyClassOperations` from an `operations`
      sub-module cannot be imported anymore using
      `azure.cognitiveservices.vision.customvision.operations.training.my_class_operations` (import
      from `azure.cognitiveservices.vision.customvision.training.operations` works like before)

  Last but not least, HTTP connection pooling is now enabled by default.
  You should always use a client as a context manager, or call close(), or
  use no more than one client per process.



  This is a stable release of the Cognitive Services Custom Vision SDK.

  **Training**

    - Added an advanced training option to set a budget to train longer
      for improved iteration performance.
    - Added additional export options targetting Vision AI Dev Kit and
      Docker ARM for Raspberry Pi.

  **Prediction**

    - PredictImage and PredictImageUrl have been replaced with project
      type specific calls. ClassifyImage and ClassifyImageUrl for image
      classification projects. DetectImage and DetectImageUrl for object
      detection projects .
    - Prediction methods now take a name to designate which published
      iteration to use. Iterations can be published using the Custom
      Vision Training SDK.



    - The API client name was changed from TrainingAPI to
      CustomVisionTrainingClient, in keeping with other Azure SDKs.
    - The way the Azure region is specfied has changed. Specifically, the
      AzureRegion property was dropped in favor of an Endpoint property.
      If you were previously specifying an AzureRegion value, you should
      now specify
      Endpoint=`https://{AzureRegion}.api.cognitive.microsoft.com`
      instead. This change ensures better global coverage.
    - Added ONNX 1.2 as an export option
    - Added negative tag support.



  **Features**

    - Added ability to create Multilabel or Multiclass image
      classification projects
    - Fixes and improvements to Docker container export and export
      pipeline to know when a newer version is available



  **Breaking changes**

    - Expect many breaking changes. As a preview package, we don't detail,
      but updated samples are available at:[cognitive-services-python-sdk-samples](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples)

  **Features**

    - Adding support for object detection projects and expanded export
      functionality for image classification projects
    - Client class can be used as a context manager to keep the underlying
      HTTP session open for performance

  **Bugfixes**

    - Compatibility of the sdist with wheel 0.31.0

  Internal API version moved from 1.2 to 2.0



    - Initial Release


pkgId: ec77f1c06094fe4a0bd425b4f6292ea4179c9320c001b98b1d859ca5832492d6
name: python-azure-cognitiveservices-vision-face
arch: src
version: 0.6.0
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Face Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-face-0.6.0-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure Cognitive Services Face Client Library.
  This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
  For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).







  For code examples, see [Cognitive Services Face](https://docs.microsoft.com/python/api/overview/azure/cognitive-services) on docs.microsoft.com.




  If you encounter any bugs or have suggestions, please file an issue in the
  [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
  section of the project.


  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-face%2FREADME.png)






  **Features**

    - Add support for Face Recognition Quality Score.

  **Breaking changes**

    - Various operations that previously accepted an optional name parameter
      are now required.



  **Features**

    - Model FaceAttributes has a new parameter mask

  **Breaking changes**

    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature



  **Features**

  - Add recognition_03 support



  **Features**

    - Add "detection_model" to operations when possible. This is a
      breaking change if you were using positional arguments on some
      scenarios

  **Breaking changes**

    - Operation FaceListOperations.add_face_from_stream has a new
      signature
    - Operation FaceListOperations.add_face_from_url has a new
      signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation LargeFaceListOperations.add_face_from_stream has a new
      signature
    - Operation LargeFaceListOperations.add_face_from_url has a new
      signature
    - Operation LargePersonGroupPersonOperations.add_face_from_stream
      has a new signature
    - Operation LargePersonGroupPersonOperations.add_face_from_url has
      a new signature
    - Operation PersonGroupPersonOperations.add_face_from_stream has a
      new signature
    - Operation PersonGroupPersonOperations.add_face_from_url has a new
      signature



  **Features**

    - Model PersonGroup has a new parameter recognition_model
    - Model FaceList has a new parameter recognition_model
    - Model LargePersonGroup has a new parameter recognition_model
    - Model LargeFaceList has a new parameter recognition_model
    - Model DetectedFace has a new parameter recognition_model

  **Breaking changes**

    - Operation FaceListOperations.create has a new signature
    - Operation FaceListOperations.get has a new signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation LargeFaceListOperations.create has a new signature
    - Operation LargeFaceListOperations.get has a new signature
    - Operation LargePersonGroupOperations.create has a new signature
    - Operation LargePersonGroupOperations.get has a new signature
    - Operation LargePersonGroupOperations.list has a new signature
    - Operation PersonGroupOperations.create has a new signature
    - Operation PersonGroupOperations.get has a new signature
    - Operation PersonGroupOperations.list has a new signature
    - Operation FaceListOperations.list has a new signature
    - Operation LargeFaceListOperations.list has a new signature



    - Add snapshots features



    - Initial Release


pkgId: 691ac91d98f65327aa1b471fadf1df862cd84629baf4e3657bd469caf423aae7
name: python-azure-cognitiveservices-vision-face
arch: src
version: 0.6.1
epoch: 0
release: 1
summary: Microsoft Azure Cognitive Services Face Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-cognitiveservices-vision-face-0.6.1-1.src.rpm
checksum_type: sha256
description:
  This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024. To receive updates on new features and non-security bug fixes, upgrade to the replacement package, [azure-ai-vision-face](https://pypi.org/project/azure-ai-vision-face/).








  - This package has been deprecated and will no longer be maintained after 11-01-2024. This package will only receive security fixes until 11-01-2024. To receive updates on new features and non-security bug fixes, upgrade to the replacement package, [azure-ai-vision-face](https://pypi.org/project/azure-ai-vision-face/).





    - Add support for Face Recognition Quality Score.



    - Various operations that previously accepted an optional name parameter
      are now required.



  **Features**

    - Model FaceAttributes has a new parameter mask

  **Breaking changes**

    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature



  **Features**

  - Add recognition_03 support



  **Features**

    - Add "detection_model" to operations when possible. This is a
      breaking change if you were using positional arguments on some
      scenarios

  **Breaking changes**

    - Operation FaceListOperations.add_face_from_stream has a new
      signature
    - Operation FaceListOperations.add_face_from_url has a new
      signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation LargeFaceListOperations.add_face_from_stream has a new
      signature
    - Operation LargeFaceListOperations.add_face_from_url has a new
      signature
    - Operation LargePersonGroupPersonOperations.add_face_from_stream
      has a new signature
    - Operation LargePersonGroupPersonOperations.add_face_from_url has
      a new signature
    - Operation PersonGroupPersonOperations.add_face_from_stream has a
      new signature
    - Operation PersonGroupPersonOperations.add_face_from_url has a new
      signature



  **Features**

    - Model PersonGroup has a new parameter recognition_model
    - Model FaceList has a new parameter recognition_model
    - Model LargePersonGroup has a new parameter recognition_model
    - Model LargeFaceList has a new parameter recognition_model
    - Model DetectedFace has a new parameter recognition_model

  **Breaking changes**

    - Operation FaceListOperations.create has a new signature
    - Operation FaceListOperations.get has a new signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_stream has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation FaceOperations.detect_with_url has a new signature
    - Operation LargeFaceListOperations.create has a new signature
    - Operation LargeFaceListOperations.get has a new signature
    - Operation LargePersonGroupOperations.create has a new signature
    - Operation LargePersonGroupOperations.get has a new signature
    - Operation LargePersonGroupOperations.list has a new signature
    - Operation PersonGroupOperations.create has a new signature
    - Operation PersonGroupOperations.get has a new signature
    - Operation PersonGroupOperations.list has a new signature
    - Operation FaceListOperations.list has a new signature
    - Operation LargeFaceListOperations.list has a new signature



    - Add snapshots features



    - Initial Release


pkgId: 0c359dfef6c39d56df4a8485e5188fad79ed3e9557ba257bfb370e49a2caa9bf
name: python-azure-common
arch: src
version: 1.1.28
epoch: 0
release: 1
summary: Microsoft Azure Client Library for Python (Common)
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-common-1.1.28-1.src.rpm
checksum_type: sha256
description:
  This is the Microsoft Azure common code.

  This package provides shared code by the Azure packages.

  If you are looking to install the Azure client libraries, refer to the main Github repository:
  https://github.com/Azure/azure-sdk-for-python


  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-common%2FREADME.png)






  - Raise a NotImplementedError if trying to use CLI credentials were CLI version is higher than 2.21.0  #20657 #21313
  - Deprecate all methods that needs access to CLI code using azure-cli-core, since this package is no longer importable as public API



  - Deprecate JSON and auth file client factory  #15075
  - Add 2020-09-01-hybrid profile definition  #14642



  - get_client_from_cli_profile now supports azure-applicationinsights 0.1.0 package



  - get_client_from_cli_profile no longer requires "azure-core" if not necessary



  - get_client_from_cli_profile now supports KV 4.x, Storage 12.x, AppConfig and all packages based on azure-core



  - Add Monitor into Profile v2019_03_01_hybrid (requires azure-mgmt-monitor >= 0.7.0)



  - Fix KeyVaultClient support for get_client_from_auth_file



  - Fix compute support in profile v2019_03_01_hybrid



  - Add support for profile v2019_03_01_hybrid
  - Fix profile v2018_03_01_hybrid for DNS definition



  - Azure Stack support for get_client_from_auth_file and get_client_from_json_dict



  - Remove deprecated extra dependencies



  - Fix KeyVaultClient creation with get_client_from_cli_profile

  Thanks to patrikn for the contribution



  - azure-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)



  **Features**

  - Adding profile v2018-03-01-hybrid definition



  **Features**

  - Adding KeyVault to profile v2017_03_09_profile



  **Features**

  - get_azure_cli_credentials has a new parameter "with_tenant" to get default CLI tenant ID

  **Bugfixes**

  - get_client_from_cli_profile now supports the "azure-graphrbac" package #2867
  - get_client_from_auth_file now supports the "azure-graphrbac" package #2867



  **Features**

  - Add Authorization profile definition



  **Features**

  - Add support for "resource" in "get_azure_cli_credentials"



  **Bugfixes**

  - Fix MultiApiClientMixin.__init__ to be a real mixin



  **Features**

  - Add "azure.profiles" namespace #2247

  **Bugfixes**

  - get_client_from_cli_profile now supports Datalake #2318



  **Bugfix**

  - Fix get_client_from_auth_file and get_client_from_json_dict on Python 2.7

  Thank you to @jayden-at-arista for the contribution.



  - Adds azure.common.client_factory.get_client_from_auth_file
  - Adds azure.common.client_factory.get_client_from_json_dict



  - Adds azure.common.client_factory.get_client_from_cli_profile



  - "extra_requires" autorest is deprecated and should not be used anymore
  - This wheel package is now built with the azure wheel extension



  - Support for msrest/msrestazure 0.4.x series
  - Drop support for msrest/msrestazure 0.3.x series



  - Support for msrest/msrestazure 0.3.x series
  - Drop support for msrest/msrestazure 0.2.x series



  - Support for msrest/msrestazure 0.2.x series
  - Drop support for msrest/msrestazure 0.1.x series



  - Move msrestazure depency as "extra_requires"



  - Support for msrest/msrestazure 0.1.x series
  - Adds alias from msrestazure.azure_active_directory.* to azure.common.credentials



  Initial release, extracted from azure==0.11.1


pkgId: fa05a72d6ca303e5f1b80848fb70a4f6b150b9a345d1d760d485c7f35574195c
name: python-azure-communication-callautomation
arch: src
version: 1.2.0
epoch: 0
release: 1
summary: Microsoft Azure Communication Call Automation Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-callautomation-1.2.0-1.src.rpm
checksum_type: sha256
description:
  This package contains a Python SDK for Azure Communication Call Automation. Call Automation provides developers the ability to build server-based, intelligent call workflows, and call recording for voice and PSTN channels.

  [Overview of Call Automation][overview] | [Product documentation][product_docs]


  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please
  refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_



  - Python 3.7 or later is required to use this package.
  - You need an [Azure subscription][azure_sub] to use this package.
  - A deployed Communication Services resource. You can use the [Azure Portal][azure_portal] or the [Azure PowerShell][azure_powershell] to set it up.


  Install the Azure Communication Service Call Automation SDK.

  ```bash
  pip install azure-communication-callautomation
  ```


  | Name                 | Description                                                                                                                                                                                                                                                                                                                              |
  | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | CallAutomationClient | `CallAutomationClient` is the primary interface for developers using this client library. It can be used to initiate calls by `createCall` or `answerCall`. It can also be used to do recording actions such as `startRecording`                                                                                                         |                                                                      |
  | CallConnectionClient | `CallConnectionClient` represents a ongoing call. Once the call is established with `createCall` or `answerCall`, further actions can be performed for the call, such as `transfer` or `play_media`.                                                                                                                                     |                                                                                                                                                               |
  | Callback Events      | Callback events are events sent back during duration of the call. It gives information and state of the call, such as `CallConnected`. `CallbackUrl` must be provided during `createCall` and `answerCall`, and callback events will be sent to this url. |
  | Incoming Call Event  | When incoming call happens (that can be answered with `answerCall`), incoming call eventgrid event will be sent. This is different from Callback events above, and should be setup on Azure portal. See [Incoming Call][incomingcall] for detail.                                                                                        |



  ```Python
  from azure.communication.callautomation import (CallAutomationClient)


  endpoint_url = '<ENDPOINT>'
  client = CallAutomationClient.from_connection_string(endpoint_url)
  ```


  ```Python
  from azure.communication.callautomation import (
      CallAutomationClient,
      CommunicationUserIdentifier
  )


  user = CommunicationUserIdentifier("8:acs:...")


  callback_url = "https://<MY-EVENT-HANDLER-URL>/events"


  result = client.create_call(
      target_participant=user,
      callback_url=callback_uri
  )


  call_connection_id = result.call_connection_id
  ```


  ```Python

  call_connection = client.get_call_connection(call_connection_id)


  my_file = FileSource(url="https://<FILE-SOURCE>/<SOME-FILE>.wav")
  call_connection.play_to_all(my_file)
  ```



  - [Call Automation Overview][overview]
  - [Incoming Call Concept][incomingcall]
  - [Build a customer interaction workflow using Call Automation][build1]
  - [Redirect inbound telephony calls with Call Automation][build2]
  - [Quickstart: Play action][build3]
  - [Quickstart: Recognize action][build4]
  - [Read more about Call Recording in Azure Communication Services][recording1]
  - [Record and download calls with Event Grid][recording2]



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the Code of Conduct FAQ or contact opencode@microsoft.com with any
  additional questions or comments.

  <!-- LINKS -->
  [overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation
  [product_docs]: https://docs.microsoft.com/azure/communication-services/overview
  [azure_cli]: https://docs.microsoft.com/cli/azure
  [azure_sub]: https://azure.microsoft.com/free/
  [azure_portal]: https://portal.azure.com
  [azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice
  [build_doc]: https://aka.ms/AzureSDKBundling
  [incomingcall]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/incoming-call-notification
  [build1]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-csha
  [build2]: https://learn.microsoft.com/azure/communication-services/how-tos/call-automation-sdk/redirect-inbound-telephony-calls?pivots=programming-language-csharp
  [build3]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/play-action?pivots=programming-language-csharp
  [build4]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/recognize-action?pivots=programming-language-csharp
  [recording1]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording
  [recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp


pkgId: 795cb94fb10740e968dfd3311212955598f038947ecc574a9979366519f5dc7b
name: python-azure-communication-chat
arch: src
version: 1.3.0
epoch: 0
release: 1
summary: Microsoft Azure Communication Chat Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-chat-1.3.0-1.src.rpm
checksum_type: sha256
description:
  This package contains a Python SDK for Azure Communication Services for Chat.
  Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview)

  [Source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-chat)
  | [Package (Pypi)](https://pypi.org/project/azure-communication-chat/)
  | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/)
  | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-communication-chat/1.0.0b5/index.html)
  | [Product documentation](https://docs.microsoft.com/azure/communication-services/)



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_





  - Python 3.7 or later is required to use this package.
  - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.



  Install the Azure Communication Service Chat SDK.

  ```bash
  pip install --pre azure-communication-chat
  ```



  User access tokens enable you to build client applications that directly authenticate to Azure Communication Services. You can generate these tokens with azure.communication.identity module, and then use them to initialize the Communication Services SDKs. Example of using azure.communication.identity:

  ```bash
  pip install azure-communication-identity
  ```

  ```python
  from azure.communication.identity import CommunicationIdentityClient
  identity_client = CommunicationIdentityClient.from_connection_string("<connection string of your Communication service>")
  user = identity_client.create_user()
  tokenresponse = identity_client.get_token(user, scopes=["chat"])
  token = tokenresponse.token
  ```

  The `user` created above will be used later, because that user should be added as a participant of new chat thread when you creating
  it with this token. It is because the initiator of the create request must be in the list of the participants of the chat thread.



  This will allow you to create, get, list or delete chat threads.

  ```python
  from azure.communication.chat import ChatClient, CommunicationTokenCredential


  endpoint = "https://<RESOURCE_NAME>.communcationservices.azure.com"
  chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))
  ```



  The ChatThreadClient will allow you to perform operations specific to a chat thread, like send message, get message, update
  the chat thread topic, add participants to chat thread, etc.

  You can get it by creating a new chat thread using ChatClient:

  ```python
  create_chat_thread_result = chat_client.create_chat_thread(topic)
  chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)
  ```

  Additionally, the client can also direct so that the request is repeatable; that is, if the client makes the
  request multiple times with the same Idempotency-Token and it will get back an appropriate response without
  the server executing the request multiple times. The value of the Idempotency-Token is an opaque string
  representing a client-generated, globally unique for all time, identifier for the request.

  ```python
  create_chat_thread_result = chat_client.create_chat_thread(
      topic,
      thread_participants=thread_participants,
      idempotency_token=idempotency_token
  )
  chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)
  ```

  Alternatively, if you have created a chat thread before and you have its thread_id, you can create it by:

  ```python
  chat_thread_client = chat_client.get_chat_thread_client(thread_id) # thread_id is the id of an existing chat thread
  ```



  A chat conversation is represented by a chat thread. Each user in the thread is called a thread participant.
  Thread participants can chat with one another privately in a 1:1 chat or huddle up in a 1:N group chat.
  Users also get near real-time updates for when others are typing and when they have read the messages.

  Once you initialized a `ChatClient` class, you can do the following chat operations:



  Perform CRD(Create-Read-Delete) operations on threads

  ```python
  create_chat_thread(topic, **kwargs)
  list_chat_threads(**kwargs)
  delete_chat_thread(thread_id, **kwargs)
  ```

  Once you initialized a `ChatThreadClient` class, you can do the following chat operations:



  Perform Update operation on thread topic

  ```python
  update_topic(topic, **kwargs)
  ```


  ```python
  get_properties(**kwargs)
  ```



  Perform CRUD(Create-Read-Update-Delete) operations on messages

  ```python
  send_message(content, **kwargs)
  get_message(message_id, **kwargs)
  list_messages(**kwargs)
  update_message(message_id, content, **kwargs)
  delete_message(message_id, **kwargs)
  ```



  Perform CRD(Create-Read-Delete) operations on thread participants

  ```python
  list_participants(**kwargs)
  add_participants(thread_participants, **kwargs)
  remove_participant(participant_identifier, **kwargs)
  ```



  Notify the service of typing notification

  ```python
  send_typing_notification(**kwargs)
  ```



  Notify the service that a message is read and get list of read messages.

  ```python
  send_read_receipt(message_id, **kwargs)
  list_read_receipts(**kwargs)
  ```



  The following sections provide several code snippets covering some of the most common tasks, including:

  - [Thread Operations](#thread-operations)
  - [Message Operations](#message-operations)
  - [Thread Participant Operations](#thread-participant-operations)
  - [Events Operations](#events-operations)





  Use the `create_chat_thread` method to create a chat thread.

  - Use `topic`, required, to give a thread topic;
  - Use `thread_participants`, optional, to provide a list the `ChatParticipant` to be added to the thread;
      - `user`, required, it is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user()
        from User Access Tokens
      <!-- [User Access Tokens](#user-access-tokens) -->
      - `display_name`, optional, is the display name for the thread participant.
      - `share_history_time`, optional, time from which the chat history is shared with the participant.
  - Use `idempotency_token`, optional, to specify the unique identifier for the request.


  `CreateChatThreadResult` is the result returned from creating a thread, you can use it to fetch the `id` of
  the chat thread that got created. This `id` can then be used to fetch a `ChatThreadClient` object using
  the `get_chat_thread_client` method. `ChatThreadClient` can be used to perform other chat operations to this chat thread.

  ```python

  topic = "test topic"
  create_chat_thread_result = chat_client.create_chat_thread(topic)
  chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)
  ```

  ```python

  from azure.communication.identity import CommunicationIdentityClient
  from azure.communication.chat import ChatParticipant, ChatClient, CommunicationTokenCredential
  import uuid
  from datetime import datetime


  identity_client = CommunicationIdentityClient.from_connection_string('<connection_string>')
  user = identity_client.create_user()


  tokenresponse = identity_client.get_token(user, scopes=["chat"])
  token = tokenresponse.token







  endpoint = "https://<RESOURCE_NAME>.communcationservices.azure.com"
  chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))


  def get_unique_identifier_for_request(**kwargs):
      res = uuid.uuid4()
      return res

  topic = "test topic"
  thread_participants = [ChatParticipant(
      identifier=user,
      display_name='name',
      share_history_time=datetime.utcnow()
  )]


  idempotency_token = get_unique_identifier_for_request()

  create_chat_thread_result = chat_client.create_chat_thread(
      topic,
      thread_participants=thread_participants,
      idempotency_token=idempotency_token)
  thread_id = create_chat_thread_result.chat_thread.id


  chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)



  def decide_to_retry(error, **kwargs):
      """
      Insert some custom logic to decide if retry is applicable based on error
      """
      return True

  retry = [thread_participant for thread_participant, error in create_chat_thread_result.errors if decide_to_retry(error)]
  if retry:
      chat_thread_client.add_participants(retry)
  ```




  Use `get_properties` method retrieves a `ChatThreadProperties` from the service; `thread_id` is the unique ID of the thread.

  ```python
  chat_thread_properties = chat_thread_client.get_properties()
  ```


  Use `list_chat_threads` method retrieves the list of created chat threads

  - Use `results_per_page`, optional, The maximum number of messages to be returned per page.
  - Use `start_time`, optional, The start time where the range query.

  An iterator of `[ChatThreadItem]` is the response returned from listing threads

  ```python
  from azure.communication.chat import ChatClient, CommunicationTokenCredential
  from datetime import datetime, timedelta

  token = "<token>"
  endpoint = "https://<RESOURCE_NAME>.communcationservices.azure.com"
  chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))
  start_time = datetime.utcnow() - timedelta(days=2)

  chat_threads = chat_client.list_chat_threads(results_per_page=5, start_time=start_time)
  for chat_thread_item_page in chat_threads.by_page():
      for chat_thread_item in chat_thread_item_page:
          print("thread id:", chat_thread_item.id)
  ```



  Use `update_topic` method to update a thread's properties. `topic` is used to describe the change of the thread topic
  - Use `topic` to give thread a new topic;

  ```python
  topic = "new topic"
  chat_thread_client.update_topic(topic=topic)

  chat_thread = chat_thread_client.get_properties(thread_id)

  assert chat_thread.topic == topic
  ```



  Use `delete_chat_thread` method to delete a thread; `thread_id` is the unique ID of the thread.
  - Use `thread_id`, required, to specify the unique ID of the thread.
  ```python
  chat_client.delete_chat_thread(thread_id=thread_id)
  ```





  Use `send_message` method to sends a message to a thread identified by `thread_id`.

  - Use `content`, required, to provide the chat message content.
  - Use `chat_message_type`, optional, to provide the chat message type. Possible values include: `ChatMessageType.TEXT`,
    `ChatMessageType.HTML`, `'text'`, `'html'`; if not specified, `ChatMessageType.TEXT` will be set
  - Use `sender_display_name`,optional, to specify the display name of the sender, if not specified, empty name will be set

  `SendChatMessageResult` is the response returned from sending a message, it contains an id, which is the unique ID of the message.

  ```python
  from azure.communication.chat import ChatMessageType

  topic = "test topic"
  create_chat_thread_result = chat_client.create_chat_thread(topic)
  thread_id = create_chat_thread_result.chat_thread.id
  chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)

  content='hello world'
  sender_display_name='sender name'
  chat_message_type = ChatMessageType.TEXT


  send_message_result = chat_thread_client.send_message(content)
  send_message_result_id = send_message_result.id
  print("Message sent: id: ", send_message_result_id)


  send_message_result_w_type = chat_thread_client.send_message(
              content,
              sender_display_name=sender_display_name,
              chat_message_type=chat_message_type # equivalent to chat_message_type = 'text'
  )
  send_message_result_w_type_id = send_message_result_w_type.id
  print("Message sent: id: ", send_message_result_w_type_id)
  ```



  Use `get_message` method retrieves a message from the service; `message_id` is the unique ID of the message.
  - Use `message_id`,required, to specify message id of an existing message
  `ChatMessage` is the response returned from getting a message, it contains an id, which is the unique ID of the message, and other fields please refer to azure.communication.chat.ChatMessage

  ```python
  chat_message = chat_thread_client.get_message(message_id=send_message_result_id)
  print("get_chat_message succeeded, message id:", chat_message.id, "content: ", chat_message.content)
  ```



  Use `list_messages` method retrieves messages from the service.
  - Use `results_per_page`, optional, The maximum number of messages to be returned per page.
  - Use `start_time`, optional, The start time where the range query.

  An iterator of `[ChatMessage]` is the response returned from listing messages

  ```python
  from datetime import datetime, timedelta

  start_time = datetime.utcnow() - timedelta(days=1)

  chat_messages = chat_thread_client.list_messages(results_per_page=1, start_time=start_time)
  for chat_message_page in chat_messages.by_page():
      for chat_message in chat_message_page:
          print("ChatMessage: Id=", chat_message.id, "; Content=", chat_message.content.message)
  ```



  Use `update_message` to update a message identified by threadId and messageId.
  - Use `message_id`,required, is the unique ID of the message.
  - Use `content`, optional, is the message content to be updated; if not specified it is assigned to be empty

  ```python
  content = "updated message content"
  chat_thread_client.update_message(send_message_result_id, content=content)

  chat_message = chat_thread_client.get_message(message_id=send_message_result_id)

  assert chat_message.content.message == content
  ```



  Use `delete_message` to delete a message.
  - Use `message_id`, required, is the unique ID of the message.

  ```python
  chat_thread_client.delete_message(message_id=send_message_result_id)
  ```





  Use `list_participants` to retrieve the participants of the thread.
  - Use `results_per_page`, optional, The maximum number of participants to be returned per page.
  - Use `skip`, optional, to skips participants up to a specified position in response.

  An iterator of `[ChatParticipant]` is the response returned from listing participants

  ```python
  chat_participants = chat_thread_client.list_participants(results_per_page=5, skip=5)
  for chat_participant_page in chat_participants.by_page():
      for chat_participant in chat_participant_page:
          print("ChatParticipant: ", chat_participant)
  ```



  Use `add_participants` method to add thread participants to the thread.

  - Use `thread_participants`, required, to list the `ChatParticipant` to be added to the thread;
    - `user`, required, it is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user() from User Access Tokens
    <!-- [User Access Tokens](#user-access-tokens) -->
    - `display_name`, optional, is the display name for the thread participant.
    - `share_history_time`, optional, time from which the chat history is shared with the participant.

  A `list(tuple(ChatParticipant, ChatError))` is returned. When participant is successfully added,
  an empty list is expected. In case of an error encountered while adding participant, the list is populated
  with the failed participants along with the error that was encountered.

  ```python
  from azure.communication.identity import CommunicationIdentityClient
  from azure.communication.chat import ChatParticipant
  from datetime import datetime


  identity_client = CommunicationIdentityClient.from_connection_string('<connection_string>')
  new_users = [identity_client.create_user() for i in range(2)]












  participants = []
  for _user in new_users:
    chat_participant = ChatParticipant(
      identifier=_user,
      display_name='Fred Flinstone',
      share_history_time=datetime.utcnow()
    )
    participants.append(chat_participant)

  response = chat_thread_client.add_participants(thread_participants=participants)

  def decide_to_retry(error, **kwargs):
      """
      Insert some custom logic to decide if retry is applicable based on error
      """
      return True



  retry = [p for p, e in response if decide_to_retry(e)]
  if retry:
      chat_thread_client.add_participants(retry)
  ```



  Use `remove_participant` method to remove thread participant from the thread identified by threadId.
  `identifier` is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user() from `azure-communication-identity`
  <!-- [User Access Tokens](#user-access-tokens)  -->
  and was added into this chat thread.
  - Use `identifier` to specify the `CommunicationUserIdentifier` you created
  ```python
  chat_thread_client.remove_participant(identifier=new_user)







  ```





  Use `send_typing_notification` method to post a typing notification event to a thread, on behalf of a user.

  ```python
  chat_thread_client.send_typing_notification()
  ```



  Use `send_read_receipt` method to post a read receipt event to a thread, on behalf of a user.
  - Use `message_id` to specify the id of the message whose read receipt is to be sent
  ```python
  content='hello world'
  send_message_result = chat_thread_client.send_message(content)
  send_message_result_id = send_message_result.id
  chat_thread_client.send_read_receipt(message_id=send_message_result_id)
  ```



  Use `list_read_receipts` method retrieves read receipts for a thread.
  - Use `results_per_page`, optional, The maximum number of read receipts to be returned per page.
  - Use `skip`,optional, to skips read receipts up to a specified position in response.

  An iterator of `[ChatMessageReadReceipt]` is the response returned from listing read receipts

  ```python
  read_receipts = chat_thread_client.list_read_receipts(results_per_page=5, skip=5)

  for read_receipt_page in read_receipts.by_page():
      for read_receipt in read_receipt_page:
          print(read_receipt)
          print(read_receipt.sender)
          print(read_receipt.chat_message_id)
          print(read_receipt.read_on)
  ```



  These are code samples that show common scenario operations with the Azure Communication Chat client library.
  The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations.
  Before run the sample code, refer to Prerequisites
  <!-- [Prerequisites](#Prerequisites) -->
  to create a resource, then set some Environment Variables

  ```bash
  set AZURE_COMMUNICATION_SERVICE_ENDPOINT="https://<RESOURCE_NAME>.communcationservices.azure.com"
  set COMMUNICATION_SAMPLES_CONNECTION_STRING="<connection string of your Communication service>"

  pip install azure-communication-identity

  python samples\chat_client_sample.py
  python samples\chat_client_sample_async.py
  python samples\chat_thread_client_sample.py
  python samples\chat_thread_client_sample_async.py
  ```



  Running into issues? This section should contain details as to what to do there.



  More sample code should go [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-chat/samples), along with links out to the appropriate example tests.



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](<https://github.com/Azure/azure-sdk-for-python/issues>) section of the project.

  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Ftemplate%2Fazure-template%2FREADME.png)


pkgId: 43d705be612ba6336ee7f830b048abf3058423695e8c8bf3b331196dc68fa4f8
name: python-azure-communication-email
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Microsoft Azure MyService Management Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-email-1.0.0-1.src.rpm
checksum_type: sha256
description:
  This package contains a Python SDK for Azure Communication Services for Email.



  The Azure Communication Email package is used to send emails to multiple types of recipients.





  You need an [Azure subscription][azure_sub], a [Communication Service Resource][communication_resource_docs], and an [Email Communication Resource][email_resource_docs] with an active [Domain][domain_overview].

  To create these resource, you can use the [Azure Portal][communication_resource_create_portal], the [Azure PowerShell][communication_resource_create_power_shell], or the [.NET management client library][communication_resource_create_net].



  Install the Azure Communication Email client library for Python with [pip](https://pypi.org/project/pip/):

  ```bash
  pip install azure-communication-email
  ```



  `EmailClient` provides the functionality to send email messages.



  Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal].

  ```python
  from azure.communication.email import EmailClient

  connection_string = "endpoint=https://<resource-name>.communication.azure.com/;accessKey=<Base64-Encoded-Key>"
  client = EmailClient.from_connection_string(connection_string);
  ```

  Alternatively, you can also use Active Directory authentication using DefaultAzureCredential.

  ```python
  from azure.communication.email import EmailClient
  from azure.identity import DefaultAzureCredential


  endpoint = "https://<resource-name>.communication.azure.com"
  client = EmailClient(endpoint, DefaultAzureCredential())
  ```

  Email clients can also be authenticated using an [AzureKeyCredential][azure-key-credential].

  ```python
  from azure.communication.email import EmailClient
  from azure.core.credentials import AzureKeyCredential

  credential = AzureKeyCredential("<api_key>")
  endpoint = "https://<resource-name>.communication.azure.com/"
  client = EmailClient(endpoint, credential);
  ```



  To send an email message, call the `begin_send` function from the `EmailClient`. This will return a poller. You can use this poller to check on the status of the operation and retrieve the result once it's finished.

  ```python
  message = {
      "content": {
          "subject": "This is the subject",
          "plainText": "This is the body",
          "html": "html><h1>This is the body</h1></html>"
      },
      "recipients": {
          "to": [
              {
                  "address": "customer@domain.com",
                  "displayName": "Customer Name"
              }
          ]
      },
      "senderAddress": "sender@contoso.com"
  }

  poller = email_client.begin_send(message)
  result = poller.result()
  ```



  To send an email message to multiple recipients, add a object for each recipient type and an object for each recipient.

  ```python
  message = {
      "content": {
          "subject": "This is the subject",
          "plainText": "This is the body",
          "html": "html><h1>This is the body</h1></html>"
      },
      "recipients": {
          "to": [
              {"address": "customer@domain.com", "displayName": "Customer Name"},
              {"address": "customer2@domain.com", "displayName": "Customer Name 2"}
          ],
          "cc": [
              {"address": "ccCustomer@domain.com", "displayName": "CC Customer Name"},
              {"address": "ccCustomer2@domain.com", "displayName": "CC Customer Name 2"}
          ],
          "bcc": [
              {"address": "bccCustomer@domain.com", "displayName": "BCC Customer Name"},
              {"address": "bccCustomer2@domain.com", "displayName": "BCC Customer Name 2"}
          ]
      },
      "senderAddress": "sender@contoso.com"
  }

  poller = email_client.begin_send(message)
  result = poller.result()
  ```



  Azure Communication Services support sending email with attachments.

  ```python
  import base64

  with open("C://readme.txt", "r") as file:
      file_contents = file.read()

  file_bytes_b64 = base64.b64encode(bytes(file_contents, 'utf-8'))

  message = {
      "content": {
          "subject": "This is the subject",
          "plainText": "This is the body",
          "html": "html><h1>This is the body</h1></html>"
      },
      "recipients": {
          "to": [
              {
                  "address": "customer@domain.com",
                  "displayName": "Customer Name"
              }
          ]
      },
      "senderAddress": "sender@contoso.com",
      "attachments": [
          {
              "name": "attachment.txt",
              "attachmentType": "text/plain",
              "contentInBase64": file_bytes_b64.decode()
          }
      ]
  }

  poller = email_client.begin_send(message)
  result = poller.result()
  ```



  Email operations will throw an exception if the request to the server fails. The Email client will raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md).

  ```python
  from azure.core.exceptions import HttpResponseError

  try:
      response = email_client.send(message)
  except HttpResponseError as ex:
      print('Exception:')
      print(ex)
  ```



  - [Read more about Email in Azure Communication Services][nextsteps]



  This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].

  This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.

  <!-- LINKS -->

  [azure_sub]: https://azure.microsoft.com/free/dotnet/
  [azure_portal]: https://portal.azure.com
  [azure-key-credential]: https://aka.ms/azsdk-python-core-azurekeycredential
  [cla]: https://cla.microsoft.com
  [coc]: https://opensource.microsoft.com/codeofconduct/
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  [coc_contact]: mailto:opencode@microsoft.com
  [communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp
  [email_resource_docs]: https://aka.ms/acsemail/createemailresource
  [communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp
  [communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice
  [communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net
  [package]: https://www.nuget.org/packages/Azure.Communication.Common/
  [product_docs]: https://aka.ms/acsemail/overview
  [nextsteps]: https://aka.ms/acsemail/overview
  [nuget]: https://www.nuget.org/
  [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication
  [domain_overview]: https://aka.ms/acsemail/domainsoverview







  The public release of the Azure Communication Services SDK for Email has the following features:

  - send emails with a variety of options (multiple recipients, attachments, etc.)
  - poll for the status of the email that was sent to track its progress




  - Adding support for AAD token authentication
  - Added the ability to specify the API version by an optional `api_version` keyword parameter.


  - Made the SDK Model-less. Objects are now constructed using a dictionary instead of a model.
  - Reworked the SDK to follow the LRO (long running operation) approach. The 'begin_send' method returns a poller that can be used to check for the status of sending the email and retrieve the result. The return object has been adjusted to fit this approach.
  - The `get_send_status` method has been removed.
  - The `sender` property has been changed to `senderAddress`.
  - The `email` property under the recipient object has been changed to `address`.
  - The `attachmentType` property under `attachments` has been changed to 'contentType'. This now accepts the attachment mime type.
  - The `contentBytesBase64` property under `attachments` has been changed to `contentInBase64`
  - Custom headers in the email message are now key/value pairs.
  - The importance property was removed. Email importance can now be specified through either the `x-priority` or `x-msmail-priority` custom headers.


  Python 3.6 is no longer supported. Please use Python version 3.7 or later. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).



  The first preview of the Azure Communication Email Client has the following features:

  - send emails to multiple recipients with attachments
  - get the status of a sent message


pkgId: 4725dd135f515fd056460b142509b23affc5adc779912fbda8e040acf1bd84aa
name: python-azure-communication-identity
arch: src
version: 1.5.0
epoch: 0
release: 1
summary: Microsoft Azure Communication Identity Service Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-identity-1.5.0-1.src.rpm
checksum_type: sha256
description:
  Azure Communication Identity client package is intended to be used to setup the basics for opening a way to use Azure Communication Service offerings. This package helps to create identity user tokens to be used by other client packages such as chat, calling, sms.

  [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity)
  | [Package (Pypi)](https://pypi.org/project/azure-communication-identity/)
  | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/)
  | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-identity)
  | [Product documentation](https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-python)



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_



  - Python 3.7 or later is required to use this package.
  - You must have an [Azure subscription](https://azure.microsoft.com/free/)
  - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.

  Install the Azure Communication Identity client library for Python with [pip](https://pypi.org/project/pip/):

  ```bash
  pip install azure-communication-identity
  ```



  `CommunicationIdentityClient` provides operations for:

  - Create/delete identities to be used in Azure Communication Services. Those identities can be used to make use of Azure Communication offerings and can be scoped to have limited abilities through token scopes.

  - Create/revoke scoped user access tokens to access services such as chat, calling, sms. Tokens are issued for a valid Azure Communication identity and can be revoked at any time.


  ```python

  import os
  from azure.communication.identity import CommunicationIdentityClient
  from azure.identity import DefaultAzureCredential

  connection_str = "endpoint=ENDPOINT;accessKey=KEY"
  endpoint = "https://<RESOURCE_NAME>.communication.azure.com"



  identity_client_managed_identity = CommunicationIdentityClient(endpoint, DefaultAzureCredential())


  identity_client = CommunicationIdentityClient.from_connection_string(connection_str)

  ```


  The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:

  - [Creating a new user](#creating-a-new-user)
  - [Issuing or Refreshing an access token for a user](#issuing-or-refreshing-an-access-token-for-a-user)
  - [Creating a user and a token in a single request](#creating-a-user-and-a-token-in-a-single-request)
  - [Revoking a user's access tokens](#revoking-a-users-access-tokens)
  - [Deleting a user](#deleting-a-user)
  - [Exchanging Azure AD access token of a Teams User for a Communication Identity access token](#exchanging-azure-ad-access-token-of-a-teams-user-for-a-communication-identity-access-token)



  Use the `create_user` method to create a new user.
  ```python
  user = identity_client.create_user()
  print("User created with id:" + user.properties['id'])
  ```



  Use the `get_token` method to issue or refresh a scoped access token for the user. \
  Pass in the user object as a parameter, and a list of `CommunicationTokenScope`. Scope options are:
  - `CHAT` (Use this for full access to Chat APIs)
  - `VOIP` (Use this for full access to Calling APIs)
  - `CHAT_JOIN` (Access to Chat APIs but without the authorization to create, delete or update chat threads)
  - `CHAT_JOIN_LIMITED` (A more limited version of CHAT_JOIN that doesn't allow to add or remove participants)
  - `VOIP_JOIN` (Access to Calling APIs but without the authorization to start new calls)

  ```python
  tokenresponse = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT])
  print("Token issued with value: " + tokenresponse.token)
  ```



  You can specify expiration time for the token. The token can be configured to expire in as little as one hour or as long as 24 hours. The default expiration time is 24 hours.

  ```python
  token_expires_in = timedelta(hours=1)
  tokenresponse = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT], token_expires_in=token_expires_in)
  print("Token issued with value: " + tokenresponse.token)
  ```


  For convenience, use `create_user_and_token` to create a new user and issue a token with one function call. This translates into a single web request as opposed to creating a user first and then issuing a token.

  ```python
  user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT])
  print("User id:" + user.properties['id'])
  print("Token issued with value: " + tokenresponse.token)
  ```



  You can specify expiration time for the token. The token can be configured to expire in as little as one hour or as long as 24 hours. The default expiration time is 24 hours.
  ```python
  token_expires_in = timedelta(hours=1)
  user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT], token_expires_in=token_expires_in)
  print("User id:" + user.properties['id'])
  print("Token issued with value: " + tokenresponse.token)
  ```



  Use `revoke_tokens` to revoke all access tokens for a user. Pass in the user object as a parameter
  ```python
  identity_client.revoke_tokens(user)
  ```



  Use the `delete_user` method to delete a user. Pass in the user object as a parameter
  ```python
  identity_client.delete_user(user)
  ```



  Use the `get_token_for_teams_user` method to exchange an Azure AD access token of a Teams User for a new Communication Identity access token.
  ```python
  identity_client.get_token_for_teams_user(aad_token, client_id, user_object_id)
  ```


  The Azure Communication Service Identity client will raise exceptions defined in [Azure Core][azure_core].




  Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-identity/samples) directory for detailed examples of how to use this library to manage identities and tokens.



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project


  This project welcomes contributions and suggestions.  Most contributions require you to agree to a
  Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
  PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

  <!-- LINKS -->
  [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md


pkgId: f1ba93b8dc5f49ae6093af6ba438c8d8e3cf3c54d2e7115092ed18818413aa66
name: python-azure-communication-phonenumbers
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Microsoft Azure Communication Phone Numbers Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-phonenumbers-1.1.0-1.src.rpm
checksum_type: sha256
description:
  Azure Communication Phone Numbers client package is used to administer Phone Numbers.



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_



  - Python 3.7 or later is required to use this package.
  - You must have an [Azure subscription](https://azure.microsoft.com/free/)
  - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.

  Install the Azure Communication Phone Numbers client library for Python with [pip](https://pypi.org/project/pip/):

  ```bash
  pip install azure-communication-phonenumbers
  ```



  This SDK provides functionality to easily manage `direct offer` and `direct routing` numbers.

  The `direct offer` numbers come in two types: Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
  They are managed using the `PhoneNumbersClient`

  The `direct routing` feature enables connecting your existing telephony infrastructure to ACS.
  The configuration is managed using the `SipRoutingClient`, which provides methods for setting up SIP trunks and voice routing rules, in order to properly handle calls for your telephony subnet.


  Client can be initialized using the AAD authentication.

  ```python
  import os
  from azure.communication.phonenumbers import PhoneNumbersClient
  from azure.identity import DefaultAzureCredential

  endpoint = "https://<RESOURCE_NAME>.communication.azure.com"


  phone_numbers_client = PhoneNumbersClient(endpoint, DefaultAzureCredential())
  ```

  ```python
  import os
  from azure.communication.phonenumbers.siprouting import SipRoutingClient
  from azure.identity import DefaultAzureCredential

  endpoint = "https://<RESOURCE_NAME>.communication.azure.com"


  sip_routing_client = SipRoutingClient(endpoint, DefaultAzureCredential())
  ```

  Another option is to initialize the client using connection string of the resource.

  ```python

  import os
  from azure.communication.phonenumbers import PhoneNumbersClient

  connection_str = "endpoint=ENDPOINT;accessKey=KEY"
  phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str)
  ```

  ```python

  import os
  from azure.communication.phonenumbers.siprouting import SipRoutingClient

  connection_str = "endpoint=ENDPOINT;accessKey=KEY"
  sip_routing_client = SipRoutingClient.from_connection_string(connection_str)
  ```





  Phone numbers come in two types; Geographic and Toll-Free. Geographic phone numbers are phone numbers associated with a location, whose area codes are associated with the area code of a geographic location. Toll-Free phone numbers are phone numbers with no associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.



  Phone numbers can be searched through the search creation API by providing an area code, quantity of phone numbers, application type, phone number type, and capabilities. The provided quantity of phone numbers will be reserved for ten minutes and can be purchased within this time. If the search is not purchased, the phone numbers will become available to others after ten minutes. If the search is purchased, then the phone numbers are acquired for the Azure resources.

  Phone numbers can also be released using the release API.



  Direct routing feature allows connecting customer-provided telephony infrastructure to Azure Communication Resources. In order to setup routing configuration properly, customer needs to supply the SIP trunk configuration and SIP routing rules for calls. SIP routing client provides the necessary interface for setting this configuration.

  When a call is made, system tries to match the destination number with regex number patterns of defined routes. The first route to match the number will be selected. The order of regex matching is the same as the order of routes in configuration, therefore the order of routes matters.
  Once a route is matched, the call is routed to the first trunk in the route's trunks list. If the trunk is not available, next trunk in the list is selected.







  Lists all of your purchased phone numbers

  ```python
  purchased_phone_numbers = phone_numbers_client.list_purchased_phone_numbers()
  for acquired_phone_number in purchased_phone_numbers:
      print(acquired_phone_number.phone_number)
  ```



  Gets the information from the specified phone number

  ```python
  result = phone_numbers_client.get_purchased_phone_number("<phone number>")
  print(result.country_code)
  print(result.phone_number)
  ```



  The Phone Number Client supports a variety of long running operations that allow indefinite polling time to the functions listed down below.



  You can search for available phone numbers by providing the capabilities of the phone you want to acquire, the phone number type, the assignment type, and the country code. It's worth mentioning that for the toll-free phone number type, proving the area code is optional.
  The result of the search can then be used to purchase the number in the corresponding API.

  ```python
  capabilities = PhoneNumberCapabilities(
          calling = PhoneNumberCapabilityType.INBOUND,
          sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND
      )
  poller = phone_numbers_client.begin_search_available_phone_numbers(
      "US",
      PhoneNumberType.TOLL_FREE,
      PhoneNumberAssignmentType.APPLICATION,
      capabilities,
      area_code ="833", # Area code is optional for toll-free numbers
      quantity = 2, # Quantity is optional. If not set, default is 1
      polling = True
  )
  search_result = poller.result()
  ```



  The result of your search can be used to purchase the specified phone numbers. This can be done by passing the `search_id` from the search response to the purchase phone number API.

  ```python
  purchase_poller = phone_numbers_client.begin_purchase_phone_numbers(
      search_result.search_id,
      polling=True
  )
  ```



  Releases an acquired phone number.

  ```python
  poller = self.phone_number_client.begin_release_phone_number(
      "<phone number>",
      polling = True
  )
  ```



  Updates the specified phone number capabilities for Calling and SMS to one of:

  - `PhoneNumberCapabilityType.NONE`
  - `PhoneNumberCapabilityType.INBOUND`
  - `PhoneNumberCapabilityType.OUTBOUND`
  - `PhoneNumberCapabilityType.INBOUND_OUTBOUND`

  ```python
  poller = self.phone_number_client.begin_update_phone_number_capabilities(
      "<phone number>",
      PhoneNumberCapabilityType.OUTBOUND,
      PhoneNumberCapabilityType.INBOUND_OUTBOUND,
      polling = True
  )
  ```





  Get the list of currently configured trunks or routes.

  ```python
  trunks = sip_routing_client.list_trunks()
  for trunk in trunks:
      print(trunk.fqdn)
      print(trunk.sip_signaling_port)
  routes = sip_routing_client.list_routes()
  for route in routes:
      print(route.name)
      print(route.description)
      print(route.number_pattern)
      for trunk_fqdn in route.trunks:
          print(trunk_fqdn)
  ```



  Replace the list of currently configured trunks or routes with new values.

  ```python
  new_trunks = [SipTrunk(fqdn="sbs1.contoso.com", sip_signaling_port=1122), SipTrunk(fqdn="sbs2.contoso.com", sip_signaling_port=1123)]
  new_routes = [SipTrunkRoute(name="First rule", description="Handle numbers starting with '+123'", number_pattern="\+123[0-9]+", trunks=["sbs1.sipconfigtest.com"])]
  sip_routing_client.set_trunks(new_trunks)
  sip_routing_client.set_routes(new_routes)
  ```



  ```python
  trunk = sip_routing_client.get_trunk("sbs1.contoso.com")
  ```



  ```python


  new_trunk = SipTrunk(fqdn="sbs3.contoso.com", sip_signaling_port=5555)
  sip_routing_client.set_trunk(new_trunk)
  ```



  ```python
  sip_routing_client.delete_trunk("sbs1.contoso.com")
  ```


  The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core].




  Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-phonenumbers/samples) directory for detailed examples of how to use this library.



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project


  This project welcomes contributions and suggestions.  Most contributions require you to agree to a
  Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
  PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

  <!-- LINKS -->
  [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md


pkgId: 4bf6caef25e2b67bd93e94c29e09eae03d6b589e01c6b8c99ffd14b3b4b4e53d
name: python-azure-communication-rooms
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Microsoft Communication Rooms Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-rooms
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-rooms-1.1.0-1.src.rpm
checksum_type: sha256
description:
  This package contains a Python SDK for Azure Communication Services for Rooms.
  Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview)



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please
  refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_



  The Azure Communication Rooms package is used to do following:
  - Create scheduled meetings
  - Create meetings with managed permissions for its participants




  ```bash
  python -m pip install azure-communication-rooms
  ```



  - Python 3.7 or later is required to use this package.
  - You need an [Azure subscription][azure_sub] to use this package.
  - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.




  To initialize the Rooms Client, the connection string can be used to instantiate.

  ```python
  from azure.communication.rooms import RoomsClient

  client = RoomsClient.from_connection_string(conn_str='<connection_str>' )
  ```




  - `valid_from`: A datetime object from which room will start existing
  - `valid_until`: A datetime object after which room meeting would end
  - `participants`: A list of `RoomParticipant`s containing MRI's of invitees to the room as well as optional `ParticipantRole`. If `ParticipantRole` is not specified, then it will be `Attendee` by default.
  All the above attributes are optional. The service provides default values of valid_until and
  valid_from if they are missing. The default for`valid_from` is current date time and the default for `valid_until` is `valid_from + 180 days`.
  - `pstn_dial_out_enabled`: Set this flag to true if, at the time of the call, dial out to a PSTN number is enabled in a particular room. This flag is optional.


  To create a room, call the `create_room` function from `RoomsClient`. The `valid_from`, `valid_until`, and `participants` arguments are all optional.
  Starting in 1.1.0 release, ACS Rooms supports PSTN Dial-Out feature. To create room with PSTN Dial-Out property, call `create_room` function and set `pstn_dial_out_enabled` to either true or false. If `pstn_dial_out_enabled` is not provided, then the default value for `pstn_dial_out_enabled` is false.

  ```python
  from azure.core.exceptions import HttpResponseError
  from datetime import datetime, timedelta
  from azure.communication.rooms import (
      RoomsClient,
      RoomParticipant,
      ParticipantRole
  )
  from azure.communication.identity import CommunicationUserIdentifier
  from dateutil.relativedelta import relativedelta

  client = RoomsClient.from_connection_string(conn_str='<connection_str>')
  valid_from = datetime.now()
  valid_until = valid_from + relativedelta(months=+1)
  participants = []
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 1>")))
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 2>"), role=ParticipantRole.CONSUMER))
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 3>"), role=ParticipantRole.PRESENTER))

  try:
      create_room_response = client.create_room(
          valid_from=valid_from,
          valid_until=valid_until,
          participants=participants,
          pstn_dial_out_enabled=false

      )
  except HttpResponseError as ex:
      print(ex)
  ```

  The `valid_from` and `valid_until` properties of a created room can be updated by calling the `update_room` function from `RoomsClient`.
  Starting in 1.1.0 release, ACS Rooms supports PSTN Dial-Out feature. To update a room with PSTN Dial-Out property, call `update_room` and set `pstn_dial_out_enabled` to either true or false. If `pstn_dial_out_enabled`  is not provided, then there is no changes to PstnDialOutEnabled property in the room.

  ```python
  try:
      update_room_response = client.update_room(
          room_id="id of the room to be updated",
          valid_from=datetime.now(),
          valid_until=valid_from + timedelta(weeks=4),
          pstn_dial_out_enabled=false
      )
  except HttpResponseError as e:
      print('service responds error: {}'.format(e))

  ```


  A created room can be retrieved by calling the `get_room` function from `RoomsClient` and passing in the associated `room_id`.

  ```python
  try:
      get_room_response = client.get_room(room_id="id of the room to get")
  except HttpResponseError as ex:
      print(ex)
  ```


  Retrieve all valid rooms created with an ACS resource by calling the `list_rooms` function from `RoomsClient`.

  ```python
  try:
      list_room_response = client.list_rooms()
  except HttpResponseError as ex:
      print(ex)
  ```


  To delete a room, call the `delete_room` function from RoomsClient.

  ```python
  try:
      client.delete_room(
          room_id="id of the room to be deleted")
  except HttpResponseError as e:
      print('service responds error: {}'.format(e))

  ```


  In order to insert new participants or update existing participants, call the `add_or_update_participants` function from RoomsClient.

  ```python
  participants = []
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 1>")))
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 2>"), role=ParticipantRole.ATTENDEE))
  participants.append(RoomParticipant(communication_identifier=CommunicationUserIdentifier("<ACS User MRI identity 3>"), role=ParticipantRole.CONSUMER))
  try:
      response = client.add_or_update_participants(
          room_id="id of the room to be updated",
          participants=participants
      )
  except HttpResponseError as e:
      print('service responds error: {}'.format(e))
  ```


  Remove participants from a room by calling the `remove_participants` function from RoomsClient.

  ```python
  communication_identifiers = [CommunicationUserIdentifier("<ACS User MRI identity 2>")]

  try:
      remove_participants_response = client.remove_participants(
          room_id="id of the room to remove participants",
          participants=communication_identifiers
      )
  except HttpResponseError as ex:
      print(ex)
  ```

  Retrieve the list of participants for an existing room by referencing the `room_id`:

  ```python
  try:
      participants = client.list_participants(room_id="id of the room to list participants")
  except HttpResponseError as ex:
      print(ex)
  ```


  Rooms operations will throw an exception if the request to the server fails. The Rooms client will raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md).



  Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-rooms/samples) directory for detailed examples of how to use this library to create and manage rooms.



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
  see the Code of Conduct FAQ or contact opencode@microsoft.com with any
  additional questions or comments.

  <!-- LINKS -->
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
  [authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
  [azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
  [azure_identity_pip]: https://pypi.org/project/azure-identity/
  [default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
  [pip]: https://pypi.org/project/pip/
  [azure_sub]: https://azure.microsoft.com/free/


pkgId: dade403424645b9ebf9eac9a6a12476bbe4c464ca9167006bdf3223d8b0a2261
name: python-azure-communication-sms
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: Microsoft Azure Communication SMS Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-communication-sms-1.1.0-1.src.rpm
checksum_type: sha256
description:
  This package contains a Python SDK for Azure Communication Services for SMS.
  Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview)

  [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-sms)
  | [Package (Pypi)](https://pypi.org/project/azure-communication-sms/)
  | [Package (Conda)](https://anaconda.org/microsoft/azure-communication/)
  | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-sms)
  | [Product documentation](https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python)



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_





  - Python 3.7 or later is required to use this package.
  - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.
  - You must have a phone number configured that is associated with an Azure subscription



  Install the Azure Communication SMS client library for Python with [pip](https://pypi.org/project/pip/):

  ```bash
  pip install azure-communication-sms
  ```



  Azure Communication SMS package is used to do following:
  - Send a 1:1 SMS Message
  - Send a 1:N SMS Message



  The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:

  - [Client Initialization](#client-initialization)
  - [Send a 1:1 SMS Message](#send-a-11-sms-message)
  - [Send a 1:N SMS Message](#send-a-1n-sms-message)



  To initialize the SMS Client, the connection string can be used to instantiate.
  Alternatively, you can also use Active Directory authentication using DefaultAzureCredential.

  ```python
  from azure.communication.sms import SmsClient
  from azure.identity import DefaultAzureCredential

  connection_str = "endpoint=ENDPOINT;accessKey=KEY"
  sms_client = SmsClient.from_connection_string(connection_string)



  endpoint = "https://<RESOURCE_NAME>.communication.azure.com"
  sms_client = SmsClient(endpoint, DefaultAzureCredential())
  ```



  Once the client is initialized, the `send` method can be invoked:

  ```python
  from azure.communication.sms import SendSmsOptions

  sms_responses = sms_client.send(
      from_="<from-phone-number>",
      to="<to-phone-number-1>",
      message="Hello World via SMS",
      enable_delivery_report=True, # optional property
      tag="custom-tag") # optional property
  ```

  - `from_`: An SMS enabled phone number associated with your communication service.
  - `to`: The phone number or list of phone numbers you wish to send a message to.
  - `message`: The message that you want to send.
  - `enable_delivery_report`: An optional parameter that you can use to configure delivery reporting. This is useful for scenarios where you want to emit events when SMS messages are delivered.
  - `tag`: An optional parameter that you can use to configure custom tagging.



  Once the client is initialized, the `send` method can be invoked:

  ```python
  from azure.communication.sms import SendSmsOptions

  sms_responses = sms_client.send(
      from_="<from-phone-number>",
      to=["<to-phone-number-1>", "<to-phone-number-2>", "<to-phone-number-3>"],
      message="Hello World via SMS",
      enable_delivery_report=True, # optional property
      tag="custom-tag") # optional property
  ```

  - `from_`: An SMS enabled phone number associated with your communication service.
  - `to`: The phone number or list of phone numbers you wish to send a message to.
  - `message`: The message that you want to send.
  - `enable_delivery_report`: An optional parameter that you can use to configure delivery reporting. This is useful for scenarios where you want to emit events when SMS messages are delivered.
  - `tag`: An optional parameter that you can use to configure custom tagging.



  SMS operations will throw an exception if the request to the server fails. The SMS client will raise exceptions defined in [Azure Core](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md). Exceptions will not be thrown if the error is caused by an individual message, only if something fails with the overall request. Please use the successful flag to validate each individual result to verify if the message was sent.

  ```python
  try:
      sms_responses = sms_client.send(
          from_="<leased-phone-number>",
          to=["<to-phone-number-1>", "<to-phone-number-2>", "<to-phone-number-3>"],
          message="Hello World via SMS")

      for sms_response in sms_responses:
          if (sms_response.successful):
              print("Message with message id {} was successful sent to {}"
              .format(sms_response.message_id, sms_response.to))
          else:
              print("Message failed to send to {} with the status code {} and error: {}"
              .format(sms_response.to, sms_response.http_status_code, sms_response.error_message))
  except Exception as ex:
      print('Exception:')
      print(ex)
  ```


  - [Read more about SMS in Azure Communication Services][next_steps]
  - For a basic guide on how to configure Delivery Reporting for your SMS messages please refer to the [Handle SMS Events quickstart][handle_sms_events].



  Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-sms/samples) directory for detailed examples of how to use this library to send an sms.



  If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project



  This project welcomes contributions and suggestions.  Most contributions require you to agree to a
  Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
  PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

  <!-- LINKS -->
  [azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md
  [handle_sms_events]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events
  [next_steps]:https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-python


pkgId: 4bde52a988f6e8c1b278cb6110217cca91eba3eb92c2c17b6a6914fc0d2730fb
name: python-azure-confidentialledger
arch: src
version: 1.1.1
epoch: 0
release: 1
summary: Microsoft Azure Confidential Ledger Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-confidentialledger-1.1.1-1.src.rpm
checksum_type: sha256
description:
  Azure Confidential Ledger provides a service for logging to an immutable, tamper-proof ledger. As part of the [Azure Confidential Computing][azure_confidential_computing] portfolio, Azure Confidential Ledger runs in secure, hardware-based trusted execution environments, also known as enclaves. It is built on Microsoft Research's [Confidential Consortium Framework][ccf].

  [Source code][confidential_ledger_client_src]
  | [Package (PyPI)][pypi_package_confidential_ledger]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-confidentialledger/)
  | [API reference documentation][reference_docs]
  | [Product documentation][confidential_ledger_docs]



  Install [azure-confidentialledger][pypi_package_confidential_ledger] and [azure-identity][azure_identity_pypi] with [pip][pip]:
  ```Bash
  pip install azure-identity azure-confidentialledger
  ```
  [azure-identity][azure_identity] is used for Azure Active Directory
  authentication as demonstrated below.


  * An [Azure subscription][azure_sub]
  * Python 3.6 or later
  * A running instance of Azure Confidential Ledger.
  * A registered user in the Confidential Ledger, typically assigned during [ARM][azure_resource_manager] resource creation, with `Administrator` privileges.



  This document demonstrates using [DefaultAzureCredential][default_cred_ref] to authenticate to the Confidential Ledger via Azure Active Directory. However, `ConfidentialLedgerClient` accepts any [azure-identity][azure_identity] credential. See the [azure-identity][azure_identity] documentation for more information about other credentials.


  As an alternative to Azure Active Directory, clients may choose to use a client certificate to authenticate via mutual TLS. `azure.confidentialledger.ConfidentialLedgerCertificateCredential` may be used for this purpose.


  `DefaultAzureCredential` will automatically handle most Azure SDK client scenarios. To get started, set environment variables for the AAD identity registered with your Confidential Ledger.
  ```bash
  export AZURE_CLIENT_ID="generated app id"
  export AZURE_CLIENT_SECRET="random password"
  export AZURE_TENANT_ID="tenant id"
  ```
  Then, `DefaultAzureCredential` will be able to authenticate the `ConfidentialLedgerClient`.

  Constructing the client also requires your Confidential Ledger's URL and id, which you can get from the Azure CLI or the Azure Portal. When you have retrieved those values, please replace instances of `"my-ledger-id"` and `"https://my-ledger-id.confidential-ledger.azure.com"` in the examples below. You may also need to replace `"https://identity.confidential-ledger.core.azure.com"` with the hostname from the `identityServiceUri` in the ARM description of your ledger.

  Because Confidential Ledgers use self-signed certificates securely generated and stored in an enclave, the signing certificate for each Confidential Ledger must first be retrieved from the Confidential Ledger Identity Service.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )
  ```

  Conveniently, the `ConfidentialLedgerClient` constructor will fetch the ledger TLS certificate (and write it to the specified file) if it is provided with a non-existent file. The user is responsible for removing the created file as needed.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.identity import DefaultAzureCredential

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path="ledger_certificate.pem"
  )


  ```

  To make it clear that a file is being used for the ledger TLS certificate, subsequent examples will explicitly write the ledger TLS certificate to a file.



  Every write to Azure Confidential Ledger generates an immutable ledger entry in the service. Writes, also referred to as transactions, are uniquely identified by transaction ids that increment with each write. Once written, ledger entries may be retrieved at any time.


  While most use cases involve just one collection per Confidential Ledger, we provide the collection id feature in case semantically or logically different groups of data need to be stored in the same Confidential Ledger.

  Ledger entries are retrieved by their `collectionId`. The Confidential Ledger will always assume a constant, service-determined `collectionId` for entries written without a `collectionId` specified.


  Users are managed directly with the Confidential Ledger instead of through Azure. Users may be AAD-based, identified by their AAD object id, or certificate-based, identified by their PEM certificate fingerprint.



  To enforce transaction integrity guarantees, an Azure Confidential Ledger uses a [Merkle tree][merkle_tree_wiki] data structure to record the hash of all transactions blocks that are appended to the immutable ledger. After a write transaction is committed, Azure Confidential Ledger users can get a cryptographic Merkle proof, or receipt, over the entry produced in a Confidential Ledger to verify that the write operation was correctly saved. A write transaction receipt is proof that the system has committed the corresponding transaction and can be used to verify that the entry has been effectively appended to the ledger.

  Please refer to the following [article](https://learn.microsoft.com/azure/confidential-ledger/write-transaction-receipts) for more information about Azure Confidential Ledger write transaction receipts.



  After getting a receipt for a write transaction, Azure Confidential Ledger users can verify the contents of the fetched receipt following a verification algorithm. The success of the verification is proof that the write operation associated to the receipt was correctly appended into the immutable ledger.

  Please refer to the following [article](https://learn.microsoft.com/azure/confidential-ledger/verify-write-transaction-receipts) for more information about the verification process for Azure Confidential Ledger write transaction receipts.


  Azure Confidential Ledger applications can attach arbitrary data, called application claims, to write transactions. These claims represent the actions executed during a write operation. When attached to a transaction, the SHA-256 digest of the claims object is included in the ledger and committed as part of the write transaction. This guarantees that the digest is signed in place and cannot be tampered with.

  Later, application claims can be revealed in their un-digested form in the receipt payload corresponding to the same transaction where they were added. This allows users to leverage the information in the receipt to re-compute the same claims digest that was attached and signed in place by the Azure Confidential Ledger instance during the transaction. The claims digest can be used as part of the write transaction receipt verification process, providing an offline way for users to fully verify the authenticity of the recorded claims.

  More details on the application claims format and the digest computation algorithm can be found at the following links:

  - [Azure Confidential Ledger application claims](https://learn.microsoft.com/azure/confidential-ledger/write-transaction-receipts#application-claims)
  - [Azure Confidential Ledger application claims digest verification](https://learn.microsoft.com/azure/confidential-ledger/verify-write-transaction-receipts#verify-application-claims-digest)

  Please refer to the following CCF documentation pages for more information about CCF Application claims:

  - [Application Claims](https://microsoft.github.io/CCF/main/use_apps/verify_tx.html#application-claims)
  - [User-Defined Claims in Receipts](https://microsoft.github.io/CCF/main/build_apps/example_cpp.html#user-defined-claims-in-receipts)


  [Azure Confidential Computing][azure_confidential_computing] allows you to isolate and protect your data while it is being processed in the cloud. Azure Confidential Ledger runs on Azure Confidential Computing virtual machines, thus providing stronger data protection with encryption of data in use.


  Azure Confidential Ledger is built on Microsoft Research's open-source [Confidential Consortium Framework (CCF)][ccf]. Under CCF, applications are managed by a consortium of members with the ability to submit proposals to modify and govern application operation. In Azure Confidential Ledger, Microsoft Azure owns an operator member identity that allows it to perform governance and maintenance actions like replacing unhealthy nodes in the Confidential Ledger and upgrading the enclave code.


  This section contains code snippets covering common tasks, including:
  - [Append entry](#append-entry)
  - [Retrieving ledger entries](#retrieving-ledger-entries)
  - [Making a ranged query](#making-a-ranged-query)
  - [Managing users](#managing-users)
  - [Using certificate authentication](#using-certificate-authentication)
  - [Verify write transaction receipts](#verify-write-transaction-receipts)


  Data that needs to be stored immutably in a tamper-proof manner can be saved to Azure Confidential Ledger by appending an entry to the ledger.

  Since Confidential Ledger is a distributed system, rare transient failures may cause writes to be lost. For entries that must be preserved, it is advisable to verify that the write became durable. For less important writes where higher client throughput is preferred, the wait step may be skipped.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  post_entry_result = ledger_client.create_ledger_entry(
          {"contents": "Hello world!"}
      )
  transaction_id = post_entry_result["transactionId"]

  wait_poller = ledger_client.begin_wait_for_commit(transaction_id)
  wait_poller.wait()
  print(f'Ledger entry at transaction id {transaction_id} has been committed successfully')
  ```

  Alternatively, the client may wait for commit when writing a ledger entry.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  post_poller = ledger_client.begin_create_ledger_entry(
      {"contents": "Hello world again!"}
  )
  new_post_result = post_poller.result()
  print(
      'The new ledger entry has been committed successfully at transaction id '
      f'{new_post_result["transactionId"]}'
  )
  ```


  Getting ledger entries older than the latest may take some time as the service is loading historical entries, so a poller is provided.

  Ledger entries are retrieved by collection. The returned value is the value contained in the specified collection at the point in time identified by the transaction id.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  post_poller = ledger_client.begin_create_ledger_entry(
      {"contents": "Original hello"}
  )
  post_result = post_poller.result()

  post_transaction_id = post_result["transactionId"]

  latest_entry = ledger_client.get_current_ledger_entry()
  print(
      f'Current entry (transaction id = {latest_entry["transactionId"]}) '
      f'in collection {latest_entry["collectionId"]}: {latest_entry["contents"]}'
  )

  post_poller = ledger_client.begin_create_ledger_entry(
      {"contents": "Hello!"}
  )
  post_result = post_poller.result()

  get_entry_poller = ledger_client.begin_get_ledger_entry(post_transaction_id)
  older_entry = get_entry_poller.result()
  print(
      f'Contents of {older_entry["entry"]["collectionId"]} at {post_transaction_id}: {older_entry["entry"]["contents"]}'
  )
  ```


  Ledger entries may be retrieved over a range of transaction ids. Entries will only be returned from the default or specified collection.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  post_poller = ledger_client.begin_create_ledger_entry(
      {"contents": "First message"}
  )
  first_transaction_id = post_poller.result()["transactionId"]

  for i in range(10):
      ledger_client.create_ledger_entry(
          {"contents": f"Message {i}"}
      )

  post_poller = ledger_client.begin_create_ledger_entry(
      {"contents": "Last message"}
  )
  last_transaction_id = post_poller.result()["transactionId"]

  ranged_result = ledger_client.list_ledger_entries(
      from_transaction_id=first_transaction_id,
      to_transaction_id=last_transaction_id,
  )
  for entry in ranged_result:
      print(f'Contents at {entry["transactionId"]}: {entry["contents"]}')
  ```


  Users with `Administrator` privileges can manage users of the Confidential Ledger directly with the Confidential Ledger itself. Available roles are `Reader` (read-only), `Contributor` (read and write), and `Administrator` (read, write, and add or remove users).

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  user_id = "some AAD object id"
  user = ledger_client.create_or_update_user(
      user_id, {"assignedRole": "Contributor"}
  )


  user = ledger_client.get_user(user_id)
  assert user["userId"] == user_id
  assert user["assignedRole"] == "Contributor"

  ledger_client.delete_user(user_id)


  user_id = "PEM certificate fingerprint"
  user = ledger_client.create_or_update_user(
      user_id, {"assignedRole": "Reader"}
  )

  user = ledger_client.get_user(user_id)
  assert user["userId"] == user_id
  assert user["assignedRole"] == "Reader"

  ledger_client.delete_user(user_id)
  ```


  Clients may authenticate with a client certificate in mutual TLS instead of via an Azure Active Directory token. `ConfidentialLedgerCertificateCredential` is provided for such clients.

  ```python
  from azure.confidentialledger import (
      ConfidentialLedgerCertificateCredential,
      ConfidentialLedgerClient,
  )
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = ConfidentialLedgerCertificateCredential(
      certificate_path="Path to user certificate PEM file"
  )
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )
  ```



  Clients can leverage the receipt verification library in the SDK to verify write transaction receipts issued by Azure Confidential Legder instances. The utility can be used to fully verify receipts offline as the verification algorithm does not require to be connected to a Confidential ledger or any other Azure service.

  Once a new entry has been appended to the ledger (please refer to [this example](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/confidentialledger/azure-confidentialledger#append-entry)), it is possible to get a receipt for the committed write transaction.

  ```python
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential


  ledger_id = "my-ledger-id"


  credential = DefaultAzureCredential()



  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id=ledger_id
  )


  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])


  ledger_client = ConfidentialLedgerClient(
      endpoint=f"https://{ledger_id}.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )



  get_receipt_poller = ledger_client.begin_get_receipt(transaction_id)
  get_receipt_result = get_receipt_poller.result()

  print(f"Write receipt for transaction id {transaction_id} was successfully retrieved: {get_receipt_result}")
  ```

  After fetching a receipt for a write transaction, it is possible to call the `verify_receipt` function to verify that the receipt is valid. The function can accept an optional list of application claims to verify against the receipt claims digest.

  ```python
  from azure.confidentialledger.receipt import (
      verify_receipt,
  )


  with open(ledger_tls_cert_file_name, "r") as service_cert_file:
      service_cert_content = service_cert_file.read()


  application_claims = get_receipt_result.get("applicationClaims", None)

  try:
      
      verify_receipt(get_receipt_result["receipt"], service_cert_content, application_claims=application_claims)
      print(f"Receipt for transaction id {transaction_id} successfully verified")
  except ValueError:
      print(f"Receipt verification for transaction id {transaction_id} failed")
  ```

  A full sample Python program that shows how to append a new entry to a running Confidential Ledger instance, get a receipt for the committed transaction, and verify the receipt contents can be found under the [samples](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples) folder: [get_and_verify_receipt.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/get_and_verify_receipt.py).


  This library includes a complete async API supported on Python 3.5+. To use it, you must first install an async transport, such as [aiohttp](https://pypi.org/project/aiohttp). See the [azure-core documentation](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#transport) for more information.

  An async client is obtained from `azure.confidentialledger.aio`. Methods have the same names and signatures as the synchronous client. Samples may be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples).



  Confidential Ledger clients raise exceptions defined in [azure-core][azure_core_exceptions]. For example, if you try to get a transaction that doesn't exist, `ConfidentialLedgerClient` raises [ResourceNotFoundError](https://aka.ms/azsdk-python-core-exceptions-resource-not-found-error):

  ```python
  from azure.core.exceptions import ResourceNotFoundError
  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()
  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name
  )

  try:
      ledger_client.begin_get_ledger_entry(
          transaction_id="10000.100000"  # Using a very high id that probably doesn't exist in the ledger if it's relatively new.
      )
  except ResourceNotFoundError as e:
      print(e.message)
  ```


  This library uses the standard
  [logging](https://docs.python.org/3.5/library/logging.html) library for logging. Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.

  Detailed DEBUG level logging, including request/response bodies and unredacted headers, can be enabled on a client with the `logging_enable` argument:
  ```python
  import logging
  import sys

  from azure.confidentialledger import ConfidentialLedgerClient
  from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient
  from azure.identity import DefaultAzureCredential


  logger = logging.getLogger('azure')
  logger.setLevel(logging.DEBUG)


  handler = logging.StreamHandler(stream=sys.stdout)
  logger.addHandler(handler)

  identity_client = ConfidentialLedgerCertificateClient()
  network_identity = identity_client.get_ledger_identity(
      ledger_id="my-ledger-id"
  )

  ledger_tls_cert_file_name = "ledger_certificate.pem"
  with open(ledger_tls_cert_file_name, "w") as cert_file:
      cert_file.write(network_identity["ledgerTlsCertificate"])

  credential = DefaultAzureCredential()


  ledger_client = ConfidentialLedgerClient(
      endpoint="https://my-ledger-id.confidential-ledger.azure.com",
      credential=credential,
      ledger_certificate_path=ledger_tls_cert_file_name,
      logging_enable=True,
  )
  ```

  Similarly, `logging_enable` can enable detailed logging for a single operation, even when it isn't enabled for the client:
  ```python
  ledger_client.get_current_ledger_entry(logging_enable=True)
  ```



  These code samples show common scenario operations with the Azure Confidential Ledger client library.



  - Writing to the ledger:
    - [write_to_ledger.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/write_to_ledger.py)
    - [write_to_ledger_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/write_to_ledger_async.py) (async version)

  - Write many ledger entries and retrieve them all afterwards:
    - [list_ledger_entries.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/list_ledger_entries.py)
    - [list_ledger_entries_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/list_ledger_entries_async.py) (async version)

  - Manage users using service-implemented role-based access control:
    - [manage_users.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/manage_users.py)
    - [manage_users_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/manage_users_async.py) (async version)



  - Using collections:
    - [use_collections.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/use_collections.py)
    - [use_collections_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/use_collections_async.py) (async version)

  - Getting receipts for ledger writes:
    - [get_receipt.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/get_receipt.py)
    - [get_receipt_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/get_receipt_async.py) (async version)

  - Verifying service details:
    - [verify_service.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/verify_service.py)
    - [verify_service_async.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/confidentialledger/azure-confidentialledger/samples/verify_service_async.py) (async version)


  For more extensive documentation on Azure Confidential Ledger, see the
  [API reference documentation][reference_docs]. You may also read more about Microsoft Research's open-source [Confidential Consortium Framework][ccf].


  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit https://cla.microsoft.com.

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct].
  For more information, see the
  [Code of Conduct FAQ][code_of_conduct_faq] or
  contact opencode@microsoft.com with any additional questions or comments.


  [azure_cli]: https://docs.microsoft.com/cli/azure
  [azure_cloud_shell]: https://shell.azure.com/bash
  [azure_confidential_computing]: https://azure.microsoft.com/solutions/confidential-compute
  [azure_core_exceptions]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core#azure-core-library-exceptions
  [azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity
  [azure_identity_pypi]: https://pypi.org/project/azure-identity/
  [azure_resource_manager]: https://docs.microsoft.com/azure/azure-resource-manager/management/overview
  [azure_sub]: https://azure.microsoft.com/free
  [ccf]: https://github.com/Microsoft/CCF
  [code_of_conduct]: https://opensource.microsoft.com/codeofconduct
  [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq
  [confidential_ledger_client_src]: https://aka.ms/azsdk/python/confidentialledger/src
  [confidential_ledger_docs]: https://aka.ms/confidentialledger-servicedocs
  [default_cred_ref]: https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
  [pip]: https://pypi.org/project/pip/
  [pypi_package_confidential_ledger]: https://aka.ms/azsdk/python/confidentialledger/pypi
  [reference_docs]: https://aka.ms/azsdk/python/confidentialledger/ref-docs






  - Allow some `ResourceNotFoundError` occurrences in `begin_wait_for_commit` to account for unexpected loss of session stickiness. These errors may occur when the connected node changes and transactions have not been fully replicated.




  - Add `azure.confidentialledger.receipt` module for Azure Confidential Ledger write transaction receipt verification.
  - Add `verify_receipt` function to verify write transaction receipts from a receipt JSON object. The function accepts an optional, keyword-only, list of application claims parameter, which can be used to compute the claims digest from the given claims: the verification would fail if the computed digest value does not match the `claimsDigest` value present in the receipt.
  - Add `compute_claims_digest` function to compute the claims digest from a list of application claims JSON objects.
  - Add sample code to get and verify a write receipt from a running Confidential Ledger instance.
  - Update README with examples and documentation for receipt verification and application claims.


  - Add dependency on Python `cryptography` library (`>= 2.1.4`)
  - Add tests for receipt verification models and receipt verification public method.
  - Add tests for application claims models and digest computation public method.



  GA Data Plane Python SDK for Confidential Ledger.


  - User ids that are certificate fingerprints are no longer URL-encoded in the request URI.


  - Removed all models. Methods now return JSON directly.
  - `sub_ledger_id` fields are now named `collection_id`.
  - `azure.confidentialledger.identity_service` has been renamed to `azure.confidentialledger.certificate`.
  - `ConfidentialLedgerIdentityServiceClient` is now `ConfidentialLedgerCertificateClient`.
  - `post_ledger_entry` has been renamed to `create_ledger_entry`.


  - Python 2.7 is no longer supported. Please use Python version 3.7 or later.
  - Convenience poller methods added for certain long-running operations.
  - Add new supported API version: `2022-05-13`.



  - This is the initial release of the Azure Confidential Ledger library.


pkgId: ed4acab52f88b0a45a97ad744f19a567c30b6a418753a4e84e0e1a117a13b21c
name: python-azure-containerregistry
arch: src
version: 1.2.0
epoch: 0
release: 1
summary: Microsoft Azure Azure Container Registry Client Library for Python
url: https://github.com/Azure/azure-sdk-for-python
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-containerregistry-1.2.0-1.src.rpm
checksum_type: sha256
description:
  Azure Container Registry allows you to store and manage container images and artifacts in a private registry for all types of container deployments.

  Use the client library for Azure Container Registry to:

  - List images or artifacts in a registry
  - Obtain metadata for images and artifacts, repositories and tags
  - Set read/write/delete properties on registry items
  - Delete images and artifacts, repositories and tags

  [Source code][source]
  | [Package (Pypi)][package]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-containerregistry/)
  | [API reference documentation][docs]
  | [REST API documentation][rest_docs]
  | [Product documentation][product_docs]



  _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
  _Python 3.7 or later is required to use this package. For more details, please refer to [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy)._





  Install the Azure Container Registry client library for Python with [pip][pip_link]:

  ```bash
  pip install --pre azure-containerregistry
  ```



  * Python 3.7 or later is required to use this package.
  * You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.

  To create a new Container Registry, you can use the [Azure Portal][container_registry_create_portal],
  [Azure PowerShell][container_registry_create_ps], or the [Azure CLI][container_registry_create_cli].
  Here's an example using the Azure CLI:

  ```Powershell
  az acr create --name MyContainerRegistry --resource-group MyResourceGroup --location westus --sku Basic
  ```



  The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication. The `DefaultAzureCredential` assumes the `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` environment variables are set, for more information refer to the [Azure Identity environment variables section](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#environment-variables)

  ```python

  from azure.containerregistry import ContainerRegistryClient
  from azure.identity import DefaultAzureCredential

  endpoint = "https://mycontainerregistry.azurecr.io"
  audience = "https://management.azure.com"
  client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience=audience)
  ```



  A **registry** stores Docker images and [OCI Artifacts](https://opencontainers.org/).  An image or artifact consists of a **manifest** and **layers**.  An image's manifest describes the layers that make up the image, and is uniquely identified by its **digest**.  An image can also be "tagged" to give it a human-readable alias.  An image or artifact can have zero or more **tags** associated with it, and each tag uniquely identifies the image.  A collection of images that share the same name but have different tags, is referred to as a **repository**.

  For more information please see [Container Registry Concepts](https://docs.microsoft.com/azure/container-registry/container-registry-concepts).




  The following sections provide several code snippets covering some of the most common ACR Service tasks, including:

  - Registry operations:
    - [List repositories](#list-repositories)
    - [List tags with anonymous access](#list-tags-with-anonymous-access)
    - [Set artifact properties](#set-artifact-properties)
    - [Delete images](#delete-images)
  - Blob and manifest operations:
    - [Upload images](#upload-images)
    - [Download images](#download-images)
    - [Delete manifest](#delete-manifest)
    - [Delete blob](#delete-blob)

  Please note that each sample assumes there is a `CONTAINERREGISTRY_ENDPOINT` environment variable set to a string containing the `https://` prefix and the name of the login server, for example "https://myregistry.azurecr.io". Anonymous access samples are getting endpoint value from environment variable`CONTAINERREGISTRY_ANONREGISTRY_ENDPOINT`.



  Iterate through the collection of repositories in the registry.

  <!-- SNIPPET:sample_delete_tags.list_repository_names -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      
      for repository_name in client.list_repository_names():
          print(repository_name)
  ```

  <!-- END SNIPPET -->



  Iterate through the collection of tags in the repository with anonymous access.

  <!-- SNIPPET:sample_list_tags.list_tags_anonymous -->

  ```python
  with ContainerRegistryClient(endpoint) as anon_client:
      manifest = anon_client.get_manifest_properties("library/hello-world", "latest")
      print(f"Tags of {manifest.repository_name}: ")
      
      for tag in manifest.tags:
          print(tag)
  ```

  <!-- END SNIPPET -->



  Set properties of an artifact.

  <!-- SNIPPET:sample_set_image_properties.update_manifest_properties -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      
      client.update_manifest_properties(
          "library/hello-world",
          "v1",
          can_write=False,
          can_delete=False
      )
  ```

  <!-- END SNIPPET -->



  Delete images older than the first three in the repository.

  <!-- SNIPPET:sample_delete_images.delete_manifests -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      for repository in client.list_repository_names():
          
          manifest_count = 0
          for manifest in client.list_manifest_properties(
              repository, order_by=ArtifactManifestOrder.LAST_UPDATED_ON_DESCENDING
          ):
              manifest_count += 1
              if manifest_count > 3:
                  
                  client.update_manifest_properties(
                      repository,
                      manifest.digest,
                      can_write=True,
                      can_delete=True
                  )
                  print(f"Deleting {repository}:{manifest.digest}")
                  client.delete_manifest(repository, manifest.digest)
  ```

  <!-- END SNIPPET -->



  To upload a full image, we need to upload individual layers and configuration. After that we can upload a manifest which describes an image or artifact and assign it a tag.

  <!-- SNIPPET:sample_set_get_image.upload_blob_and_manifest -->

  ```python
  self.repository_name = "sample-oci-image"
  layer = BytesIO(b"Sample layer")
  config = BytesIO(json.dumps(
      {
          "sample config": "content",
      }).encode())
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      
      layer_digest, layer_size = client.upload_blob(self.repository_name, layer)
      print(f"Uploaded layer: digest - {layer_digest}, size - {layer_size}")
      
      config_digest, config_size = client.upload_blob(self.repository_name, config)
      print(f"Uploaded config: digest - {config_digest}, size - {config_size}")
      
      oci_manifest = {
          "config": {
              "mediaType": "application/vnd.oci.image.config.v1+json",
              "digest": config_digest,
              "sizeInBytes": config_size,
          },
          "schemaVersion": 2,
          "layers": [
              {
                  "mediaType": "application/vnd.oci.image.layer.v1.tar",
                  "digest": layer_digest,
                  "size": layer_size,
                  "annotations": {
                      "org.opencontainers.image.ref.name": "artifact.txt",
                  },
              },
          ],
      }
      
      manifest_digest = client.set_manifest(self.repository_name, oci_manifest, tag="latest")
      print(f"Uploaded manifest: digest - {manifest_digest}")
  ```

  <!-- END SNIPPET -->



  To download a full image, we need to download its manifest and then download individual layers and configuration.

  <!-- SNIPPET:sample_set_get_image.download_blob_and_manifest -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      
      get_manifest_result = client.get_manifest(self.repository_name, "latest")
      received_manifest = get_manifest_result.manifest
      print(f"Got manifest:\n{received_manifest}")

      
      for layer in received_manifest["layers"]:
          
          layer_file_name = layer["digest"].split(":")[1]
          try:
              stream = client.download_blob(self.repository_name, layer["digest"])
              with open(layer_file_name, "wb") as layer_file:
                  for chunk in stream:
                      layer_file.write(chunk)
          except DigestValidationError:
              print(f"Downloaded layer digest value did not match. Deleting file {layer_file_name}.")
              os.remove(layer_file_name)
          print(f"Got layer: {layer_file_name}")
      
      config_file_name = "config.json"
      try:
          stream = client.download_blob(self.repository_name, received_manifest["config"]["digest"])
          with open(config_file_name, "wb") as config_file:
              for chunk in stream:
                  config_file.write(chunk)
      except DigestValidationError:
          print(f"Downloaded config digest value did not match. Deleting file {config_file_name}.")
          os.remove(config_file_name)
      print(f"Got config: {config_file_name}")
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:sample_set_get_image.delete_manifest -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      get_manifest_result = client.get_manifest(self.repository_name, "latest")
      
      client.delete_manifest(self.repository_name, get_manifest_result.digest)
  ```

  <!-- END SNIPPET -->



  <!-- SNIPPET:sample_set_get_image.delete_blob -->

  ```python
  with ContainerRegistryClient(self.endpoint, self.credential) as client:
      get_manifest_result = client.get_manifest(self.repository_name, "latest")
      received_manifest = get_manifest_result.manifest
      
      for layer in received_manifest["layers"]:
          client.delete_blob(self.repository_name, layer["digest"])
      
      client.delete_blob(self.repository_name, received_manifest["config"]["digest"])
  ```

  <!-- END SNIPPET -->




  For infomation about troubleshooting, refer to the [troubleshooting guide].

  ACR client library will raise exceptions defined in [Azure Core][azure_core_exceptions].


  This library uses the standard
  [logging][python_logging] library for logging.

  Basic information about HTTP sessions (URLs, headers, etc.) is logged at `INFO` level.

  Detailed `DEBUG` level logging, including request/response bodies and **unredacted**
  headers, can be enabled on the client or per-operation with the `logging_enable` keyword argument.

  See full SDK logging documentation with examples [here][sdk_logging_docs].



  Optional keyword arguments can be passed in at the client and per-operation level.
  The azure-core [reference documentation][azure_core_ref_docs]
  describes available configurations for retries, logging, transport protocols, and more.



  - Go further with azure.containerregistry and our [samples][samples].
  - Watch a [demo or deep dive video](https://azure.microsoft.com/resources/videos/index/?service=container-registry).
  - Read more about the [Azure Container Registry service](https://docs.microsoft.com/azure/container-registry/container-registry-intro).



  This project welcomes contributions and suggestions.  Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution. For
  details, visit [cla.microsoft.com][cla].

  This project has adopted the [Microsoft Open Source Code of Conduct][coc].
  For more information see the [Code of Conduct FAQ][coc_faq]
  or contact [opencode@microsoft.com][coc_contact] with any
  additional questions or comments.

  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fsdk%2Fcontainerregistry%2Fazure-containerregistry%2FREADME.png)

  <!-- LINKS -->
  [source]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/containerregistry/azure-containerregistry
  [package]: https://pypi.org/project/azure-containerregistry/
  [docs]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-containerregistry/1.0.0b1/index.html
  [rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/
  [product_docs]:  https://docs.microsoft.com/azure/container-registry
  [pip_link]: https://pypi.org
  [container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro
  [container_registry_create_ps]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-powershell
  [container_registry_create_cli]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli
  [container_registry_create_portal]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal
  [container_registry_concepts]: https://docs.microsoft.com/azure/container-registry/container-registry-concepts
  [azure_cli]: https://docs.microsoft.com/cli/azure
  [azure_sub]: https://azure.microsoft.com/free/
  [identity]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/README.md
  [samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/containerregistry/azure-containerregistry/samples
  [cla]: https://cla.microsoft.com
  [coc]: https://opensource.microsoft.com/codeofconduct/
  [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
  [coc_contact]: mailto:opencode@microsoft.com
  [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs
  [azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
  [python_logging]: https://docs.python.org/3/library/logging.html
  [sdk_logging_docs]: https://docs.microsoft.com/azure/developer/python/azure-sdk-logging
  [troubleshooting guide]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/TROUBLESHOOTING.md


pkgId: 37840b54d99de093e8ee94bb0042e6cf12269a07c61159cb893c64e32415a95c
name: python-azure-core
arch: src
version: 1.30.2
epoch: 0
release: 1
summary: Microsoft Azure Core Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-core-1.30.2-1.src.rpm
checksum_type: sha256
description:
  Azure core provides shared exceptions and modules for Python SDK client libraries.
  These libraries follow the [Azure SDK Design Guidelines for Python](https://azure.github.io/azure-sdk/python/guidelines/index.html) .

  If you are a client library developer, please reference [client library developer reference](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md) for more information.

  [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/)
  | [Package (Pypi)][package]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-core/)
  | [API reference documentation](https://docs.microsoft.com/python/api/overview/azure/core-readme)



  Typically, you will not need to install azure core;
  it will be installed when you install one of the client libraries using it.
  In case you want to install it explicitly (to implement your own client library, for example),
  you can find it [here](https://pypi.org/project/azure-core/).







  AzureError is the base exception for all errors.

  ```python
  class AzureError(Exception):
      def __init__(self, message, *args, **kwargs):
          self.inner_exception = kwargs.get("error")
          self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info()
          self.exc_type = self.exc_type.__name__ if self.exc_type else type(self.inner_exception)
          self.exc_msg = "{}, {}: {}".format(message, self.exc_type, self.exc_value)  # type: ignore
          self.message = str(message)
          self.continuation_token = kwargs.get("continuation_token")
          super(AzureError, self).__init__(self.message, *args)
  ```

  *message* is any message (str) to be associated with the exception.

  *args* are any additional args to be included with exception.

  *kwargs* are keyword arguments to include with the exception. Use the keyword *error* to pass in an internal exception and *continuation_token* for a token reference to continue an incomplete operation.

  **The following exceptions inherit from AzureError:**



  An error occurred while attempt to make a request to the service. No request was sent.



  The request was sent, but the client failed to understand the response.
  The connection may have timed out. These errors can be retried for idempotent or safe operations.



  A request was made, and a non-success status code was received from the service.

  ```python
  class HttpResponseError(AzureError):
      def __init__(self, message=None, response=None, **kwargs):
          self.reason = None
          self.response = response
          if response:
              self.reason = response.reason
              self.status_code = response.status_code
          self.error = self._parse_odata_body(ODataV4Format, response)  # type: Optional[ODataV4Format]
          if self.error:
              message = str(self.error)
          else:
              message = message or "Operation returned an invalid status '{}'".format(
                  self.reason
              )

          super(HttpResponseError, self).__init__(message=message, **kwargs)
  ```

  *message* is the HTTP response error message (optional)

  *response* is the HTTP response (optional).

  *kwargs* are keyword arguments to include with the exception.

  **The following exceptions inherit from HttpResponseError:**



  An error raised during response de-serialization.



  An error raised if peer closes the connection before we have received the complete message body.



  An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.



  An error response, typically triggered by a 412 response (for update) or 404 (for get/post).



  An error response with status code 4xx, typically 412 Conflict. This will not be raised directly by the Azure core pipeline.



  An error response with status code 304. This will not be raised directly by the Azure core pipeline.



  An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.



  An error raised when the maximum number of redirect attempts is reached. The maximum amount of redirects can be configured in the RedirectPolicy.

  ```python
  class TooManyRedirectsError(HttpResponseError):
      def __init__(self, history, *args, **kwargs):
          self.history = history
          message = "Reached maximum redirect attempts."
          super(TooManyRedirectsError, self).__init__(message, *args, **kwargs)
  ```

  *history* is used to document the requests/responses that resulted in redirected requests.

  *args* are any additional args to be included with exception.

  *kwargs* are keyword arguments to include with the exception.



  An error thrown if you try to access the stream of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
  the response stream has been consumed.



  An error thrown if you try to access the stream of the `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
  the response stream has been closed.



  An error thrown if you try to access the `content` of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` before
  reading in the response's bytes first.



  When calling the methods, some properties can be configured by passing in as kwargs arguments.

  | Parameters | Description |
  | --- | --- |
  | headers | The HTTP Request headers. |
  | request_id | The request id to be added into header. |
  | user_agent | If specified, this will be added in front of the user agent string. |
  | logging_enable| Use to enable per operation. Defaults to `False`. |
  | logger | If specified, it will be used to log information. |
  | response_encoding | The encoding to use if known for this service (will disable auto-detection). |
  | raw_request_hook | Callback function. Will be invoked on request. |
  | raw_response_hook | Callback function. Will be invoked on response. |
  | network_span_namer | A callable to customize the span name. |
  | tracing_attributes | Attributes to set on all created spans. |
  | permit_redirects | Whether the client allows redirects. Defaults to `True`. |
  | redirect_max | The maximum allowed redirects. Defaults to `30`. |
  | retry_total | Total number of retries to allow. Takes precedence over other counts. Default value is `10`. |
  | retry_connect | How many connection-related errors to retry on. These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request. Default value is `3`. |
  | retry_read | How many times to retry on read errors. These errors are raised after the request was sent to the server, so the request may have side-effects. Default value is `3`. |
  | retry_status | How many times to retry on bad status codes. Default value is `3`. |
  | retry_backoff_factor | A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` seconds. If the backoff_factor is 0.1, then the retry will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is `0.8`. |
  | retry_backoff_max | The maximum back off time. Default value is `120` seconds (2 minutes). |
  | retry_mode | Fixed or exponential delay between attempts, default is `Exponential`. |
  | timeout | Timeout setting for the operation in seconds, default is `604800`s (7 days). |
  | connection_timeout | A single float in seconds for the connection timeout. Defaults to `300` seconds. |
  | read_timeout | A single float in seconds for the read timeout. Defaults to `300` seconds. |
  | connection_verify | SSL certificate verification. Enabled by default. Set to False to disable, alternatively can be set to the path to a CA_BUNDLE file or directory with certificates of trusted CAs. |
  | connection_cert | Client-side certificates. You can specify a local cert to use as client side certificate, as a single file (containing the private key and the certificate) or as a tuple of both files' paths. |
  | proxies | Dictionary mapping protocol or protocol and hostname to the URL of the proxy. |
  | cookies | Dict or CookieJar object to send with the `Request`. |
  | connection_data_block_size | The block size of data sent over the connection. Defaults to `4096` bytes. |



  The async transport is designed to be opt-in. [AioHttp](https://pypi.org/project/aiohttp/) is one of the supported implementations of async transport. It is not installed by default. You need to install it separately.





  MatchConditions is an enum to describe match conditions.

  ```python
  class MatchConditions(Enum):
      Unconditionally = 1  # Matches any condition
      IfNotModified = 2  # If the target object is not modified. Usually it maps to etag=<specific etag>
      IfModified = 3  # Only if the target object is modified. Usually it maps to etag!=<specific etag>
      IfPresent = 4   # If the target object exists. Usually it maps to etag='*'
      IfMissing = 5   # If the target object does not exist. Usually it maps to etag!='*'
  ```



  A metaclass to support case-insensitive enums.

  ```python
  from enum import Enum

  from azure.core import CaseInsensitiveEnumMeta

  class MyCustomEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
      FOO = 'foo'
      BAR = 'bar'
  ```



  A falsy sentinel object which is supposed to be used to specify attributes
  with no data. This gets serialized to `null` on the wire.

  ```python
  from azure.core.serialization import NULL

  assert bool(NULL) is False

  foo = Foo(
      attr=NULL
  )
  ```



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information, see the
  [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
  or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
  additional questions or comments.

  <!-- LINKS -->
  [package]: https://pypi.org/project/azure-core/








  - Tracing: `DistributedTracingPolicy` will now set an attribute, `http.request.resend_count`, on HTTP spans for resent requests to indicate the resend attempt number.  #35069



  - Raise correct exception if transport is used while already closed  #35559



  - HTTP tracing spans will now include an `error.type` attribute if an error status code is returned.  #34619
  - Minimum required Python version is now 3.8





  - Accept float for `retry_after` header.  #34203





  - Support tuple input for file values  to `azure.core.rest.HttpRequest`  #33948
  - Support tuple input to `files` with duplicate field names  `azure.core.rest.HttpRequest`  #34021





  - Removed dependency on `anyio`.  #33282





  - Adjusted `AsyncBearerTokenCredentialPolicy` to work properly with `trio` concurrency mechanisms.   ([#33307](https://github.com/Azure/azure-sdk-for-python/pull/33307))



  - Added dependency on `anyio` >=3.0,<5.0
  - Bumped minimum dependency on `requests` to 2.21.0.





  - Fixed an issue with `multipart/form-data` in the async transport where `data` was not getting encoded into the request body. #32473



  - Use ssl context from aiohttp by default.





  - Fixed the issue that some urls trigger an infinite loop. #31346
  - Fixed issue where IndexError was raised if multipart responses did not match the number of requests. #31471
  - Fixed issue unbound variable exception if dict is invalid in CloudEvent.from_dict. #31835
  - Fixed issue asyncBearerTokenCredentialPolicy is not backward compatible with SansIOHTTPPolicy. #31836
  - Fixed issue mypy complains with new version of azure-core. #31564





  - Typing fix: `message` cannot be `None` in `AzureError`. #31564





  - Added a default implementation for `AsyncTokenCredential.__aexit__()` #31573



  - Bumped `typing-extensions` version to 4.6.0.





  - Not pass `enabled_cae` unless it is explicitly enabled.





  - A keyword argument `enable_cae` was added to the `get_token` method of the `TokenCredential` protocol.  #31012
  - `BearerTokenCredentialPolicy` and `AsyncBearerTokenCredentialPolicy` now accept `enable_cae` keyword arguments in their constructors. This is used in determining if [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) should be enabled for each `get_token` request.  #31012





  - Added header name parameter to `RequestIdPolicy`. #30772
  - Added `SensitiveHeaderCleanupPolicy` that cleans up sensitive headers if a redirect happens and the new destination is in another domain. #28349



  - Catch aiohttp errors and translate them into azure-core errors.





  - Fix url building for some complex query parameters scenarios  #30707





  - Added support to use sync credentials in `AsyncBearerTokenCredentialPolicy`. #30381
  - Added "prefix" parameter to AzureKeyCredentialPolicy #29901



  - Improve error message when providing the wrong credential type for AzureKeyCredential  #30380





  - Updated settings to include OpenTelemetry as a tracer provider.  #29095



  - Improved typing





  - Fixed deflate decompression for aiohttp   #28483





  - Fix 'ClientSession' object has no attribute 'auto_decompress'  (thanks to @mghextreme for the contribution)



  - Add "x-ms-error-code" as secure header to log
  - Rename "DEFAULT_HEADERS_WHITELIST" to "DEFAULT_HEADERS_ALLOWLIST". Added a backward compatible alias.





  - Added example of RequestsTransport with custom session.  (thanks to @inirudebwoy for the contribution)   #26768
  - Added Python 3.11 support.





  - LRO polling will not wait anymore before doing the first status check  #26376
  - Added extra dependency for [aio]. pip install azure-core[aio] installs aiohttp too.





  - Added @runtime_checkable to `TokenCredential` protocol definitions  #25187



  Azure-core is supported on Python 3.7 or later. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).



  - Added `CaseInsensitiveDict` implementation in `azure.core.utils` removing dependency on `requests` and `aiohttp`





  - Fixed the bug that azure-core could not be imported under Python 3.11.0b3  #24928
  - `ContentDecodePolicy` can now correctly deserialize more JSON bodies with different mime types #22410





  - Declare method level span as INTERNAL by default  #24492
  - Fixed type hints for `azure.core.paging.ItemPaged` #24548





  - Add `SerializationError` and `DeserializationError` in `azure.core.exceptions` for errors raised during serialization / deserialization  #24312





  - Allow stream inputs to the `content` kwarg of `azure.core.rest.HttpRequest` from objects with a `read` method  #23578





  - Improve intellisense type hinting for service client methods. #22891

  - Add a case insensitive dict `case_insensitive_dict` in `azure.core.utils`.  #23206



  - Use "\n" rather than "/n" for new line in log.     #23261



  - Log "WWW-Authenticate" header in `HttpLoggingPolicy`  #22990
  - Added dependency on `typing-extensions` >= 4.0.1





  - Limiting `final-state-via` scope to POST until consuming SDKs has been fixed to use this option properly on PUT.  #22989


  _[**This version is deprecated.**]_



  - Add support for `final-state-via` LRO option in core.  #22713



  - Add response body to string representation of `HttpResponseError` if we're not able to parse out information #22302
  - Raise `AttributeError` when calling azure.core.pipeline.transport.\_\_bases__    #22469



  - Python 2.7 is no longer supported. Please use Python version 3.6 or later.





  - Revert change in str method  #22023





  - Sync stream downloading now raises `azure.core.exceptions.DecodeError` rather than `requests.exceptions.ContentDecodingError`



  - Add response body to string representation of `HttpResponseError` if we're not able to parse out information #21800





  - Correctly set response's content to decompressed body when users are using aiohttp transport with decompression headers #21620





  - GA `send_request` onto the `azure.core.PipelineClient` and `azure.core.AsyncPipelineClient`. This method takes in
  requests and sends them through our pipelines.
  - GA `azure.core.rest`. `azure.core.rest` is our new public simple HTTP library in `azure.core` that users will use to create requests, and consume responses.
  - GA errors `StreamConsumedError`, `StreamClosedError`, and `ResponseNotReadError` to `azure.core.exceptions`. These errors
  are thrown if you mishandle streamed responses from the `azure.core.rest` module
  - add kwargs to the methods for `iter_raw` and `iter_bytes`  #21529
  - no longer raise JSON errors if users pass in file descriptors of JSON to the `json` kwarg in `HttpRequest`  #21504
  - Added new error type `IncompleteReadError` which is raised if peer closes the connection before we have received the complete message body.



  - SansIOHTTPPolicy.on_exception returns None instead of bool.



  - The `Content-Length` header in a http response is strictly checked against the actual number of bytes in the body,
    rather than silently truncating data in case the underlying tcp connection is closed prematurely.
    (thanks to @jochen-ott-by for the contribution)   #20412
  - UnboundLocalError when SansIOHTTPPolicy handles an exception    #15222
  - Add default content type header of `text/plain` and content length header for users who pass unicode strings to the `content` kwarg of `HttpRequest` in 2.7  #21550





  - respect text encoding specified in argument (thanks to @ryohji for the contribution)  #20796
  - Fix "coroutine x.read() was never awaited" warning from `ContentDecodePolicy`  #21318
  - fix type check for `data` input to `azure.core.rest` for python 2.7 users  #21341
  - use `charset_normalizer` if `chardet` is not installed to migrate aiohttp 3.8.0 changes.



  - Refactor AzureJSONEncoder (thanks to @Codejune for the contribution)  #21028





  - `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse` are now abstract base classes. They should not be initialized directly, instead
  your transport responses should inherit from them and implement them.
  - The properties of the `azure.core.rest` responses are now all read-only

  - HttpLoggingPolicy integrates logs into one record #19925





  - `azure.core.serialization.AzureJSONEncoder` (introduced in 1.17.0) serializes `datetime.datetime` objects in ISO 8601 format, conforming to RFC 3339's specification.    #20190
  - We now use `azure.core.serialization.AzureJSONEncoder` to serialize `json` input to `azure.core.rest.HttpRequest`.



  - The `text` property on `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse` has changed to a method, which also takes
  an `encoding` parameter.
  - Removed `iter_text` and `iter_lines` from `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse`



  - The behaviour of the headers returned in `azure.core.rest` responses now aligns across sync and async. Items can now be checked case-insensitively and without raising an error for format.





  - Cut hard dependency on requests library
  - Added a `from_json` method which now accepts storage QueueMessage, eventhub's EventData or ServiceBusMessage or simply json bytes to return a `CloudEvent`



  - Not override "x-ms-client-request-id" if it already exists in the header.    #17757



  - `azure.core.rest` will not try to guess the `charset` anymore if it was impossible to extract it from `HttpResponse` analysis. This removes our dependency on `charset`.





  - Add new ***provisional*** methods `send_request` onto the `azure.core.PipelineClient` and `azure.core.AsyncPipelineClient`. This method takes in
  requests and sends them through our pipelines.
  - Add new ***provisional*** module `azure.core.rest`. `azure.core.rest` is our new public simple HTTP library in `azure.core` that users will use to create requests, and consume responses.
  - Add new ***provisional*** errors `StreamConsumedError`, `StreamClosedError`, and `ResponseNotReadError` to `azure.core.exceptions`. These errors
  are thrown if you mishandle streamed responses from the provisional `azure.core.rest` module



  - Improved error message in the `from_dict` method of `CloudEvent` when a wrong schema is sent.





  - Added `BearerTokenCredentialPolicy.on_challenge` and `.authorize_request` to allow subclasses to optionally handle authentication challenges



  - Retry policies don't sleep after operations time out
  - The `from_dict` methhod in the `CloudEvent` can now convert a datetime string to datetime object when microsecond exceeds the python limitation





  - Added `azure.core.credentials.AzureNamedKeyCredential` credential #17548.
  - Added `decompress` parameter for `stream_download` method. If it is set to `False`, will not do decompression upon the stream.    #17920



  Azure core requires Python 2.7 or Python 3.6+ since this release.



  - Added `azure.core.utils.parse_connection_string` function to parse connection strings across SDKs, with common validation and support for case insensitive keys.
  - Supported adding custom policies  #16519
  - Added `~azure.core.tracing.Link` that should be used while passing `Links` to  `AbstractSpan`.
  - `AbstractSpan` constructor can now take in additional keyword only args.



  - Make NetworkTraceLoggingPolicy show the auth token in plain text. #14191
  - Fixed RetryPolicy overriding default connection timeout with an extreme value #17481



  This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.



  - Added `azure.core.messaging.CloudEvent` model that follows the cloud event spec.
  - Added `azure.core.serialization.NULL` sentinel value
  - Improve `repr`s for `HttpRequest` and `HttpResponse`s  #16972



  - Disable retry in stream downloading. (thanks to @jochen-ott-by @hoffmann for the contribution)  #16723





  - Added `CaseInsensitiveEnumMeta` class for case-insensitive enums.  #16316
  - Add `raise_for_status` method onto `HttpResponse`. Calling `response.raise_for_status()` on a response with an error code
  will raise an `HttpResponseError`. Calling it on a good response will do nothing  #16399



  - Update conn.conn_kw rather than overriding it when setting block size. (thanks for @jiasli for the contribution)  #16587





  - Added `AzureSasCredential` and its respective policy. #15946





  - Add a `continuation_token` attribute to the base `AzureError` exception, and set this value for errors raised
    during paged or long-running operations.



  - Set retry_interval to 1 second instead of 1000 seconds (thanks **vbarbaresi** for contributing)  #14357






  - Fixed bug to allow polling in the case of parameterized endpoints with relative polling urls  #14097






  - SAS credential replicated "/" fix #13159





  - Support params as list for exploding parameters  #12410






  - `AzureKeyCredentialPolicy` will now accept (and ignore) passed in kwargs  #11963
  - Better error messages if passed endpoint is incorrect  #12106
  - Do not JSON encore a string if content type is "text"  #12137



  - Added `http_logging_policy` property on the `Configuration` object, allowing users to individually
  set the http logging policy of the config  #12218





  - Fixed deadlocks in AsyncBearerTokenCredentialPolicy #11543
  - Fix AttributeException in StreamDownloadGenerator #11462



  - Added support for changesets as part of multipart message support #10485
  - Add AsyncLROPoller in azure.core.polling #10801
  - Add get_continuation_token/from_continuation_token/polling_method methods in pollers (sync and async) #10801
  - HttpResponse and PipelineContext objects are now pickable #10801





  - Support "x-ms-retry-after-ms" in response header   #10743
  - `link` and `link_from_headers` now accepts attributes   #10765



  - Not retry if the status code is less than 400 #10778
  - "x-ms-request-id" is not considered safe header for logging #10967





  - Support a default error type in map_error #9773
  - Added `AzureKeyCredential` and its respective policy. #10509
  - Added `azure.core.polling.base_polling` module with a "Microsoft One API" polling implementation #10090
    Also contains the async version in `azure.core.polling.async_base_polling`
  - Support kwarg `enforce_https` to disable HTTPS check on authentication #9821
  - Support additional kwargs in `HttpRequest.set_multipart_mixed` that will be passed into pipeline context.





  - Appended RequestIdPolicy to the default pipeline  #9841
  - Rewind the body position in async_retry   #10117



  - Add raw_request_hook support in custom_hook_policy   #9958
  - Add timeout support in retry_policy   #10011
  - Add OdataV4 error format auto-parsing in all exceptions ('error' attribute)  #9738





  - Fixed a bug that sends None as request_id #9545
  - Enable mypy for customers #9572
  - Handle TypeError in deep copy #9620
  - Fix text/plain content-type in decoder #9589





  - Fixed a regression in 1.2.0 that was incompatible with azure-keyvault-* 4.0.0
  [#9462](https://github.com/Azure/azure-sdk-for-python/issues/9462)






  - Add user_agent & sdk_moniker kwargs in UserAgentPolicy init   #9355
  - Support OPTIONS HTTP verb     #9322
  - Add tracing_attributes to tracing decorator   #9297
  - Support auto_request_id in RequestIdPolicy   #9163
  - Support fixed retry   #6419
  - Support "retry-after-ms" in response header   #9240



  - Removed `__enter__` and `__exit__` from async context managers    #9313





  - Bearer token authorization requires HTTPS
  - Rewind the body position in retry #8307





  - New RequestIdPolicy   #8437
  - Enable logging policy in default pipeline #8053
  - Normalize transport timeout.   #8000
    Now we have:
    * 'connection_timeout' - a single float in seconds for the connection timeout. Default 5min
    * 'read_timeout' - a single float in seconds for the read timeout. Default 5min



  - RequestHistory: deepcopy fails if request contains a stream  #7732
  - Retry: retry raises error if response does not have http_response #8629
  - Client kwargs are now passed to DistributedTracingPolicy correctly    #8051
  - NetworkLoggingPolicy now logs correctly all requests in case of retry #8262





  - Tracing: DistributedTracingPolicy now accepts kwargs network_span_namer to change network span name  #7773
  - Tracing: Implementation of AbstractSpan can now use the mixin HttpSpanMixin to get HTTP span update automatically  #7773
  - Tracing: AbstractSpan contract "change_context" introduced  #7773
  - Introduce new policy HttpLoggingPolicy  #7988



  - Fix AsyncioRequestsTransport if input stream is an async generator  #7743
  - Fix form-data with aiohttp transport  #7749



  - Tracing: AbstractSpan.set_current_span is longer supported. Use change_context instead.  #7773
  - azure.core.pipeline.policies.ContentDecodePolicy.deserialize_from_text changed





  - Tracing: network span context is available with the TRACING_CONTEXT in pipeline response  #7252
  - Tracing: Span contract now has `kind`, `traceparent` and is a context manager  #7252
  - SansIOHTTPPolicy methods can now be coroutines #7497
  - Add multipart/mixed support #7083:

    - HttpRequest now has a "set_multipart_mixed" method to set the parts of this request
    - HttpRequest now has a "prepare_multipart_body" method to build final body.
    - HttpResponse now has a "parts" method to return an iterator of parts
    - AsyncHttpResponse now has a "parts" methods to return an async iterator of parts
    - Note that multipart/mixed is a Python 3.x only feature



  - Tracing: policy cannot fail the pipeline, even in the worst condition  #7252
  - Tracing: policy pass correctly status message if exception  #7252
  - Tracing: incorrect span if exception raised from decorated function  #7133
  - Fixed urllib3 ConnectTimeoutError being raised by Requests during a socket timeout. Now this exception is caught and wrapped as a `ServiceRequestError`  #7542



  - Tracing: `azure.core.tracing.context` removed
  - Tracing: `azure.core.tracing.context.tracing_context.with_current_context` renamed to `azure.core.tracing.common.with_current_context`  #7252
  - Tracing: `link` renamed `link_from_headers`  and `link` takes now a string
  - Tracing: opencensus implementation has been moved to the package `azure-core-tracing-opencensus`
  - Some modules and classes that were importables from several different places have been removed:

     - `azure.core.HttpResponseError` is now only `azure.core.exceptions.HttpResponseError`
     - `azure.core.Configuration` is now only `azure.core.configuration.Configuration`
     - `azure.core.HttpRequest` is now only `azure.core.pipeline.transport.HttpRequest`
     - `azure.core.version` module has been removed. Use `azure.core.__version__` to get version number.
     - `azure.core.pipeline_client` has been removed. Import from `azure.core` instead.
     - `azure.core.pipeline_client_async` has been removed. Import from `azure.core` instead.
     - `azure.core.pipeline.base` has been removed. Import from `azure.core.pipeline` instead.
     - `azure.core.pipeline.base_async` has been removed. Import from `azure.core.pipeline` instead.
     - `azure.core.pipeline.policies.base` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.base_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.authentication` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.authentication_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.custom_hook` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.redirect` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.redirect_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.retry` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.retry_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.distributed_tracing` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.universal` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.tracing.abstract_span` has been removed. Import from `azure.core.tracing` instead.
     - `azure.core.pipeline.transport.base` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.base_async` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_basic` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_asyncio` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_trio` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.aiohttp` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.polling.poller` has been removed. Import from `azure.core.polling` instead.
     - `azure.core.polling.async_poller` has been removed. Import from `azure.core.polling` instead.





  -  Fix aiohttp auto-headers #6992
  -  Add tracing to policies module init  #6951





  - Transport classes don't take `config` parameter anymore (use kwargs instead)  #6372
  - `azure.core.paging` has been completely refactored  #6420
  - HttpResponse.content_type attribute is now a string (was a list)  #6490
  - For `StreamDownloadGenerator` subclasses, `response` is now an `HttpResponse`, and not a transport response like `aiohttp.ClientResponse` or `requests.Response`. The transport response is available in `internal_response` attribute  #6490



  - aiohttp is not required to import async pipelines classes #6496
  - `AsyncioRequestsTransport.sleep` is now a coroutine as expected #6490
  - `RequestsTransport` is not tight to `ProxyPolicy` implementation details anymore #6372
  - `AiohttpTransport` does not raise on unexpected kwargs  #6355



  - New paging base classes that support `continuation_token` and `by_page()`  #6420
  - Proxy support for `AiohttpTransport`  #6372



  - Preview 1 release


pkgId: 5421245c38195c81b4ad089d580d368a9508bd813429f7fa42291886864a619c
name: python-azure-core
arch: src
version: 1.31.0
epoch: 0
release: 1
summary: Microsoft Azure Core Library for Python
url: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-azure-core-1.31.0-1.src.rpm
checksum_type: sha256
description:
  Azure core provides shared exceptions and modules for Python SDK client libraries.
  These libraries follow the [Azure SDK Design Guidelines for Python](https://azure.github.io/azure-sdk/python/guidelines/index.html) .

  If you are a client library developer, please reference [client library developer reference](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md) for more information.

  [Source code](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/)
  | [Package (Pypi)][package]
  | [Package (Conda)](https://anaconda.org/microsoft/azure-core/)
  | [API reference documentation](https://docs.microsoft.com/python/api/overview/azure/core-readme)



  Typically, you will not need to install azure core;
  it will be installed when you install one of the client libraries using it.
  In case you want to install it explicitly (to implement your own client library, for example),
  you can find it [here](https://pypi.org/project/azure-core/).







  AzureError is the base exception for all errors.

  ```python
  class AzureError(Exception):
      def __init__(self, message, *args, **kwargs):
          self.inner_exception = kwargs.get("error")
          self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info()
          self.exc_type = self.exc_type.__name__ if self.exc_type else type(self.inner_exception)
          self.exc_msg = "{}, {}: {}".format(message, self.exc_type, self.exc_value)  # type: ignore
          self.message = str(message)
          self.continuation_token = kwargs.get("continuation_token")
          super(AzureError, self).__init__(self.message, *args)
  ```

  *message* is any message (str) to be associated with the exception.

  *args* are any additional args to be included with exception.

  *kwargs* are keyword arguments to include with the exception. Use the keyword *error* to pass in an internal exception and *continuation_token* for a token reference to continue an incomplete operation.

  **The following exceptions inherit from AzureError:**



  An error occurred while attempt to make a request to the service. No request was sent.



  The request was sent, but the client failed to understand the response.
  The connection may have timed out. These errors can be retried for idempotent or safe operations.



  A request was made, and a non-success status code was received from the service.

  ```python
  class HttpResponseError(AzureError):
      def __init__(self, message=None, response=None, **kwargs):
          self.reason = None
          self.response = response
          if response:
              self.reason = response.reason
              self.status_code = response.status_code
          self.error = self._parse_odata_body(ODataV4Format, response)  # type: Optional[ODataV4Format]
          if self.error:
              message = str(self.error)
          else:
              message = message or "Operation returned an invalid status '{}'".format(
                  self.reason
              )

          super(HttpResponseError, self).__init__(message=message, **kwargs)
  ```

  *message* is the HTTP response error message (optional)

  *response* is the HTTP response (optional).

  *kwargs* are keyword arguments to include with the exception.

  **The following exceptions inherit from HttpResponseError:**



  An error raised during response de-serialization.



  An error raised if peer closes the connection before we have received the complete message body.



  An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.



  An error response, typically triggered by a 412 response (for update) or 404 (for get/post).



  An error response with status code 4xx, typically 412 Conflict. This will not be raised directly by the Azure core pipeline.



  An error response with status code 304. This will not be raised directly by the Azure core pipeline.



  An error response with status code 4xx. This will not be raised directly by the Azure core pipeline.



  An error raised when the maximum number of redirect attempts is reached. The maximum amount of redirects can be configured in the RedirectPolicy.

  ```python
  class TooManyRedirectsError(HttpResponseError):
      def __init__(self, history, *args, **kwargs):
          self.history = history
          message = "Reached maximum redirect attempts."
          super(TooManyRedirectsError, self).__init__(message, *args, **kwargs)
  ```

  *history* is used to document the requests/responses that resulted in redirected requests.

  *args* are any additional args to be included with exception.

  *kwargs* are keyword arguments to include with the exception.



  An error thrown if you try to access the stream of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
  the response stream has been consumed.



  An error thrown if you try to access the stream of the `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` once
  the response stream has been closed.



  An error thrown if you try to access the `content` of `azure.core.rest.HttpResponse` or `azure.core.rest.AsyncHttpResponse` before
  reading in the response's bytes first.



  When calling the methods, some properties can be configured by passing in as kwargs arguments.

  | Parameters | Description |
  | --- | --- |
  | headers | The HTTP Request headers. |
  | request_id | The request id to be added into header. |
  | user_agent | If specified, this will be added in front of the user agent string. |
  | logging_enable| Use to enable per operation. Defaults to `False`. |
  | logger | If specified, it will be used to log information. |
  | response_encoding | The encoding to use if known for this service (will disable auto-detection). |
  | raw_request_hook | Callback function. Will be invoked on request. |
  | raw_response_hook | Callback function. Will be invoked on response. |
  | network_span_namer | A callable to customize the span name. |
  | tracing_attributes | Attributes to set on all created spans. |
  | permit_redirects | Whether the client allows redirects. Defaults to `True`. |
  | redirect_max | The maximum allowed redirects. Defaults to `30`. |
  | retry_total | Total number of retries to allow. Takes precedence over other counts. Default value is `10`. |
  | retry_connect | How many connection-related errors to retry on. These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request. Default value is `3`. |
  | retry_read | How many times to retry on read errors. These errors are raised after the request was sent to the server, so the request may have side-effects. Default value is `3`. |
  | retry_status | How many times to retry on bad status codes. Default value is `3`. |
  | retry_backoff_factor | A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` seconds. If the backoff_factor is 0.1, then the retry will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is `0.8`. |
  | retry_backoff_max | The maximum back off time. Default value is `120` seconds (2 minutes). |
  | retry_mode | Fixed or exponential delay between attempts, default is `Exponential`. |
  | timeout | Timeout setting for the operation in seconds, default is `604800`s (7 days). |
  | connection_timeout | A single float in seconds for the connection timeout. Defaults to `300` seconds. |
  | read_timeout | A single float in seconds for the read timeout. Defaults to `300` seconds. |
  | connection_verify | SSL certificate verification. Enabled by default. Set to False to disable, alternatively can be set to the path to a CA_BUNDLE file or directory with certificates of trusted CAs. |
  | connection_cert | Client-side certificates. You can specify a local cert to use as client side certificate, as a single file (containing the private key and the certificate) or as a tuple of both files' paths. |
  | proxies | Dictionary mapping protocol or protocol and hostname to the URL of the proxy. |
  | cookies | Dict or CookieJar object to send with the `Request`. |
  | connection_data_block_size | The block size of data sent over the connection. Defaults to `4096` bytes. |



  The async transport is designed to be opt-in. [AioHttp](https://pypi.org/project/aiohttp/) is one of the supported implementations of async transport. It is not installed by default. You need to install it separately.





  MatchConditions is an enum to describe match conditions.

  ```python
  class MatchConditions(Enum):
      Unconditionally = 1  # Matches any condition
      IfNotModified = 2  # If the target object is not modified. Usually it maps to etag=<specific etag>
      IfModified = 3  # Only if the target object is modified. Usually it maps to etag!=<specific etag>
      IfPresent = 4   # If the target object exists. Usually it maps to etag='*'
      IfMissing = 5   # If the target object does not exist. Usually it maps to etag!='*'
  ```



  A metaclass to support case-insensitive enums.

  ```python
  from enum import Enum

  from azure.core import CaseInsensitiveEnumMeta

  class MyCustomEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
      FOO = 'foo'
      BAR = 'bar'
  ```



  A falsy sentinel object which is supposed to be used to specify attributes
  with no data. This gets serialized to `null` on the wire.

  ```python
  from azure.core.serialization import NULL

  assert bool(NULL) is False

  foo = Foo(
      attr=NULL
  )
  ```



  This project welcomes contributions and suggestions. Most contributions require
  you to agree to a Contributor License Agreement (CLA) declaring that you have
  the right to, and actually do, grant us the rights to use your contribution.
  For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).

  When you submit a pull request, a CLA-bot will automatically determine whether
  you need to provide a CLA and decorate the PR appropriately (e.g., label,
  comment). Simply follow the instructions provided by the bot. You will only
  need to do this once across all repos using our CLA.

  This project has adopted the
  [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information, see the
  [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
  or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
  additional questions or comments.

  <!-- LINKS -->
  [package]: https://pypi.org/project/azure-core/








  - Added azure.core.AzureClouds enum to represent the different Azure clouds.
  - Added two new credential protocol classes, `SupportsTokenInfo` and `AsyncSupportsTokenInfo`, to offer more extensibility in supporting various token acquisition scenarios. #36565
    - Each new protocol class defines a `get_token_info` method that returns an `AccessTokenInfo` object.
  - Added a new `TokenRequestOptions` class, which is a `TypedDict` with optional parameters, that can be used to define options for token requests through the `get_token_info` method. #36565
  - Added a new `AccessTokenInfo` class, which is returned by `get_token_info` implementations. This class contains the token, its expiration time, and optional additional information like when a token should be refreshed. #36565
  - `BearerTokenCredentialPolicy` and `AsyncBearerTokenCredentialPolicy` now first check if a credential has the `get_token_info` method defined. If so, the `get_token_info` method is used to acquire a token. Otherwise, the `get_token` method is used. #36565
    - These policies now also check the `refresh_on` attribute when determining if a new token request should be made.



  - The Azure Core OpenTelemetry tracing plugin will now be the preferred tracing plugin over the OpenCensus plugin. If both plugins are installed and `opentelemetry` is imported, then OpenTelemetry will be used to trace Azure SDK operations.  #35050





  - Tracing: `DistributedTracingPolicy` will now set an attribute, `http.request.resend_count`, on HTTP spans for resent requests to indicate the resend attempt number.  #35069



  - Raise correct exception if transport is used while already closed  #35559



  - HTTP tracing spans will now include an `error.type` attribute if an error status code is returned.  #34619
  - Minimum required Python version is now 3.8





  - Accept float for `retry_after` header.  #34203





  - Support tuple input for file values  to `azure.core.rest.HttpRequest`  #33948
  - Support tuple input to `files` with duplicate field names  `azure.core.rest.HttpRequest`  #34021





  - Removed dependency on `anyio`.  #33282





  - Adjusted `AsyncBearerTokenCredentialPolicy` to work properly with `trio` concurrency mechanisms.   ([#33307](https://github.com/Azure/azure-sdk-for-python/pull/33307))



  - Added dependency on `anyio` >=3.0,<5.0
  - Bumped minimum dependency on `requests` to 2.21.0.





  - Fixed an issue with `multipart/form-data` in the async transport where `data` was not getting encoded into the request body. #32473



  - Use ssl context from aiohttp by default.





  - Fixed the issue that some urls trigger an infinite loop. #31346
  - Fixed issue where IndexError was raised if multipart responses did not match the number of requests. #31471
  - Fixed issue unbound variable exception if dict is invalid in CloudEvent.from_dict. #31835
  - Fixed issue asyncBearerTokenCredentialPolicy is not backward compatible with SansIOHTTPPolicy. #31836
  - Fixed issue mypy complains with new version of azure-core. #31564





  - Typing fix: `message` cannot be `None` in `AzureError`. #31564





  - Added a default implementation for `AsyncTokenCredential.__aexit__()` #31573



  - Bumped `typing-extensions` version to 4.6.0.





  - Not pass `enabled_cae` unless it is explicitly enabled.





  - A keyword argument `enable_cae` was added to the `get_token` method of the `TokenCredential` protocol.  #31012
  - `BearerTokenCredentialPolicy` and `AsyncBearerTokenCredentialPolicy` now accept `enable_cae` keyword arguments in their constructors. This is used in determining if [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) should be enabled for each `get_token` request.  #31012





  - Added header name parameter to `RequestIdPolicy`. #30772
  - Added `SensitiveHeaderCleanupPolicy` that cleans up sensitive headers if a redirect happens and the new destination is in another domain. #28349



  - Catch aiohttp errors and translate them into azure-core errors.





  - Fix url building for some complex query parameters scenarios  #30707





  - Added support to use sync credentials in `AsyncBearerTokenCredentialPolicy`. #30381
  - Added "prefix" parameter to AzureKeyCredentialPolicy #29901



  - Improve error message when providing the wrong credential type for AzureKeyCredential  #30380





  - Updated settings to include OpenTelemetry as a tracer provider.  #29095



  - Improved typing





  - Fixed deflate decompression for aiohttp   #28483





  - Fix 'ClientSession' object has no attribute 'auto_decompress'  (thanks to @mghextreme for the contribution)



  - Add "x-ms-error-code" as secure header to log
  - Rename "DEFAULT_HEADERS_WHITELIST" to "DEFAULT_HEADERS_ALLOWLIST". Added a backward compatible alias.





  - Added example of RequestsTransport with custom session.  (thanks to @inirudebwoy for the contribution)   #26768
  - Added Python 3.11 support.





  - LRO polling will not wait anymore before doing the first status check  #26376
  - Added extra dependency for [aio]. pip install azure-core[aio] installs aiohttp too.





  - Added @runtime_checkable to `TokenCredential` protocol definitions  #25187



  Azure-core is supported on Python 3.7 or later. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).



  - Added `CaseInsensitiveDict` implementation in `azure.core.utils` removing dependency on `requests` and `aiohttp`





  - Fixed the bug that azure-core could not be imported under Python 3.11.0b3  #24928
  - `ContentDecodePolicy` can now correctly deserialize more JSON bodies with different mime types #22410





  - Declare method level span as INTERNAL by default  #24492
  - Fixed type hints for `azure.core.paging.ItemPaged` #24548





  - Add `SerializationError` and `DeserializationError` in `azure.core.exceptions` for errors raised during serialization / deserialization  #24312





  - Allow stream inputs to the `content` kwarg of `azure.core.rest.HttpRequest` from objects with a `read` method  #23578





  - Improve intellisense type hinting for service client methods. #22891

  - Add a case insensitive dict `case_insensitive_dict` in `azure.core.utils`.  #23206



  - Use "\n" rather than "/n" for new line in log.     #23261



  - Log "WWW-Authenticate" header in `HttpLoggingPolicy`  #22990
  - Added dependency on `typing-extensions` >= 4.0.1





  - Limiting `final-state-via` scope to POST until consuming SDKs has been fixed to use this option properly on PUT.  #22989


  _[**This version is deprecated.**]_



  - Add support for `final-state-via` LRO option in core.  #22713



  - Add response body to string representation of `HttpResponseError` if we're not able to parse out information #22302
  - Raise `AttributeError` when calling azure.core.pipeline.transport.\_\_bases__    #22469



  - Python 2.7 is no longer supported. Please use Python version 3.6 or later.





  - Revert change in str method  #22023





  - Sync stream downloading now raises `azure.core.exceptions.DecodeError` rather than `requests.exceptions.ContentDecodingError`



  - Add response body to string representation of `HttpResponseError` if we're not able to parse out information #21800





  - Correctly set response's content to decompressed body when users are using aiohttp transport with decompression headers #21620





  - GA `send_request` onto the `azure.core.PipelineClient` and `azure.core.AsyncPipelineClient`. This method takes in
  requests and sends them through our pipelines.
  - GA `azure.core.rest`. `azure.core.rest` is our new public simple HTTP library in `azure.core` that users will use to create requests, and consume responses.
  - GA errors `StreamConsumedError`, `StreamClosedError`, and `ResponseNotReadError` to `azure.core.exceptions`. These errors
  are thrown if you mishandle streamed responses from the `azure.core.rest` module
  - add kwargs to the methods for `iter_raw` and `iter_bytes`  #21529
  - no longer raise JSON errors if users pass in file descriptors of JSON to the `json` kwarg in `HttpRequest`  #21504
  - Added new error type `IncompleteReadError` which is raised if peer closes the connection before we have received the complete message body.



  - SansIOHTTPPolicy.on_exception returns None instead of bool.



  - The `Content-Length` header in a http response is strictly checked against the actual number of bytes in the body,
    rather than silently truncating data in case the underlying tcp connection is closed prematurely.
    (thanks to @jochen-ott-by for the contribution)   #20412
  - UnboundLocalError when SansIOHTTPPolicy handles an exception    #15222
  - Add default content type header of `text/plain` and content length header for users who pass unicode strings to the `content` kwarg of `HttpRequest` in 2.7  #21550





  - respect text encoding specified in argument (thanks to @ryohji for the contribution)  #20796
  - Fix "coroutine x.read() was never awaited" warning from `ContentDecodePolicy`  #21318
  - fix type check for `data` input to `azure.core.rest` for python 2.7 users  #21341
  - use `charset_normalizer` if `chardet` is not installed to migrate aiohttp 3.8.0 changes.



  - Refactor AzureJSONEncoder (thanks to @Codejune for the contribution)  #21028





  - `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse` are now abstract base classes. They should not be initialized directly, instead
  your transport responses should inherit from them and implement them.
  - The properties of the `azure.core.rest` responses are now all read-only

  - HttpLoggingPolicy integrates logs into one record #19925





  - `azure.core.serialization.AzureJSONEncoder` (introduced in 1.17.0) serializes `datetime.datetime` objects in ISO 8601 format, conforming to RFC 3339's specification.    #20190
  - We now use `azure.core.serialization.AzureJSONEncoder` to serialize `json` input to `azure.core.rest.HttpRequest`.



  - The `text` property on `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse` has changed to a method, which also takes
  an `encoding` parameter.
  - Removed `iter_text` and `iter_lines` from `azure.core.rest.HttpResponse` and `azure.core.rest.AsyncHttpResponse`



  - The behaviour of the headers returned in `azure.core.rest` responses now aligns across sync and async. Items can now be checked case-insensitively and without raising an error for format.





  - Cut hard dependency on requests library
  - Added a `from_json` method which now accepts storage QueueMessage, eventhub's EventData or ServiceBusMessage or simply json bytes to return a `CloudEvent`



  - Not override "x-ms-client-request-id" if it already exists in the header.    #17757



  - `azure.core.rest` will not try to guess the `charset` anymore if it was impossible to extract it from `HttpResponse` analysis. This removes our dependency on `charset`.





  - Add new ***provisional*** methods `send_request` onto the `azure.core.PipelineClient` and `azure.core.AsyncPipelineClient`. This method takes in
  requests and sends them through our pipelines.
  - Add new ***provisional*** module `azure.core.rest`. `azure.core.rest` is our new public simple HTTP library in `azure.core` that users will use to create requests, and consume responses.
  - Add new ***provisional*** errors `StreamConsumedError`, `StreamClosedError`, and `ResponseNotReadError` to `azure.core.exceptions`. These errors
  are thrown if you mishandle streamed responses from the provisional `azure.core.rest` module



  - Improved error message in the `from_dict` method of `CloudEvent` when a wrong schema is sent.





  - Added `BearerTokenCredentialPolicy.on_challenge` and `.authorize_request` to allow subclasses to optionally handle authentication challenges



  - Retry policies don't sleep after operations time out
  - The `from_dict` methhod in the `CloudEvent` can now convert a datetime string to datetime object when microsecond exceeds the python limitation





  - Added `azure.core.credentials.AzureNamedKeyCredential` credential #17548.
  - Added `decompress` parameter for `stream_download` method. If it is set to `False`, will not do decompression upon the stream.    #17920



  Azure core requires Python 2.7 or Python 3.6+ since this release.



  - Added `azure.core.utils.parse_connection_string` function to parse connection strings across SDKs, with common validation and support for case insensitive keys.
  - Supported adding custom policies  #16519
  - Added `~azure.core.tracing.Link` that should be used while passing `Links` to  `AbstractSpan`.
  - `AbstractSpan` constructor can now take in additional keyword only args.



  - Make NetworkTraceLoggingPolicy show the auth token in plain text. #14191
  - Fixed RetryPolicy overriding default connection timeout with an extreme value #17481



  This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.



  - Added `azure.core.messaging.CloudEvent` model that follows the cloud event spec.
  - Added `azure.core.serialization.NULL` sentinel value
  - Improve `repr`s for `HttpRequest` and `HttpResponse`s  #16972



  - Disable retry in stream downloading. (thanks to @jochen-ott-by @hoffmann for the contribution)  #16723





  - Added `CaseInsensitiveEnumMeta` class for case-insensitive enums.  #16316
  - Add `raise_for_status` method onto `HttpResponse`. Calling `response.raise_for_status()` on a response with an error code
  will raise an `HttpResponseError`. Calling it on a good response will do nothing  #16399



  - Update conn.conn_kw rather than overriding it when setting block size. (thanks for @jiasli for the contribution)  #16587





  - Added `AzureSasCredential` and its respective policy. #15946





  - Add a `continuation_token` attribute to the base `AzureError` exception, and set this value for errors raised
    during paged or long-running operations.



  - Set retry_interval to 1 second instead of 1000 seconds (thanks **vbarbaresi** for contributing)  #14357






  - Fixed bug to allow polling in the case of parameterized endpoints with relative polling urls  #14097






  - SAS credential replicated "/" fix #13159





  - Support params as list for exploding parameters  #12410






  - `AzureKeyCredentialPolicy` will now accept (and ignore) passed in kwargs  #11963
  - Better error messages if passed endpoint is incorrect  #12106
  - Do not JSON encore a string if content type is "text"  #12137



  - Added `http_logging_policy` property on the `Configuration` object, allowing users to individually
  set the http logging policy of the config  #12218





  - Fixed deadlocks in AsyncBearerTokenCredentialPolicy #11543
  - Fix AttributeException in StreamDownloadGenerator #11462



  - Added support for changesets as part of multipart message support #10485
  - Add AsyncLROPoller in azure.core.polling #10801
  - Add get_continuation_token/from_continuation_token/polling_method methods in pollers (sync and async) #10801
  - HttpResponse and PipelineContext objects are now pickable #10801





  - Support "x-ms-retry-after-ms" in response header   #10743
  - `link` and `link_from_headers` now accepts attributes   #10765



  - Not retry if the status code is less than 400 #10778
  - "x-ms-request-id" is not considered safe header for logging #10967





  - Support a default error type in map_error #9773
  - Added `AzureKeyCredential` and its respective policy. #10509
  - Added `azure.core.polling.base_polling` module with a "Microsoft One API" polling implementation #10090
    Also contains the async version in `azure.core.polling.async_base_polling`
  - Support kwarg `enforce_https` to disable HTTPS check on authentication #9821
  - Support additional kwargs in `HttpRequest.set_multipart_mixed` that will be passed into pipeline context.





  - Appended RequestIdPolicy to the default pipeline  #9841
  - Rewind the body position in async_retry   #10117



  - Add raw_request_hook support in custom_hook_policy   #9958
  - Add timeout support in retry_policy   #10011
  - Add OdataV4 error format auto-parsing in all exceptions ('error' attribute)  #9738





  - Fixed a bug that sends None as request_id #9545
  - Enable mypy for customers #9572
  - Handle TypeError in deep copy #9620
  - Fix text/plain content-type in decoder #9589





  - Fixed a regression in 1.2.0 that was incompatible with azure-keyvault-* 4.0.0
  [#9462](https://github.com/Azure/azure-sdk-for-python/issues/9462)






  - Add user_agent & sdk_moniker kwargs in UserAgentPolicy init   #9355
  - Support OPTIONS HTTP verb     #9322
  - Add tracing_attributes to tracing decorator   #9297
  - Support auto_request_id in RequestIdPolicy   #9163
  - Support fixed retry   #6419
  - Support "retry-after-ms" in response header   #9240



  - Removed `__enter__` and `__exit__` from async context managers    #9313





  - Bearer token authorization requires HTTPS
  - Rewind the body position in retry #8307





  - New RequestIdPolicy   #8437
  - Enable logging policy in default pipeline #8053
  - Normalize transport timeout.   #8000
    Now we have:
    * 'connection_timeout' - a single float in seconds for the connection timeout. Default 5min
    * 'read_timeout' - a single float in seconds for the read timeout. Default 5min



  - RequestHistory: deepcopy fails if request contains a stream  #7732
  - Retry: retry raises error if response does not have http_response #8629
  - Client kwargs are now passed to DistributedTracingPolicy correctly    #8051
  - NetworkLoggingPolicy now logs correctly all requests in case of retry #8262





  - Tracing: DistributedTracingPolicy now accepts kwargs network_span_namer to change network span name  #7773
  - Tracing: Implementation of AbstractSpan can now use the mixin HttpSpanMixin to get HTTP span update automatically  #7773
  - Tracing: AbstractSpan contract "change_context" introduced  #7773
  - Introduce new policy HttpLoggingPolicy  #7988



  - Fix AsyncioRequestsTransport if input stream is an async generator  #7743
  - Fix form-data with aiohttp transport  #7749



  - Tracing: AbstractSpan.set_current_span is longer supported. Use change_context instead.  #7773
  - azure.core.pipeline.policies.ContentDecodePolicy.deserialize_from_text changed





  - Tracing: network span context is available with the TRACING_CONTEXT in pipeline response  #7252
  - Tracing: Span contract now has `kind`, `traceparent` and is a context manager  #7252
  - SansIOHTTPPolicy methods can now be coroutines #7497
  - Add multipart/mixed support #7083:

    - HttpRequest now has a "set_multipart_mixed" method to set the parts of this request
    - HttpRequest now has a "prepare_multipart_body" method to build final body.
    - HttpResponse now has a "parts" method to return an iterator of parts
    - AsyncHttpResponse now has a "parts" methods to return an async iterator of parts
    - Note that multipart/mixed is a Python 3.x only feature



  - Tracing: policy cannot fail the pipeline, even in the worst condition  #7252
  - Tracing: policy pass correctly status message if exception  #7252
  - Tracing: incorrect span if exception raised from decorated function  #7133
  - Fixed urllib3 ConnectTimeoutError being raised by Requests during a socket timeout. Now this exception is caught and wrapped as a `ServiceRequestError`  #7542



  - Tracing: `azure.core.tracing.context` removed
  - Tracing: `azure.core.tracing.context.tracing_context.with_current_context` renamed to `azure.core.tracing.common.with_current_context`  #7252
  - Tracing: `link` renamed `link_from_headers`  and `link` takes now a string
  - Tracing: opencensus implementation has been moved to the package `azure-core-tracing-opencensus`
  - Some modules and classes that were importables from several different places have been removed:

     - `azure.core.HttpResponseError` is now only `azure.core.exceptions.HttpResponseError`
     - `azure.core.Configuration` is now only `azure.core.configuration.Configuration`
     - `azure.core.HttpRequest` is now only `azure.core.pipeline.transport.HttpRequest`
     - `azure.core.version` module has been removed. Use `azure.core.__version__` to get version number.
     - `azure.core.pipeline_client` has been removed. Import from `azure.core` instead.
     - `azure.core.pipeline_client_async` has been removed. Import from `azure.core` instead.
     - `azure.core.pipeline.base` has been removed. Import from `azure.core.pipeline` instead.
     - `azure.core.pipeline.base_async` has been removed. Import from `azure.core.pipeline` instead.
     - `azure.core.pipeline.policies.base` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.base_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.authentication` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.authentication_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.custom_hook` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.redirect` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.redirect_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.retry` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.retry_async` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.distributed_tracing` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.pipeline.policies.universal` has been removed. Import from `azure.core.pipeline.policies` instead.
     - `azure.core.tracing.abstract_span` has been removed. Import from `azure.core.tracing` instead.
     - `azure.core.pipeline.transport.base` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.base_async` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_basic` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_asyncio` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.requests_trio` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.pipeline.transport.aiohttp` has been removed. Import from `azure.core.pipeline.transport` instead.
     - `azure.core.polling.poller` has been removed. Import from `azure.core.polling` instead.
     - `azure.core.polling.async_poller` has been removed. Import from `azure.core.polling` instead.





  -  Fix aiohttp auto-headers #6992
  -  Add tracing to policies module init  #6951





  - Transport classes don't take `config` parameter anymore (use kwargs instead)  #6372
  - `azure.core.paging` has been completely refactored  #6420
  - HttpResponse.content_type attribute is now a string (was a list)  #6490
  - For `StreamDownloadGenerator` subclasses, `response` is now an `HttpResponse`, and not a transport response like `aiohttp.ClientResponse` or `requests.Response`. The transport response is available in `internal_response` attribute  #6490



  - aiohttp is not required to import async pipelines classes #6496
  - `AsyncioRequestsTransport.sleep` is now a coroutine as expected #6490
  - `RequestsTransport` is not tight to `ProxyPolicy` implementation details anymore #6372
  - `AiohttpTransport` does not raise on unexpected kwargs  #6355



  - New paging base classes that support `continuation_token` and `by_page()`  #6420
  - Proxy support for `AiohttpTransport`  #6372



  - Preview 1 release


