Skip to content
Open
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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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+
Expand Down
1 change: 1 addition & 0 deletions groupdocsclassificationcloud/apis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
from __future__ import absolute_import

# flake8: noqa
Expand Down
80 changes: 1 addition & 79 deletions groupdocsclassificationcloud/apis/classification_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 company="GroupDocs" file="classify_request.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
# </copyright>
# <summary>
# 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.
# </summary>
# --------------------------------------------------------------------------------


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 company="GroupDocs" file="get_supported_file_formats_request.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
# </copyright>
# <summary>
# 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.
# </summary>
# --------------------------------------------------------------------------------


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
1 change: 1 addition & 0 deletions groupdocsclassificationcloud/models/classify_request.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
# --------------------------------------------------------------------------------
# <copyright company="GroupDocs" file="classify_request.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
# --------------------------------------------------------------------------------
# <copyright company="GroupDocs" file="get_supported_file_formats_request.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand All @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion test/Common/test_api_coverage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# coding: utf-8
# --------------------------------------------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_api_coverage.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
Expand Down
2 changes: 1 addition & 1 deletion test/Common/test_error_handling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# coding: utf-8
# --------------------------------------------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_error_handling.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
Expand Down
2 changes: 1 addition & 1 deletion test/base_test_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# coding: utf-8
# --------------------------------------------------------------------------------------------------------------------
# <copyright company="Aspose" file="base_test_context.py">
# Copyright (c) 2019 GroupDocs.Classification for Cloud
Expand Down
6 changes: 1 addition & 5 deletions test/test_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))