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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (1970-01-01)

* Initial Release
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/cognitiveservices/__init__.py

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure MyService Management 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 [Github repo](https://github.com/Azure/azure-sdk-for-python/)


# 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.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-inkrecognizer%2FREADME.png)
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,19 @@
# 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 ._configuration import InkRecognizerClientConfiguration
from ._ink_recognizer_client import InkRecognizerClient
__all__ = ['InkRecognizerClient', 'InkRecognizerClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 import Configuration

from .version import VERSION


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://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)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

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

self.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 Serializer, Deserializer

from ._configuration import InkRecognizerClientConfiguration
from .operations import InkRecognizerOperations
from . import models


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://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,77 @@
# 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 ._models_py3 import AlternatePatternItem
from ._models_py3 import AnalysisRequest
from ._models_py3 import AnalysisResponse
from ._models_py3 import DrawingAttributesPattern
from ._models_py3 import DrawingAttributesPatternColor
from ._models_py3 import ErrorModel, ErrorModelException
from ._models_py3 import ErrorModelDetailsItem
from ._models_py3 import InkPoint
from ._models_py3 import InkPointValueAttribute
from ._models_py3 import PointDetailsPattern
from ._models_py3 import RecognitionUnitItem
from ._models_py3 import RecognitionUnitItemBoundingRectangle
from ._models_py3 import Stroke
except (SyntaxError, ImportError):
from ._models import AlternatePatternItem
from ._models import AnalysisRequest
from ._models import AnalysisResponse
from ._models import DrawingAttributesPattern
from ._models import DrawingAttributesPatternColor
from ._models import ErrorModel, ErrorModelException
from ._models import ErrorModelDetailsItem
from ._models import InkPoint
from ._models import InkPointValueAttribute
from ._models import PointDetailsPattern
from ._models import RecognitionUnitItem
from ._models import RecognitionUnitItemBoundingRectangle
from ._models import Stroke
from ._ink_recognizer_client_enums import (
Application,
Category,
Container,
InputDevice,
Kind,
Leaf,
RasterOp,
Shape,
Tip,
Unit,
)

__all__ = [
'AlternatePatternItem',
'AnalysisRequest',
'AnalysisResponse',
'DrawingAttributesPattern',
'DrawingAttributesPatternColor',
'ErrorModel', 'ErrorModelException',
'ErrorModelDetailsItem',
'InkPoint',
'InkPointValueAttribute',
'PointDetailsPattern',
'RecognitionUnitItem',
'RecognitionUnitItemBoundingRectangle',
'Stroke',
'RasterOp',
'Tip',
'Shape',
'Category',
'Container',
'Leaf',
'Kind',
'Unit',
'Application',
'InputDevice',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# 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 enum import Enum


class RasterOp(str, Enum):

no_operation = "noOperation"
copy_pen = "copyPen"
mask_pen = "maskPen"


class Tip(str, Enum):

ellipse = "ellipse"
rectangle = "rectangle"


class Shape(str, Enum):

drawing = "drawing"
square = "square"
rectangle = "rectangle"
circle = "circle"
ellipse = "ellipse"
triangle = "triangle"
isosceles_triangle = "isoscelesTriangle"
equilateral_triangle = "equilateralTriangle"
right_triangle = "rightTriangle"
quadrilateral = "quadrilateral"
diamond = "diamond"
trapezoid = "trapezoid"
parallelogram = "parallelogram"
pentagon = "pentagon"
hexagon = "hexagon"
block_arrow = "blockArrow"
heart = "heart"
star_simple = "starSimple"
star_crossed = "starCrossed"
cloud = "cloud"
line = "line"
curve = "curve"
poly_line = "polyLine"


class Category(str, Enum):

root = "root"
writing_region = "writingRegion"
paragraph = "paragraph"
line = "line"
ink_bullet = "inkBullet"
ink_drawing = "inkDrawing"
ink_word = "inkWord"
unknown = "unknown"


class Container(str, Enum):

root = "root"
writing_region = "writingRegion"
paragraph = "paragraph"
line = "line"


class Leaf(str, Enum):

ink_drawing = "inkDrawing"
ink_bullet = "inkBullet"
ink_word = "inkWord"
unknown = "unknown"


class Kind(str, Enum):

ink_drawing = "inkDrawing"
ink_writing = "inkWriting"


class Unit(str, Enum):

mm = "mm"
cm = "cm"
in_enum = "in"


class Application(str, Enum):

drawing = "drawing"
writing = "writing"
mixed = "mixed"


class InputDevice(str, Enum):

digitizer = "digitizer"
pen = "pen"
light_pen = "lightPen"
touch_screen = "touchScreen"
touch_pad = "touchPad"
white_board = "whiteBoard"
threed_digitizer = "3dDigitizer"
stereo_plotter = "stereoPlotter"
articulated_arm = "articulatedArm"
armature = "armature"
Loading