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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions azure-cognitiveservices-inkrecognizer/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:

Release History
===============

0.1.0 (1970-01-01)
++++++++++++++++++

* Initial Release
5 changes: 5 additions & 0 deletions azure-cognitiveservices-inkrecognizer/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/cognitiveservices/__init__.py

33 changes: 33 additions & 0 deletions azure-cognitiveservices-inkrecognizer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure MyService Management Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Usage
=====

For code examples, see `MyService Management
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


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.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-inkrecognizer%2FREADME.png
1 change: 1 addition & 0 deletions azure-cognitiveservices-inkrecognizer/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .ink_recognizer_client import InkRecognizerClient
from .version import VERSION

__all__ = ['InkRecognizerClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.ink_recognizer_operations import InkRecognizerOperations
from . import models


class InkRecognizerClientConfiguration(Configuration):
"""Configuration for InkRecognizerClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = 'https://{Endpoint}/inkrecognizer/v1.0-preview'

super(InkRecognizerClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-cognitiveservices-inkrecognizer/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials


class InkRecognizerClient(SDKClient):
"""The service is used to perform ink layout and recognition of written words and shapes. Ink strokes passed to the service are recognized and organized into recognition results in the response

:ivar config: Configuration for client.
:vartype config: InkRecognizerClientConfiguration

:ivar ink_recognizer: InkRecognizer operations
:vartype ink_recognizer: azure.cognitiveservices.inkrecognizer.operations.InkRecognizerOperations

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

self.config = InkRecognizerClientConfiguration(endpoint, credentials)
super(InkRecognizerClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '1.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.ink_recognizer = InkRecognizerOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from .drawing_attributes_pattern_color_py3 import DrawingAttributesPatternColor
from .drawing_attributes_pattern_py3 import DrawingAttributesPattern
from .point_details_pattern_py3 import PointDetailsPattern
from .alternate_pattern_item_py3 import AlternatePatternItem
from .recognition_unit_item_bounding_rectangle_py3 import RecognitionUnitItemBoundingRectangle
from .recognition_unit_item_py3 import RecognitionUnitItem
from .stroke_py3 import Stroke
from .analysis_response_py3 import AnalysisResponse
from .error_model_details_item_py3 import ErrorModelDetailsItem
from .error_model_py3 import ErrorModel, ErrorModelException
from .analysis_request_py3 import AnalysisRequest
except (SyntaxError, ImportError):
from .drawing_attributes_pattern_color import DrawingAttributesPatternColor
from .drawing_attributes_pattern import DrawingAttributesPattern
from .point_details_pattern import PointDetailsPattern
from .alternate_pattern_item import AlternatePatternItem
from .recognition_unit_item_bounding_rectangle import RecognitionUnitItemBoundingRectangle
from .recognition_unit_item import RecognitionUnitItem
from .stroke import Stroke
from .analysis_response import AnalysisResponse
from .error_model_details_item import ErrorModelDetailsItem
from .error_model import ErrorModel, ErrorModelException
from .analysis_request import AnalysisRequest
from .ink_recognizer_client_enums import (
RasterOp,
Tip,
Shape,
Category,
Container,
Leaf,
Kind,
Unit,
Application,
)

__all__ = [
'DrawingAttributesPatternColor',
'DrawingAttributesPattern',
'PointDetailsPattern',
'AlternatePatternItem',
'RecognitionUnitItemBoundingRectangle',
'RecognitionUnitItem',
'Stroke',
'AnalysisResponse',
'ErrorModelDetailsItem',
'ErrorModel', 'ErrorModelException',
'AnalysisRequest',
'RasterOp',
'Tip',
'Shape',
'Category',
'Container',
'Leaf',
'Kind',
'Unit',
'Application',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AlternatePatternItem(Model):
"""AlternatePatternItem.

All required parameters must be populated in order to send to Azure.

:param category: Required. Possible values include: 'inkDrawing',
'inkBullet', 'inkWord', 'unknown'
:type category: str or ~azure.cognitiveservices.inkrecognizer.models.Leaf
:param points: Array of point objects that represent points that are
relevant to the type of recognition unit. For example, for leaf node of
inkDrawing category that represents a triangle, points would include the
x,y coordinates of the vertices of the recognized triangle. The points
represent the coordinates of points used to create the perfectly drawn
shape that is closest to the original input. They may not exactly match.
:type points:
list[~azure.cognitiveservices.inkrecognizer.models.PointDetailsPattern]
:param rotation_angle: The angular orientation of an object relative to
the horizontal axis
:type rotation_angle: float
:param confidence: A number between 0 and 1 which indicates the confidence
level in the result
:type confidence: float
:param recognized_string: Required. The recognized string from an inkWord
or the name of a recognized shape in an inkDrawing object
:type recognized_string: str
"""

_validation = {
'category': {'required': True},
'recognized_string': {'required': True},
}

_attribute_map = {
'category': {'key': 'category', 'type': 'str'},
'points': {'key': 'points', 'type': '[PointDetailsPattern]'},
'rotation_angle': {'key': 'rotationAngle', 'type': 'float'},
'confidence': {'key': 'confidence', 'type': 'float'},
'recognized_string': {'key': 'recognizedString', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AlternatePatternItem, self).__init__(**kwargs)
self.category = kwargs.get('category', None)
self.points = kwargs.get('points', None)
self.rotation_angle = kwargs.get('rotation_angle', None)
self.confidence = kwargs.get('confidence', None)
self.recognized_string = kwargs.get('recognized_string', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AlternatePatternItem(Model):
"""AlternatePatternItem.

All required parameters must be populated in order to send to Azure.

:param category: Required. Possible values include: 'inkDrawing',
'inkBullet', 'inkWord', 'unknown'
:type category: str or ~azure.cognitiveservices.inkrecognizer.models.Leaf
:param points: Array of point objects that represent points that are
relevant to the type of recognition unit. For example, for leaf node of
inkDrawing category that represents a triangle, points would include the
x,y coordinates of the vertices of the recognized triangle. The points
represent the coordinates of points used to create the perfectly drawn
shape that is closest to the original input. They may not exactly match.
:type points:
list[~azure.cognitiveservices.inkrecognizer.models.PointDetailsPattern]
:param rotation_angle: The angular orientation of an object relative to
the horizontal axis
:type rotation_angle: float
:param confidence: A number between 0 and 1 which indicates the confidence
level in the result
:type confidence: float
:param recognized_string: Required. The recognized string from an inkWord
or the name of a recognized shape in an inkDrawing object
:type recognized_string: str
"""

_validation = {
'category': {'required': True},
'recognized_string': {'required': True},
}

_attribute_map = {
'category': {'key': 'category', 'type': 'str'},
'points': {'key': 'points', 'type': '[PointDetailsPattern]'},
'rotation_angle': {'key': 'rotationAngle', 'type': 'float'},
'confidence': {'key': 'confidence', 'type': 'float'},
'recognized_string': {'key': 'recognizedString', 'type': 'str'},
}

def __init__(self, *, category, recognized_string: str, points=None, rotation_angle: float=None, confidence: float=None, **kwargs) -> None:
super(AlternatePatternItem, self).__init__(**kwargs)
self.category = category
self.points = points
self.rotation_angle = rotation_angle
self.confidence = confidence
self.recognized_string = recognized_string
Loading