From 649dae06e0da5b76e6c550a5ed1fed4937b2d6c3 Mon Sep 17 00:00:00 2001 From: i-mochalov Date: Mon, 1 Apr 2019 15:12:00 +0300 Subject: [PATCH] Release 19.3.0 --- README.md | 11 ++- groupdocsclassificationcloud/apis/__init__.py | 1 + .../apis/classification_api.py | 80 +------------------ .../models/classify_request.py | 1 + .../get_supported_file_formats_request.py | 1 + setup.py | 6 +- test/Common/test_api_coverage.py | 2 +- test/Common/test_error_handling.py | 2 +- test/base_test_context.py | 2 +- test/test_classify.py | 6 +- 10 files changed, 19 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index dfc8f75..84d14c5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# groupdocs-classification-cloud-python -This repository contains GroupDocs.Classification Cloud SDK for Python source code. This SDK allows you to work with GroupDocs.Classification Cloud REST APIs in your Python applications quickly and easily, with zero initial cost. +# groupdocs-classification-cloud-sdk-py +This repository contains GroupDocs.Classification Cloud (https://products.groupdocs.cloud/classification) SDK for Python source code. This SDK allows you to work with GroupDocs.Classification Cloud REST APIs in your Python applications quickly and easily, with zero initial cost. # Key Features * Classification of texts @@ -76,7 +76,12 @@ classification.classify_raw_text() ``` [Test](test/) contain various examples of using the SDK. -Please put your credentials into [Configuration](groupdocsclassificationcloud/configuration.py). +Please put your credentials into [Configuration](groupdocsclassificationcloud/configuration.py) or use Settings/servercreds.json file: +{ + "BaseUrl":"https://api.groupdocs.cloud", + "AppSid":"Your App Sid", + "AppKey":"Your App Key" +} ## Dependencies - Python 2.7 and 3.4+ diff --git a/groupdocsclassificationcloud/apis/__init__.py b/groupdocsclassificationcloud/apis/__init__.py index f83f0d2..613ce93 100644 --- a/groupdocsclassificationcloud/apis/__init__.py +++ b/groupdocsclassificationcloud/apis/__init__.py @@ -1,3 +1,4 @@ +# coding: utf-8 from __future__ import absolute_import # flake8: noqa diff --git a/groupdocsclassificationcloud/apis/classification_api.py b/groupdocsclassificationcloud/apis/classification_api.py index e04d0a7..9b6b9ac 100644 --- a/groupdocsclassificationcloud/apis/classification_api.py +++ b/groupdocsclassificationcloud/apis/classification_api.py @@ -287,82 +287,4 @@ def __request_token(self): files={}, _return_http_data_only=True) access_token = data['access_token'] if six.PY3 else data['access_token'].encode('utf8') self.api_client.configuration.api_key['Authorization'] = access_token - self.api_client.configuration.api_version = api_version - -# -------------------------------------------------------------------------------- -# -# Copyright (c) 2019 GroupDocs.Classification for Cloud -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# -------------------------------------------------------------------------------- - - -class classify_request(object): - """ - Request model for classify operation. - Initializes a new instance. - :param request Raw text to classify or document's info. - :param best_classes_count Count of the best classes to return. - :param taxonomy Taxonomy to use for classification. - :param precision_recall_balance Balance between precision and recall: precision, recall or empty (for default). - :param storage Storage name - """ - - def __init__(self, request, best_classes_count=None, taxonomy=None, precision_recall_balance=None, storage=None): - self.request = request - self.best_classes_count = best_classes_count - self.taxonomy = taxonomy - self.precision_recall_balance = precision_recall_balance - self.storage = storage -# -------------------------------------------------------------------------------- -# -# Copyright (c) 2019 GroupDocs.Classification for Cloud -# -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# -------------------------------------------------------------------------------- - - -class get_supported_file_formats_request(object): - """ - Request model for get_supported_file_formats operation. - Initializes a new instance. - """ - - def __init__(self): - pass + self.api_client.configuration.api_version = api_version \ No newline at end of file diff --git a/groupdocsclassificationcloud/models/classify_request.py b/groupdocsclassificationcloud/models/classify_request.py index 19ddaee..19f9217 100644 --- a/groupdocsclassificationcloud/models/classify_request.py +++ b/groupdocsclassificationcloud/models/classify_request.py @@ -1,3 +1,4 @@ +# coding: utf-8 # -------------------------------------------------------------------------------- # # Copyright (c) 2019 GroupDocs.Classification for Cloud diff --git a/groupdocsclassificationcloud/models/get_supported_file_formats_request.py b/groupdocsclassificationcloud/models/get_supported_file_formats_request.py index 2386d63..df68002 100644 --- a/groupdocsclassificationcloud/models/get_supported_file_formats_request.py +++ b/groupdocsclassificationcloud/models/get_supported_file_formats_request.py @@ -1,3 +1,4 @@ +# coding: utf-8 # -------------------------------------------------------------------------------- # # Copyright (c) 2019 GroupDocs.Classification for Cloud diff --git a/setup.py b/setup.py index c75b2f3..b9465da 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "groupdocs-classification-cloud" -VERSION = "19.3" +VERSION = "19.3.0" # To install the library, run the following # # python setup.py install @@ -19,7 +19,7 @@ version=VERSION, description="GroupDocs.Classification Cloud API References", author="GroupDocs Classification", - url="https://github.com/groupdocs-classification-cloud/", + url="https://github.com/groupdocs-classification-cloud/groupdocs-classification-cloud-python", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -31,7 +31,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], - keywords=["groupdocs", "python", "groupdocs cloud", "classification", "iab2", "taxonomy"], + keywords=["groupdocs", "python", "groupdocs cloud", "classification", "documents classification", "iab2", "taxonomy"], install_requires=REQUIRES, tests_require=TEST_REQUIRES, packages=find_packages(), diff --git a/test/Common/test_api_coverage.py b/test/Common/test_api_coverage.py index 8108868..ecb74e0 100644 --- a/test/Common/test_api_coverage.py +++ b/test/Common/test_api_coverage.py @@ -1,4 +1,4 @@ -# +# coding: utf-8 # -------------------------------------------------------------------------------------------------------------------- # # Copyright (c) 2019 GroupDocs.Classification for Cloud diff --git a/test/Common/test_error_handling.py b/test/Common/test_error_handling.py index b3bd61c..b58184a 100644 --- a/test/Common/test_error_handling.py +++ b/test/Common/test_error_handling.py @@ -1,4 +1,4 @@ -# +# coding: utf-8 # -------------------------------------------------------------------------------------------------------------------- # # Copyright (c) 2019 GroupDocs.Classification for Cloud diff --git a/test/base_test_context.py b/test/base_test_context.py index 58da68d..7da8a76 100644 --- a/test/base_test_context.py +++ b/test/base_test_context.py @@ -1,4 +1,4 @@ -# +# coding: utf-8 # -------------------------------------------------------------------------------------------------------------------- # # Copyright (c) 2019 GroupDocs.Classification for Cloud diff --git a/test/test_classify.py b/test/test_classify.py index 55b7f74..1700af8 100644 --- a/test/test_classify.py +++ b/test/test_classify.py @@ -45,8 +45,4 @@ def test_classify_document(self): if (file_upload_response["code"] == 200 and file_upload_response["status"] == "OK"): request = ClassifyRequest(BaseRequest(document=FileInfo(name=filename, folder=self.remote_test_folder))) result = self.classification_api.classify(request) - print("Result {}".format(result)) - - request = ClassifyRequest(BaseRequest("Try text classification"), 3) - result = self.classification_api.classify(request) - print(result) + print("Result {}".format(result)) \ No newline at end of file