{ "info": { "author": "Microsoft Corporation", "author_email": "azpysdkhelp@microsoft.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Azure Ink Recognizer client library for Python\n\nAzure Ink Recognizer SDK is an SDK for developers to work with Azure Ink Recognizer Service. The service recognize a collection of ink strokes and return a tree hierarchy of the recognized units, such as lines, words, shapes, as well as the handwriting recognition result of the words.\n\nFeatures:\n\n* Connect to Azure Ink Recognizer Service\n* Convert collections of ink strokes into HTTP requests\n* Parse HTTP response into ink recognition units\n\n[Source code][source_code] | [Package (PyPi)][pypi] | [API reference documentation][ref_inkrecognizer_sdk] | [Product documentation][ink_recognizer_docs] | [Samples][samples]\n\n## Getting started\n\n### Install the package\n\nInstall the Azure Cosmos DB client library for Python with [pip][pip]:\n\n```Bash\npip install azure-cognitiveservices-inkrecognizer\n```\n\n**Prerequisites**: You must have an [Azure subscription][azure_sub]. You must have [Python 2.7][python] or [Python 3.5.3+][python] to use this package. Asynchronous features supports Python 3.5.3+ only.\n\n#### Get URL\n\nPlease find the URL at [Ink Recognizer Rest API documentation][ink_recognizer_restapi_docs]\n\n#### Get credentials\n\nPlease follow the instructions on [Ink Recognizer][azure_ink_recognizer_home].\n\n## Key concepts\n\n### Implement ink stroke\n\nIf you don't have any pre-defined ink point or ink stroke classes, you can either follow the [Ink Stroke Interfaces][ref_ink_stroke_file] to build your stroke, or build your own class that has all required fields. If you already defined ink strokes yourself, you should feed attributes in your class according to the interfaces.\n\n```Python\nfrom azure.cognitiveservices.inkrecognizer import InkStrokeKind\n\nInkPoint = namedtuple(\"InkPoint\", \"x y\")\n\nclass InkStroke():\n def __init__(self,\n ink_stroke_id,\n ink_points,\n stroke_kind=InkStrokeKind.UNKNOWN,\n stroke_language=\"\"):\n self.id = ink_stroke_id\n self.points = ink_points\n self.kind = stroke_kind\n self.language = stroke_language\n```\n\nYou can then create a list (or any iterable object) of ink strokes for recognition.\n\n### Create a client\n\nOnce you got the url for ink recognizer service and an Azure credential instance, you can create an InkRecognizerClient\n\n```Python\nfrom azure.cognitiveservices.inkrecognizer import InkRecognizerClient\nclient = InkRecognizerClient(url, api_key) # api_key is your key as string\n```\n\nOr use Async version (Python 3.5.3+ only)\n\n```Python\nfrom azure.cognitiveservices.inkrecognizer.aio import InkRecognizerClient\nclient = InkRecognizerClient(url, api_key) # api_key is your key as string\n```\n\n### Send a request\n\nYou can then send stroke list to Ink Recognizer Service and get the root of all ink recognition results.\n\n```Python\n# Sync version\nrecognition_root = client.recognize_ink(ink_stroke_list)\n# Async version\nrecognition_root = await client.recognize_ink(ink_stroke_list)\n```\n\n### Get recognition units from results\n\nYou can get all the recognition units either by InkRecognitionUnitKind or by hierarchy, then visit support properties of the units. [API reference documentation][ref_inkrecognizer_sdk]\n\n```Python\nlines = recognition_root.lines\nfor line in lines:\n foo_show_bounding_box(line.bounding_box)\n for word in line.words:\n print(word.recognized_text)\n```\n\n## Examples\n\nThe [Samples][samples] provide several code snippets covering some of the most common Ink Recognizer SDK tasks, including:\n\n* Implement InkPoint and InkStroke classes\n* Convert stroke unit from pixel to mm\n* Set language recognition locale\n* Indexing a key word from recognition results\n* Set application kind if user know expected type of ink content\n\n## Troubleshooting\n\n### General\n\nInk Recognizer clients raise exceptions defined in azure-core. For example, if you try to reach an invalid URL, InkRecognizerClient raises ResourceNotFoundError:\n\n```Python\nfrom azure.core.exceptions import ResourceNotFoundError\nclient = InkRecognizerClient(\"invalid_url\", credential)\n\ntry:\n client.recognize_ink(ink_strokes)\nexcept ResourceNotFoundError as e:\n print(e.message)\n```\n\n### Logging\n\nNetwork trace logging is disabled by default for this library. When enabled, HTTP requests will be logged at DEBUG level using the logging library. You can configure logging to print debugging information to stdout or write it to a file:\n\n```Python\nimport sys\nimport logging\n\n# Create a logger for the 'azure' SDK\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n# Configure a console output\nhandler = logging.StreamHandler(stream=sys.stdout)\nlogger.addHandler(handler)\n\n# Configure a file output\nfile_handler = logging.FileHandler(filename)\nlogger.addHandler(file_handler)\n\n# Enable network trace logging. Each HTTP request will be logged at DEBUG level.\nclient = InkRecognizerClient(url=url, credential=credential, logging_enable=True)\n```\n\n## Next steps\n\nPlease find interactive inking samples at [tkinter sample](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples/tree/master/samples/vision/inkrecognizer_tkinter_sample.py) and [wxpython sample](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples/tree/master/samples/vision/inkrecognizer_tkinter_sample.py).\n\n### Additional documentation\n\nFor more extensive documentation on the Ink Recognizer Service, see the [Ink Recognizer Service Documentation][ink_recognizer_docs].\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n\n[azure_sub]: https://azure.microsoft.com/free/\n[ink_recognizer_docs]: https://docs.microsoft.com/azure/cognitive-services/ink-recognizer/\n[ink_recognizer_restapi_docs]: https://docs.microsoft.com/rest/api/cognitiveservices/inkrecognizer/inkrecognizer/recognize\n[azure_ink_recognizer_home]: https://azure.microsoft.com/services/cognitive-services/ink-recognizer/\n[pip]: https://pypi.org/project/pip/\n[pypi]: https://pypi.org/project/azure-cosmos/\n[python]: https://www.python.org/downloads/\n[ref_inkrecognizer_sdk]: https://\n[ref_ink_stroke_file]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-inkrecognizer/azure/cognitiveservices/inkrecognizer/_ink_stroke.py\n[ref_inkrecognizer_client]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-inkrecognizer/azure/cognitiveservices/inkrecognizer/_client.py\n[samples]: https://github.com/Azure-Samples/cognitive-services-python-sdk-samples/tree/master/samples/vision\n[source_code]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-inkrecognizer\n\n\n# History\n\n## Version 1.0.0b1\n\nInitial version for preview\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-inkrecognizer", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "azure-cognitiveservices-inkrecognizer", "package_url": "https://pypi.org/project/azure-cognitiveservices-inkrecognizer/", "platform": "", "project_url": "https://pypi.org/project/azure-cognitiveservices-inkrecognizer/", "project_urls": { "Homepage": "https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-inkrecognizer" }, "release_url": "https://pypi.org/project/azure-cognitiveservices-inkrecognizer/1.0.0b1/", "requires_dist": [ "azure-core (<2.0.0,>=1.0.0b2)", "azure-cognitiveservices-nspkg ; python_version<'3.0'", "enum34 (>=1.0.4) ; python_version<'3.0'" ], "requires_python": "", "summary": "Microsoft Azure Ink Recognizer Library for Python", "version": "1.0.0b1" }, "last_serial": 5915614, "releases": { "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "8482909832fbbdee6c86cc763f9c8dde", "sha256": "3db7993a89549276fa0dd3f6e2f2655803a8459b8b4ee4696d540d0e91d8f577" }, "downloads": -1, "filename": "azure_cognitiveservices_inkrecognizer-1.0.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8482909832fbbdee6c86cc763f9c8dde", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19497, "upload_time": "2019-10-01T23:21:33", "url": "https://files.pythonhosted.org/packages/ac/04/8ca85624cfd2a1680bd78073038e0877f03110f456da9baf7f2bfb34aa33/azure_cognitiveservices_inkrecognizer-1.0.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f984c1320ae9cf7cd7b7e849e84cd96b", "sha256": "bf3d7f9e0326dc59971e9aa06247f0fec0d43e099f67521c5663200d0bcb9a27" }, "downloads": -1, "filename": "azure-cognitiveservices-inkrecognizer-1.0.0b1.zip", "has_sig": false, "md5_digest": "f984c1320ae9cf7cd7b7e849e84cd96b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30623, "upload_time": "2019-10-01T23:21:36", "url": "https://files.pythonhosted.org/packages/17/27/5a87a11cb7055ba916591ea2e28a662746bea7d8468031abd4a26c8e3a44/azure-cognitiveservices-inkrecognizer-1.0.0b1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8482909832fbbdee6c86cc763f9c8dde", "sha256": "3db7993a89549276fa0dd3f6e2f2655803a8459b8b4ee4696d540d0e91d8f577" }, "downloads": -1, "filename": "azure_cognitiveservices_inkrecognizer-1.0.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8482909832fbbdee6c86cc763f9c8dde", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19497, "upload_time": "2019-10-01T23:21:33", "url": "https://files.pythonhosted.org/packages/ac/04/8ca85624cfd2a1680bd78073038e0877f03110f456da9baf7f2bfb34aa33/azure_cognitiveservices_inkrecognizer-1.0.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f984c1320ae9cf7cd7b7e849e84cd96b", "sha256": "bf3d7f9e0326dc59971e9aa06247f0fec0d43e099f67521c5663200d0bcb9a27" }, "downloads": -1, "filename": "azure-cognitiveservices-inkrecognizer-1.0.0b1.zip", "has_sig": false, "md5_digest": "f984c1320ae9cf7cd7b7e849e84cd96b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30623, "upload_time": "2019-10-01T23:21:36", "url": "https://files.pythonhosted.org/packages/17/27/5a87a11cb7055ba916591ea2e28a662746bea7d8468031abd4a26c8e3a44/azure-cognitiveservices-inkrecognizer-1.0.0b1.zip" } ] }