Metadata-Version: 2.1
Name: azure-ai-anomalydetector
Version: 3.0.0b6
Summary: Microsoft Azure Cognitive Services Anomaly Detector Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Anomaly Detector Client Library.
This package has been tested with Python 3.6+.

For a more complete set of Azure libraries, see the
[azure sdk python release](https://aka.ms/azsdk/python/all).

### Authenticate the client

#### Get the endpoint

You can find the endpoint for your Language service resource using the
[Azure Portal][azure_portal_get_endpoint]
or [Azure CLI][azure_cli_endpoint_lookup]:

```bash
# Get the endpoint for the Language service resource
az cognitiveservices account show --name "resource-name" --resource-group "resource-group-name" --query "properties.endpoint"
```

#### Get the API Key

You can get the [API key][cognitive_authentication_api_key] from the Cognitive Services or Language service resource in the [Azure Portal][azure_portal_get_endpoint].
Alternatively, you can use [Azure CLI][azure_cli_endpoint_lookup] snippet below to get the API key of your resource.

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

#### Create a AnomalyDetectorClient with an API Key Credential

Once you have the value for the API key, you can pass it as a string into an instance of [AzureKeyCredential][azure-key-credential]. Use the key as the credential parameter
to authenticate the client:

```python
from azure.core.credentials import AzureKeyCredential
from azure.ai.anomalydetector import AnomalyDetectorClient

credential = AzureKeyCredential("<api_key>")
client = AnomalyDetectorClient(endpoint="https://<resource-name>.cognitiveservices.azure.com/", credential=credential)
```

#### Create a AnomalyDetectorClient with an Azure Active Directory Credential

To use an [Azure Active Directory (AAD) token credential][cognitive_authentication_aad],
provide an instance of the desired credential type obtained from the
[azure-identity][azure_identity_credentials] library.
Note that regional endpoints do not support AAD authentication. Create a [custom subdomain][custom_subdomain]
name for your resource in order to use this type of authentication.

Authentication with AAD requires some initial setup:

- [Install azure-identity][install_azure_identity]
- [Register a new AAD application][register_aad_app]
- [Grant access][grant_role_access] to the Language service by assigning the `"Cognitive Services User"` role to your service principal.

After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use.
As an example, [DefaultAzureCredential][default_azure_credential]
can be used to authenticate the client:

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

Use the returned token credential to authenticate the client:

```python
from azure.ai.anomalydetector import AnomalyDetectorClient
from azure.core.pipeline.policies import BearerTokenCredentialPolicy
from azure.identity import DefaultAzureCredential

credential = DefaultAzureCredential()
client = AnomalyDetectorClient(
    endpoint="https://<resource-name>.cognitiveservices.azure.com/",
    authentication_policy=BearerTokenCredentialPolicy(credential, "https://cognitiveservices.azure.com/.default"),
    credential=credential
)
```

# Provide Feedback

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-ai-anomalydetector%2FREADME.png)

<!-- LINKS -->

[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://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows#get-the-keys-for-your-resource
[cognitive_authentication]: https://docs.microsoft.com/azure/cognitive-services/authentication
[cognitive_authentication_api_key]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows#get-the-keys-for-your-resource
[install_azure_identity]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#install-the-package
[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
[grant_role_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
[cognitive_custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains
[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain
[cognitive_authentication_aad]: https://docs.microsoft.com/azure/cognitive-services/authentication#authenticate-with-azure-active-directory
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[azure-key-credential]: https://aka.ms/azsdk-python-core-azurekeycredential


# Release History

## 3.0.0b6 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Python 2.7 is no longer supported. Please use Python version 3.6 or later.

## 3.0.0b5 (2022-01-23)

  - Fix release issues

## 3.0.0b4 (2022-01-18)

  **Features**
  - Introduced the new API: `AnomalyDetectorClientOperationsMixin.last_detect_anomaly`.
  - Added 2 new optional properties: `impute_mode` & `impute_fixed_value` to `DetectRequest` object.
  - Added 1 new optional property: `severity` to the `EntireDetectResponse` & `LastDetectResponse` objects.
  - Removed the optional property `errors` from the `VariableState` object.
  - Refactored the optional property `contributors` to `interpretation` from the `AnomalyValue` object.
  - Modified the `FillNAMethod` object into an extensible enum.

## 3.0.0b3 (2021-04-16)

  **Features**
  - Added operation AnomalyDetectorClientOperationsMixin.list_multivariate_model
  - Added operation AnomalyDetectorClientOperationsMixin.train_multivariate_model
  - Added operation AnomalyDetectorClientOperationsMixin.detect_anomaly
  - Added operation AnomalyDetectorClientOperationsMixin.get_detection_result
  - Added operation AnomalyDetectorClientOperationsMixin.get_multivariate_model
  - Added operation AnomalyDetectorClientOperationsMixin.export_model
  - Added operation AnomalyDetectorClientOperationsMixin.delete_multivariate_model

## 3.0.0b2 (2020-08-27)

  **Bug Fixes**
  - Fixed an issue with ChangePointDetect

  **Breaking Changes**
  - Renamed `entire_detect` to `detect_entire_series`
  - Renamed `APIError` to `AnomalyDetectorError`
  - Renamed `Request` to `DetectRequest`
  - Renamed `last_detect` to `detect_last_point`
  - Renamed `change_point_detect` to `detect_change_point`
  - Renamed `Granularity` to `TimeGranularity`
  - Renamed `minutely` and `secondly` to `per_minute` and `per_second`
  - Renamed `Point` to `TimeSeriesPoint`


## 3.0.0b1 (2020-08-17)

  - Initial Release
