diff --git a/README.rst b/README.rst
index cfc683f..d8b87b8 100644
--- a/README.rst
+++ b/README.rst
@@ -2,7 +2,7 @@
RecombeeApiClient
*****************
-A Python client for easy use of the `Recombee `_ recommendation API. Both Python 2 and Python 3 are supported.
+A Python 3 client for easy use of the `Recombee `_ recommendation API.
If you don't have an account at Recombee yet, you can create a free account `here `_.
@@ -18,8 +18,6 @@ Install the client with pip:
$ pip install recombee-api-client
-(use pip3 instead of pip if you use Python 3)
-
========
Examples
========
@@ -30,12 +28,12 @@ Basic example
.. code-block:: python
- from recombee_api_client.api_client import RecombeeClient
+ from recombee_api_client.api_client import RecombeeClient, Region
from recombee_api_client.exceptions import APIException
from recombee_api_client.api_requests import *
import random
- client = RecombeeClient('--my-database-id--', '--db-private-token--')
+ client = RecombeeClient('--my-database-id--', '--db-private-token--', region=Region.US_WEST)
#Generate some random purchases of items by users
PROBABILITY_PURCHASED = 0.1
@@ -73,7 +71,7 @@ Using property values
.. code-block:: python
- from recombee_api_client.api_client import RecombeeClient
+ from recombee_api_client.api_client import RecombeeClient, Region
from recombee_api_client.api_requests import AddItemProperty, SetItemValues, AddPurchase
from recombee_api_client.api_requests import RecommendItemsToItem, SearchItems, Batch, ResetDatabase
import random
@@ -81,7 +79,7 @@ Using property values
NUM = 100
PROBABILITY_PURCHASED = 0.1
- client = RecombeeClient('--my-database-id--', '--db-private-token--')
+ client = RecombeeClient('--my-database-id--', '--db-private-token--', region=Region.AP_SE)
# Clear the entire database
client.send(ResetDatabase())
diff --git a/recombee_api_client/api_client.py b/recombee_api_client/api_client.py
index 2cc7972..115da50 100644
--- a/recombee_api_client/api_client.py
+++ b/recombee_api_client/api_client.py
@@ -1,17 +1,27 @@
import os
import time
-import hmac
import json
-from hashlib import sha1
-import requests
+import hmac
+from typing import Union
+from enum import Enum
-try:
- from urllib import quote
-except ImportError:
- from urllib.parse import quote
+import requests
+from hashlib import sha1
+from urllib.parse import quote
from recombee_api_client.exceptions import ApiTimeoutException, ResponseException
-from recombee_api_client.api_requests import Batch
+from recombee_api_client.api_requests import Batch, Request
+
+
+class Region(Enum):
+ """
+ Region of the Recombee cluster
+ """
+ AP_SE = 1
+ CA_EAST = 2
+ EU_WEST = 3
+ US_WEST = 4
+
class RecombeeClient:
"""
@@ -22,22 +32,19 @@ class RecombeeClient:
:param token: Secret token obtained from Recombee for signing requests
:param protocol: Default protocol for sending requests. Possible values: 'http', 'https'.
+
+ :param region: region of the Recombee cluster where the database is located
"""
BATCH_MAX_SIZE = 10000
- def __init__(self, database_id, token, protocol = 'https', options = {}):
+ def __init__(self, database_id: str, token: str, protocol: str = 'https', options: dict = None, region: Region = None):
self.database_id = database_id
self.token = token
self.protocol = protocol
- self.base_uri = os.environ.get('RAPI_URI')
- if self.base_uri is None:
- self.base_uri = options.get('base_uri')
- if self.base_uri is None:
- self.base_uri = 'rapi.recombee.com'
-
+ self.base_uri = self.__get_base_uri(options=options or {}, region=region)
- def send(self, request):
+ def send(self, request: Request) -> Union[dict, str, list]:
"""
:param request: Request to be sent to Recombee recommender
"""
@@ -63,101 +70,119 @@ def send(self, request):
raise ApiTimeoutException(request)
@staticmethod
- def __get_http_headers(additional_headers=None):
- headers = {'User-Agent': 'recombee-python-api-client/3.2.0'}
+ def __get_regional_base_uri(region: Region) -> str:
+ uri = {
+ Region.AP_SE: 'rapi-ap-se.recombee.com',
+ Region.CA_EAST: 'rapi-ca-east.recombee.com',
+ Region.EU_WEST: 'rapi-eu-west.recombee.com',
+ Region.US_WEST: 'rapi-us-west.recombee.com'
+ }.get(region)
+
+ if uri is None:
+ raise ValueError('Unknown region given')
+ return uri
+
+ @staticmethod
+ def __get_base_uri(options: dict, region: str) -> str:
+ base_uri = os.environ.get('RAPI_URI') or options.get('base_uri')
+ if region is not None:
+ if base_uri:
+ raise ValueError('base_uri and region cannot be specified at the same time')
+ base_uri = RecombeeClient.__get_regional_base_uri(region)
+
+ return base_uri or 'rapi.recombee.com'
+
+ @staticmethod
+ def __get_http_headers(additional_headers: dict = None) -> dict:
+ headers = {'User-Agent': 'recombee-python-api-client/4.0.0'}
if additional_headers:
headers.update(additional_headers)
return headers
- def __put(self, request, uri, timeout):
+ def __put(self, request: Request, uri: str, timeout: int):
response = requests.put(uri,
data=json.dumps(request.get_body_parameters()),
- headers= self.__get_http_headers({'Content-Type': 'application/json'}),
+ headers=self.__get_http_headers({'Content-Type': 'application/json'}),
timeout=timeout)
self.__check_errors(response, request)
return response.json()
- def __get(self, request, uri, timeout):
+ def __get(self, request: Request, uri: str, timeout: int):
response = requests.get(uri,
- headers= self.__get_http_headers(),
+ headers=self.__get_http_headers(),
timeout=timeout)
self.__check_errors(response, request)
return response.json()
- def __post(self, request, uri, timeout):
+ def __post(self, request: Request, uri: str, timeout: int):
response = requests.post(uri,
- data=json.dumps(request.get_body_parameters()),
- headers= self.__get_http_headers({'Content-Type': 'application/json'}),
- timeout=timeout)
+ data=json.dumps(request.get_body_parameters()),
+ headers=self.__get_http_headers({'Content-Type': 'application/json'}),
+ timeout=timeout)
self.__check_errors(response, request)
return response.json()
- def __delete(self, request, uri, timeout):
+ def __delete(self, request: Request, uri: str, timeout: int):
response = requests.delete(uri,
- headers= self.__get_http_headers(),
- timeout=timeout)
+ data=json.dumps(request.get_body_parameters()),
+ headers=self.__get_http_headers({'Content-Type': 'application/json'}),
+ timeout=timeout)
self.__check_errors(response, request)
return response.json()
-
- def __check_errors(self, response, request):
+ def __check_errors(self, response, request: Request):
status_code = response.status_code
if status_code == 200 or status_code == 201:
return
raise ResponseException(request, status_code, response.text)
@staticmethod
- def __get_list_chunks(l, n):
+ def __get_list_chunks(l: list, n: int) -> list:
"""Yield successive n-sized chunks from l."""
- try: #Python 2/3 compatibility
- xrange
- except NameError:
- xrange = range
-
- for i in xrange(0, len(l), n):
+ for i in range(0, len(l), n):
yield l[i:i + n]
- def __send_multipart_batch(self, batch):
+ def __send_multipart_batch(self, batch: Batch) -> list:
requests_parts = [rqs for rqs in self.__get_list_chunks(batch.requests, self.BATCH_MAX_SIZE)]
responses = [self.send(Batch(rqs)) for rqs in requests_parts]
return sum(responses, [])
- def __process_request_uri(self, request):
+ def __process_request_uri(self, request: Request) -> str:
uri = request.path
uri += self.__query_parameters_to_url(request)
return uri
+ def __query_parameters_to_url(self, request: Request) -> str:
+ ps = ''
+ query_params = request.get_query_parameters()
+ for name in query_params:
+ val = query_params[name]
+ ps += '&' if ps.find('?') != -1 else '?'
+ ps += "%s=%s" % (name, self.__format_query_parameter_value(val))
+ return ps
- def __query_parameters_to_url(self, request):
- ps = ''
- query_params = request.get_query_parameters()
- for name in query_params:
- val = query_params[name]
- ps += '&' if ps.find('?')!=-1 else '?'
- ps += "%s=%s" % (name, self.__format_query_parameter_value(val))
- return ps
-
- def __format_query_parameter_value(self, value):
- if isinstance(value, list):
- return ','.join([quote(str(v)) for v in value])
- return quote(str(value))
+ @staticmethod
+ def __format_query_parameter_value(value) -> str:
+ if isinstance(value, list):
+ return ','.join([quote(str(v)) for v in value])
+ return quote(str(value))
- # Sign request with HMAC, request URI must be exacly the same
+ # Sign request with HMAC, request URI must be exactly the same
# We have 30s to complete request with this token
- def __sign_url(self, req_part):
+ def __sign_url(self, req_part: str) -> str:
uri = '/' + self.database_id + req_part
- time = self.__hmac_time(uri)
- sign = self.__hmac_sign(uri, time)
- res = uri + time + '&hmac_sign=' +sign
+ time_part = self.__hmac_time(uri)
+ sign = self.__hmac_sign(uri, time_part)
+ res = uri + time_part + '&hmac_sign=' + sign
return res
- def __hmac_time(self, uri):
- res = '&' if uri.find('?')!=-1 else '?'
+ def __hmac_time(self, uri: str) -> str:
+ res = '&' if uri.find('?') != -1 else '?'
res += "hmac_timestamp=%s" % int(time.time())
return res
- def __hmac_sign(self, uri, time):
- url = uri + time
+ def __hmac_sign(self, uri: str, time_part: str) -> str:
+ url = uri + time_part
sign = hmac.new(str.encode(self.token), str.encode(url), sha1).hexdigest()
return sign
diff --git a/recombee_api_client/api_requests/__init__.py b/recombee_api_client/api_requests/__init__.py
index 3adc9b8..9439a01 100644
--- a/recombee_api_client/api_requests/__init__.py
+++ b/recombee_api_client/api_requests/__init__.py
@@ -7,6 +7,8 @@
from recombee_api_client.api_requests.delete_item_property import DeleteItemProperty
from recombee_api_client.api_requests.get_item_property_info import GetItemPropertyInfo
from recombee_api_client.api_requests.list_item_properties import ListItemProperties
+from recombee_api_client.api_requests.update_more_items import UpdateMoreItems
+from recombee_api_client.api_requests.delete_more_items import DeleteMoreItems
from recombee_api_client.api_requests.add_series import AddSeries
from recombee_api_client.api_requests.delete_series import DeleteSeries
from recombee_api_client.api_requests.list_series import ListSeries
@@ -58,8 +60,6 @@
from recombee_api_client.api_requests.recommend_next_items import RecommendNextItems
from recombee_api_client.api_requests.recommend_users_to_user import RecommendUsersToUser
from recombee_api_client.api_requests.recommend_users_to_item import RecommendUsersToItem
-from recombee_api_client.api_requests.user_based_recommendation import UserBasedRecommendation
-from recombee_api_client.api_requests.item_based_recommendation import ItemBasedRecommendation
from recombee_api_client.api_requests.search_items import SearchItems
from recombee_api_client.api_requests.add_search_synonym import AddSearchSynonym
from recombee_api_client.api_requests.list_search_synonyms import ListSearchSynonyms
@@ -67,3 +67,4 @@
from recombee_api_client.api_requests.delete_search_synonym import DeleteSearchSynonym
from recombee_api_client.api_requests.reset_database import ResetDatabase
from recombee_api_client.api_requests.batch import Batch
+from recombee_api_client.api_requests.request import Request
diff --git a/recombee_api_client/api_requests/add_bookmark.py b/recombee_api_client/api_requests/add_bookmark.py
index ff6cfc7..1edc6f0 100644
--- a/recombee_api_client/api_requests/add_bookmark.py
+++ b/recombee_api_client/api_requests/add_bookmark.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -27,19 +28,16 @@ class AddBookmark(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT, cascade_create: bool = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/bookmarks/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
self.cascade_create = cascade_create
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/bookmarks/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -56,7 +54,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_cart_addition.py b/recombee_api_client/api_requests/add_cart_addition.py
index f4a1a78..8ba4e64 100644
--- a/recombee_api_client/api_requests/add_cart_addition.py
+++ b/recombee_api_client/api_requests/add_cart_addition.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -31,7 +32,8 @@ class AddCartAddition(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT, amount=DEFAULT, price=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT, cascade_create: bool = DEFAULT, amount: float = DEFAULT, price: float = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/cartadditions/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
@@ -40,12 +42,8 @@ def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT,
self.price = price
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/cartadditions/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -66,7 +64,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_detail_view.py b/recombee_api_client/api_requests/add_detail_view.py
index ad502f9..010f465 100644
--- a/recombee_api_client/api_requests/add_detail_view.py
+++ b/recombee_api_client/api_requests/add_detail_view.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -29,7 +30,8 @@ class AddDetailView(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT, duration=DEFAULT, cascade_create=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT, duration: int = DEFAULT, cascade_create: bool = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/detailviews/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
@@ -37,12 +39,8 @@ def __init__(self, user_id, item_id, timestamp=DEFAULT, duration=DEFAULT, cascad
self.cascade_create = cascade_create
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/detailviews/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -61,7 +59,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_group.py b/recombee_api_client/api_requests/add_group.py
index d62984d..425129d 100644
--- a/recombee_api_client/api_requests/add_group.py
+++ b/recombee_api_client/api_requests/add_group.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class AddGroup(Request):
"""
- def __init__(self, group_id):
+ def __init__(self, group_id: str):
+ super().__init__(path="/groups/%s" % (group_id), method='put', timeout=1000, ensure_https=False)
self.group_id = group_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/groups/%s" % (self.group_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_item.py b/recombee_api_client/api_requests/add_item.py
index 73076fe..cc6fc48 100644
--- a/recombee_api_client/api_requests/add_item.py
+++ b/recombee_api_client/api_requests/add_item.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -16,21 +17,18 @@ class AddItem(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s" % (item_id), method='put', timeout=1000, ensure_https=False)
self.item_id = item_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/items/%s" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_item_property.py b/recombee_api_client/api_requests/add_item_property.py
index d01cc4a..6bf18be 100644
--- a/recombee_api_client/api_requests/add_item_property.py
+++ b/recombee_api_client/api_requests/add_item_property.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -42,22 +43,19 @@ class AddItemProperty(Request):
"""
- def __init__(self, property_name, type):
+ def __init__(self, property_name: str, type: str):
+ super().__init__(path="/items/properties/%s" % (property_name), method='put', timeout=100000, ensure_https=False)
self.property_name = property_name
self.type = type
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/items/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_purchase.py b/recombee_api_client/api_requests/add_purchase.py
index 1ae91fc..ec4d689 100644
--- a/recombee_api_client/api_requests/add_purchase.py
+++ b/recombee_api_client/api_requests/add_purchase.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -33,7 +34,8 @@ class AddPurchase(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT, amount=DEFAULT, price=DEFAULT, profit=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT, cascade_create: bool = DEFAULT, amount: float = DEFAULT, price: float = DEFAULT, profit: float = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/purchases/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
@@ -43,12 +45,8 @@ def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT,
self.profit = profit
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/purchases/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -71,7 +69,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_rating.py b/recombee_api_client/api_requests/add_rating.py
index f61f02b..4f1a3ca 100644
--- a/recombee_api_client/api_requests/add_rating.py
+++ b/recombee_api_client/api_requests/add_rating.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -29,7 +30,8 @@ class AddRating(Request):
"""
- def __init__(self, user_id, item_id, rating, timestamp=DEFAULT, cascade_create=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, rating: float, timestamp: Union[str, int] = DEFAULT, cascade_create: bool = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/ratings/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.rating = rating
@@ -37,12 +39,8 @@ def __init__(self, user_id, item_id, rating, timestamp=DEFAULT, cascade_create=D
self.cascade_create = cascade_create
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/ratings/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -60,7 +58,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_search_synonym.py b/recombee_api_client/api_requests/add_search_synonym.py
index eaf37d7..e02e14a 100644
--- a/recombee_api_client/api_requests/add_search_synonym.py
+++ b/recombee_api_client/api_requests/add_search_synonym.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -30,16 +31,13 @@ class AddSearchSynonym(Request):
"""
- def __init__(self, term, synonym, one_way=DEFAULT):
+ def __init__(self, term: str, synonym: str, one_way: bool = DEFAULT):
+ super().__init__(path="/synonyms/items/" % (), method='post', timeout=10000, ensure_https=False)
self.term = term
self.synonym = synonym
self.one_way = one_way
- self.timeout = 10000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/synonyms/items/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -50,7 +48,7 @@ def get_body_parameters(self):
p['oneWay'] = self.one_way
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_series.py b/recombee_api_client/api_requests/add_series.py
index 89a25b6..d0bca0e 100644
--- a/recombee_api_client/api_requests/add_series.py
+++ b/recombee_api_client/api_requests/add_series.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class AddSeries(Request):
"""
- def __init__(self, series_id):
+ def __init__(self, series_id: str):
+ super().__init__(path="/series/%s" % (series_id), method='put', timeout=1000, ensure_https=False)
self.series_id = series_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/series/%s" % (self.series_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_user.py b/recombee_api_client/api_requests/add_user.py
index 146e7ba..f486499 100644
--- a/recombee_api_client/api_requests/add_user.py
+++ b/recombee_api_client/api_requests/add_user.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class AddUser(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s" % (user_id), method='put', timeout=1000, ensure_https=False)
self.user_id = user_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/users/%s" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/add_user_property.py b/recombee_api_client/api_requests/add_user_property.py
index 80f5024..1df8425 100644
--- a/recombee_api_client/api_requests/add_user_property.py
+++ b/recombee_api_client/api_requests/add_user_property.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -36,22 +37,19 @@ class AddUserProperty(Request):
"""
- def __init__(self, property_name, type):
+ def __init__(self, property_name: str, type: str):
+ super().__init__(path="/users/properties/%s" % (property_name), method='put', timeout=100000, ensure_https=False)
self.property_name = property_name
self.type = type
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/users/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/batch.py b/recombee_api_client/api_requests/batch.py
index 7b2f218..e409d6c 100644
--- a/recombee_api_client/api_requests/batch.py
+++ b/recombee_api_client/api_requests/batch.py
@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
+from typing import List
from recombee_api_client.api_requests.request import Request
+
class Batch(Request):
"""
Batch request for submitting an arbitrary sequence of requests
@@ -14,16 +16,14 @@ class Batch(Request):
- if the status code of the whole batch is not 200, then there is an error in the batch request itself; in such a case, the error message returned should help you to resolve the problem,
:param requests: List of Requests.
- :param distinctRecomms: Makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.
+ :param distinct_recomms: Makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.
"""
- def __init__(self, requests, distinctRecomms=None):
+ def __init__(self, requests: List[Request], distinct_recomms: bool = None, distinctRecomms=None):
+ super().__init__(path='/batch/', method='post', timeout=0, ensure_https=True)
self.requests = requests
- self.distinctRecomms = distinctRecomms
+ self.distinct_recomms = distinctRecomms or distinct_recomms # wrongly formatted distinctRecomms are kept for backward compatibility
self.timeout = sum([req.timeout for req in self.requests])
- self.ensure_https = True
- self.method = 'post'
- self.path = '/batch/'
def get_body_parameters(self):
"""
@@ -33,16 +33,17 @@ def get_body_parameters(self):
for r in self.requests:
reqs.append(self.__request_to_batch_dict(r))
result = {'requests': reqs}
- if self.distinctRecomms is not None:
- result['distinctRecomms'] = self.distinctRecomms
+ if self.distinct_recomms is not None:
+ result['distinctRecomms'] = self.distinct_recomms
return result
- def __request_to_batch_dict(self, req):
+ @staticmethod
+ def __request_to_batch_dict(req: Request) -> dict:
path = req.path
bd = {
'method': req.method.upper(),
- 'path':path
+ 'path': path
}
params = req.get_query_parameters()
@@ -57,4 +58,4 @@ def get_query_parameters(self):
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
- return dict()
\ No newline at end of file
+ return dict()
diff --git a/recombee_api_client/api_requests/delete_all_search_synonyms.py b/recombee_api_client/api_requests/delete_all_search_synonyms.py
index 6e77505..10229ec 100644
--- a/recombee_api_client/api_requests/delete_all_search_synonyms.py
+++ b/recombee_api_client/api_requests/delete_all_search_synonyms.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -11,19 +12,16 @@ class DeleteAllSearchSynonyms(Request):
"""
def __init__(self):
- self.timeout = 10000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/synonyms/items/" % ()
+ super().__init__(path="/synonyms/items/" % (), method='delete', timeout=10000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_bookmark.py b/recombee_api_client/api_requests/delete_bookmark.py
index e3bef2c..cb32076 100644
--- a/recombee_api_client/api_requests/delete_bookmark.py
+++ b/recombee_api_client/api_requests/delete_bookmark.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeleteBookmark(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT):
+ super().__init__(path="/bookmarks/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/bookmarks/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_cart_addition.py b/recombee_api_client/api_requests/delete_cart_addition.py
index 9601325..0a0b5fe 100644
--- a/recombee_api_client/api_requests/delete_cart_addition.py
+++ b/recombee_api_client/api_requests/delete_cart_addition.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeleteCartAddition(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT):
+ super().__init__(path="/cartadditions/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/cartadditions/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_detail_view.py b/recombee_api_client/api_requests/delete_detail_view.py
index 3bee123..77ad3cb 100644
--- a/recombee_api_client/api_requests/delete_detail_view.py
+++ b/recombee_api_client/api_requests/delete_detail_view.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeleteDetailView(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT):
+ super().__init__(path="/detailviews/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/detailviews/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_group.py b/recombee_api_client/api_requests/delete_group.py
index 8487b16..850a643 100644
--- a/recombee_api_client/api_requests/delete_group.py
+++ b/recombee_api_client/api_requests/delete_group.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -16,21 +17,18 @@ class DeleteGroup(Request):
"""
- def __init__(self, group_id):
+ def __init__(self, group_id: str):
+ super().__init__(path="/groups/%s" % (group_id), method='delete', timeout=1000, ensure_https=False)
self.group_id = group_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/groups/%s" % (self.group_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_item.py b/recombee_api_client/api_requests/delete_item.py
index e5635de..0e94072 100644
--- a/recombee_api_client/api_requests/delete_item.py
+++ b/recombee_api_client/api_requests/delete_item.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -9,7 +10,7 @@ class DeleteItem(Request):
If there are any *purchases*, *ratings*, *bookmarks*, *cart additions* or *detail views* of the item present in the database, they will be deleted in cascade as well. Also, if the item is present in some *series*, it will be removed from all the *series* where present.
- If an item becomes obsolete/no longer available, it is often meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and only exclude the item from recommendations. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
+ If an item becomes obsolete/no longer available, it is meaningful to keep it in the catalog (along with all the interaction data, which are very useful), and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
Required parameters:
@@ -18,21 +19,18 @@ class DeleteItem(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s" % (item_id), method='delete', timeout=1000, ensure_https=False)
self.item_id = item_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/items/%s" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_item_property.py b/recombee_api_client/api_requests/delete_item_property.py
index f68c63e..3ab251b 100644
--- a/recombee_api_client/api_requests/delete_item_property.py
+++ b/recombee_api_client/api_requests/delete_item_property.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class DeleteItemProperty(Request):
"""
- def __init__(self, property_name):
+ def __init__(self, property_name: str):
+ super().__init__(path="/items/properties/%s" % (property_name), method='delete', timeout=100000, ensure_https=False)
self.property_name = property_name
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/items/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_more_items.py b/recombee_api_client/api_requests/delete_more_items.py
new file mode 100644
index 0000000..48bb401
--- /dev/null
+++ b/recombee_api_client/api_requests/delete_more_items.py
@@ -0,0 +1,36 @@
+from recombee_api_client.api_requests.request import Request
+from typing import Union, List
+import uuid
+
+DEFAULT = uuid.uuid4()
+
+class DeleteMoreItems(Request):
+ """
+ Delete all the items that pass the filter.
+
+ If an item becomes obsolete/no longer available, it is meaningful to **keep it in the catalog** (along with all the interaction data, which are very useful), and **only exclude the item from recommendations**. In such a case, use [ReQL filter](https://docs.recombee.com/reql.html) instead of deleting the item completely.
+ Required parameters:
+
+ :param filter: A [ReQL](https://docs.recombee.com/reql.html) expression, which return `true` for the items that shall be updated.
+
+
+ """
+
+ def __init__(self, filter: str):
+ super().__init__(path="/more-items/" % (), method='delete', timeout=1000, ensure_https=False)
+ self.filter = filter
+
+ def get_body_parameters(self) -> dict:
+ """
+ Values of body parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ p = dict()
+ p['filter'] = self.filter
+ return p
+
+ def get_query_parameters(self) -> dict:
+ """
+ Values of query parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ params = dict()
+ return params
diff --git a/recombee_api_client/api_requests/delete_purchase.py b/recombee_api_client/api_requests/delete_purchase.py
index e05d2e7..a61a455 100644
--- a/recombee_api_client/api_requests/delete_purchase.py
+++ b/recombee_api_client/api_requests/delete_purchase.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeletePurchase(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT):
+ super().__init__(path="/purchases/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/purchases/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_rating.py b/recombee_api_client/api_requests/delete_rating.py
index 940fe92..410dcb0 100644
--- a/recombee_api_client/api_requests/delete_rating.py
+++ b/recombee_api_client/api_requests/delete_rating.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeleteRating(Request):
"""
- def __init__(self, user_id, item_id, timestamp=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, timestamp: Union[str, int] = DEFAULT):
+ super().__init__(path="/ratings/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.timestamp = timestamp
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/ratings/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_search_synonym.py b/recombee_api_client/api_requests/delete_search_synonym.py
index ef1aeaf..53c0a0e 100644
--- a/recombee_api_client/api_requests/delete_search_synonym.py
+++ b/recombee_api_client/api_requests/delete_search_synonym.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class DeleteSearchSynonym(Request):
"""
- def __init__(self, id):
+ def __init__(self, id: str):
+ super().__init__(path="/synonyms/items/%s" % (id), method='delete', timeout=10000, ensure_https=False)
self.id = id
- self.timeout = 10000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/synonyms/items/%s" % (self.id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_series.py b/recombee_api_client/api_requests/delete_series.py
index e249633..a64eee7 100644
--- a/recombee_api_client/api_requests/delete_series.py
+++ b/recombee_api_client/api_requests/delete_series.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -16,21 +17,18 @@ class DeleteSeries(Request):
"""
- def __init__(self, series_id):
+ def __init__(self, series_id: str):
+ super().__init__(path="/series/%s" % (series_id), method='delete', timeout=1000, ensure_https=False)
self.series_id = series_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/series/%s" % (self.series_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_user.py b/recombee_api_client/api_requests/delete_user.py
index 2764d2e..984914b 100644
--- a/recombee_api_client/api_requests/delete_user.py
+++ b/recombee_api_client/api_requests/delete_user.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -11,26 +12,23 @@ class DeleteUser(Request):
Required parameters:
- :param user_id: ID of the user to be added.
+ :param user_id: ID of the user to be deleted.
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s" % (user_id), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/users/%s" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_user_property.py b/recombee_api_client/api_requests/delete_user_property.py
index 69ed112..baffade 100644
--- a/recombee_api_client/api_requests/delete_user_property.py
+++ b/recombee_api_client/api_requests/delete_user_property.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class DeleteUserProperty(Request):
"""
- def __init__(self, property_name):
+ def __init__(self, property_name: str):
+ super().__init__(path="/users/properties/%s" % (property_name), method='delete', timeout=100000, ensure_https=False)
self.property_name = property_name
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/users/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/delete_view_portion.py b/recombee_api_client/api_requests/delete_view_portion.py
index eb2fc25..080f5e9 100644
--- a/recombee_api_client/api_requests/delete_view_portion.py
+++ b/recombee_api_client/api_requests/delete_view_portion.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -21,23 +22,20 @@ class DeleteViewPortion(Request):
"""
- def __init__(self, user_id, item_id, session_id=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, session_id: str = DEFAULT):
+ super().__init__(path="/viewportions/" % (), method='delete', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.session_id = session_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/viewportions/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/get_item_property_info.py b/recombee_api_client/api_requests/get_item_property_info.py
index 2854c2b..845d961 100644
--- a/recombee_api_client/api_requests/get_item_property_info.py
+++ b/recombee_api_client/api_requests/get_item_property_info.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class GetItemPropertyInfo(Request):
"""
- def __init__(self, property_name):
+ def __init__(self, property_name: str):
+ super().__init__(path="/items/properties/%s" % (property_name), method='get', timeout=1000, ensure_https=False)
self.property_name = property_name
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/get_item_values.py b/recombee_api_client/api_requests/get_item_values.py
index 8923fe8..4834258 100644
--- a/recombee_api_client/api_requests/get_item_values.py
+++ b/recombee_api_client/api_requests/get_item_values.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -15,21 +16,18 @@ class GetItemValues(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s" % (item_id), method='get', timeout=1000, ensure_https=False)
self.item_id = item_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/get_user_property_info.py b/recombee_api_client/api_requests/get_user_property_info.py
index ebec153..94330af 100644
--- a/recombee_api_client/api_requests/get_user_property_info.py
+++ b/recombee_api_client/api_requests/get_user_property_info.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class GetUserPropertyInfo(Request):
"""
- def __init__(self, property_name):
+ def __init__(self, property_name: str):
+ super().__init__(path="/users/properties/%s" % (property_name), method='get', timeout=100000, ensure_https=False)
self.property_name = property_name
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/properties/%s" % (self.property_name)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/get_user_values.py b/recombee_api_client/api_requests/get_user_values.py
index 083d5da..647625a 100644
--- a/recombee_api_client/api_requests/get_user_values.py
+++ b/recombee_api_client/api_requests/get_user_values.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -15,21 +16,18 @@ class GetUserValues(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s" % (user_id), method='get', timeout=1000, ensure_https=False)
self.user_id = user_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/insert_to_group.py b/recombee_api_client/api_requests/insert_to_group.py
index 873773e..acd9376 100644
--- a/recombee_api_client/api_requests/insert_to_group.py
+++ b/recombee_api_client/api_requests/insert_to_group.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -23,17 +24,14 @@ class InsertToGroup(Request):
"""
- def __init__(self, group_id, item_type, item_id, cascade_create=DEFAULT):
+ def __init__(self, group_id: str, item_type: str, item_id: str, cascade_create: bool = DEFAULT):
+ super().__init__(path="/groups/%s/items/" % (group_id), method='post', timeout=1000, ensure_https=False)
self.group_id = group_id
self.item_type = item_type
self.item_id = item_id
self.cascade_create = cascade_create
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/groups/%s/items/" % (self.group_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -44,7 +42,7 @@ def get_body_parameters(self):
p['cascadeCreate'] = self.cascade_create
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/insert_to_series.py b/recombee_api_client/api_requests/insert_to_series.py
index 07b3321..d26ffa5 100644
--- a/recombee_api_client/api_requests/insert_to_series.py
+++ b/recombee_api_client/api_requests/insert_to_series.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -25,18 +26,15 @@ class InsertToSeries(Request):
"""
- def __init__(self, series_id, item_type, item_id, time, cascade_create=DEFAULT):
+ def __init__(self, series_id: str, item_type: str, item_id: str, time: float, cascade_create: bool = DEFAULT):
+ super().__init__(path="/series/%s/items/" % (series_id), method='post', timeout=1000, ensure_https=False)
self.series_id = series_id
self.item_type = item_type
self.item_id = item_id
self.time = time
self.cascade_create = cascade_create
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/series/%s/items/" % (self.series_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -48,7 +46,7 @@ def get_body_parameters(self):
p['cascadeCreate'] = self.cascade_create
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/item_based_recommendation.py b/recombee_api_client/api_requests/item_based_recommendation.py
deleted file mode 100644
index 7d46c8e..0000000
--- a/recombee_api_client/api_requests/item_based_recommendation.py
+++ /dev/null
@@ -1,205 +0,0 @@
-from recombee_api_client.api_requests.request import Request
-import uuid
-
-DEFAULT = uuid.uuid4()
-
-class ItemBasedRecommendation(Request):
- """
- Deprecated since version 2.0.0. Use RecommendItemsToItem request instead.
-
- Recommends set of items that are somehow related to one given item, *X*. Typical scenario for using item-based recommendation is when user *A* is viewing *X*. Then you may display items to the user that he might be also interested in. Item-recommendation request gives you Top-N such items, optionally taking the target user *A* into account.
-
- It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
-
- Required parameters:
-
- :param item_id: ID of the item for which the recommendations are to be generated.
-
- :param count: Number of items to be recommended (N for the top-N recommendation).
-
-
- Optional parameters:
-
- :param target_user_id: ID of the user who will see the recommendations.
-
-
- Specifying the *targetUserId* is beneficial because:
-
-
- * It makes the recommendations personalized
-
- * Allows the calculation of Actions and Conversions in the graphical user interface,
-
- as Recombee can pair the user who got recommendations and who afterwards viewed/purchased an item.
-
-
- For the above reasons, we encourage you to set the *targetUserId* even for anonymous/unregistered users (i.e. use their session ID).
-
-
- :param user_impact: If *targetUserId* parameter is present, the recommendations are biased towards the user given. Using *userImpact*, you may control this bias. For an extreme case of `userImpact=0.0`, the interactions made by the user are not taken into account at all (with the exception of history-based blacklisting), for `userImpact=1.0`, you'll get user-based recommendation. The default value is `0`.
-
-
- :param filter: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
-
- :param booster: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
-
- :param allow_nonexistent: Instead of causing HTTP 404 error, returns some (non-personalized) recommendations if either item of given *itemId* or user of given *targetUserId* does not exist in the database. It creates neither of the missing entities in the database.
-
- :param cascade_create: If item of given *itemId* or user of given *targetUserId* doesn't exist in the database, it creates the missing enity/entities and returns some (non-personalized) recommendations. This allows for example rotations in the following recommendations for the user of given *targetUserId*, as the user will be already known to the system.
-
- :param scenario: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing". You can see each scenario in the UI separately, so you can check how well each application performs. The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
-
- :param return_properties: With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying of the recommended items to the user.
-
-
- Example response:
-
- ```
-
- [
-
- E{lb}
-
- "itemId": "tv-178",
-
- "description": "4K TV with 3D feature",
-
- "categories": ["Electronics", "Televisions"],
-
- "price": 342,
-
- "url": "myshop.com/tv-178"
- E{rb},
-
- E{lb}
-
- "itemId": "mixer-42",
-
- "description": "Stainless Steel Mixer",
-
- "categories": ["Home & Kitchen"],
-
- "price": 39,
-
- "url": "myshop.com/mixer-42"
- E{rb}
-
- ]
-
- ```
-
-
- :param included_properties: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
-
-
- Example response for `includedProperties=description,price`:
-
- ```
-
- [
-
- E{lb}
-
- "itemId": "tv-178",
-
- "description": "4K TV with 3D feature",
-
- "price": 342
- E{rb},
-
- E{lb}
-
- "itemId": "mixer-42",
-
- "description": "Stainless Steel Mixer",
-
- "price": 39
- E{rb}
-
- ]
-
- ```
-
-
- :param diversity: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
-
-
- :param min_relevance: **Expert option** If the *targetUserId* is provided: Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested qualit, and may return less than *count* items when there is not enough data to fulfill it.
-
-
- :param rotation_rate: **Expert option** If the *targetUserId* is provided: If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0.01`.
-
-
- :param rotation_time: **Expert option** If the *targetUserId* is provided: Taking *rotationRate* into account, specifies how long time it takes to an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized. Default: `7200.0`.
-
-
- :param expert_settings: Dictionary of custom options.
-
-
-
- """
-
- def __init__(self, item_id, count, target_user_id=DEFAULT, user_impact=DEFAULT, filter=DEFAULT, booster=DEFAULT, allow_nonexistent=DEFAULT, cascade_create=DEFAULT, scenario=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, diversity=DEFAULT, min_relevance=DEFAULT, rotation_rate=DEFAULT, rotation_time=DEFAULT, expert_settings=DEFAULT):
- self.item_id = item_id
- self.count = count
- self.target_user_id = target_user_id
- self.user_impact = user_impact
- self.filter = filter
- self.booster = booster
- self.allow_nonexistent = allow_nonexistent
- self.cascade_create = cascade_create
- self.scenario = scenario
- self.return_properties = return_properties
- self.included_properties = included_properties
- self.diversity = diversity
- self.min_relevance = min_relevance
- self.rotation_rate = rotation_rate
- self.rotation_time = rotation_time
- self.expert_settings = expert_settings
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/items/%s/recomms/" % (self.item_id)
-
- def get_body_parameters(self):
- """
- Values of body parameters as a dictionary (name of parameter: value of the parameter).
- """
- p = dict()
- p['count'] = self.count
- if self.target_user_id is not DEFAULT:
- p['targetUserId'] = self.target_user_id
- if self.user_impact is not DEFAULT:
- p['userImpact'] = self.user_impact
- if self.filter is not DEFAULT:
- p['filter'] = self.filter
- if self.booster is not DEFAULT:
- p['booster'] = self.booster
- if self.allow_nonexistent is not DEFAULT:
- p['allowNonexistent'] = self.allow_nonexistent
- if self.cascade_create is not DEFAULT:
- p['cascadeCreate'] = self.cascade_create
- if self.scenario is not DEFAULT:
- p['scenario'] = self.scenario
- if self.return_properties is not DEFAULT:
- p['returnProperties'] = self.return_properties
- if self.included_properties is not DEFAULT:
- p['includedProperties'] = self.included_properties
- if self.diversity is not DEFAULT:
- p['diversity'] = self.diversity
- if self.min_relevance is not DEFAULT:
- p['minRelevance'] = self.min_relevance
- if self.rotation_rate is not DEFAULT:
- p['rotationRate'] = self.rotation_rate
- if self.rotation_time is not DEFAULT:
- p['rotationTime'] = self.rotation_time
- if self.expert_settings is not DEFAULT:
- p['expertSettings'] = self.expert_settings
- return p
-
- def get_query_parameters(self):
- """
- Values of query parameters as a dictionary (name of parameter: value of the parameter).
- """
- params = dict()
- return params
diff --git a/recombee_api_client/api_requests/list_group_items.py b/recombee_api_client/api_requests/list_group_items.py
index ddedaa5..ab664f5 100644
--- a/recombee_api_client/api_requests/list_group_items.py
+++ b/recombee_api_client/api_requests/list_group_items.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListGroupItems(Request):
"""
- def __init__(self, group_id):
+ def __init__(self, group_id: str):
+ super().__init__(path="/groups/%s/items/" % (group_id), method='get', timeout=100000, ensure_https=False)
self.group_id = group_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/groups/%s/items/" % (self.group_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_groups.py b/recombee_api_client/api_requests/list_groups.py
index dc00ee4..0aab649 100644
--- a/recombee_api_client/api_requests/list_groups.py
+++ b/recombee_api_client/api_requests/list_groups.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -10,19 +11,16 @@ class ListGroups(Request):
"""
def __init__(self):
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/groups/list/" % ()
+ super().__init__(path="/groups/list/" % (), method='get', timeout=100000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_bookmarks.py b/recombee_api_client/api_requests/list_item_bookmarks.py
index f3372ce..7cdf089 100644
--- a/recombee_api_client/api_requests/list_item_bookmarks.py
+++ b/recombee_api_client/api_requests/list_item_bookmarks.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListItemBookmarks(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/bookmarks/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/bookmarks/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_cart_additions.py b/recombee_api_client/api_requests/list_item_cart_additions.py
index a541506..194f2d6 100644
--- a/recombee_api_client/api_requests/list_item_cart_additions.py
+++ b/recombee_api_client/api_requests/list_item_cart_additions.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListItemCartAdditions(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/cartadditions/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/cartadditions/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_detail_views.py b/recombee_api_client/api_requests/list_item_detail_views.py
index c876385..6528ed6 100644
--- a/recombee_api_client/api_requests/list_item_detail_views.py
+++ b/recombee_api_client/api_requests/list_item_detail_views.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListItemDetailViews(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/detailviews/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/detailviews/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_properties.py b/recombee_api_client/api_requests/list_item_properties.py
index 46fc830..c0088f6 100644
--- a/recombee_api_client/api_requests/list_item_properties.py
+++ b/recombee_api_client/api_requests/list_item_properties.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -11,19 +12,16 @@ class ListItemProperties(Request):
"""
def __init__(self):
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/properties/list/" % ()
+ super().__init__(path="/items/properties/list/" % (), method='get', timeout=100000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_purchases.py b/recombee_api_client/api_requests/list_item_purchases.py
index ccaf154..5368302 100644
--- a/recombee_api_client/api_requests/list_item_purchases.py
+++ b/recombee_api_client/api_requests/list_item_purchases.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListItemPurchases(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/purchases/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/purchases/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_ratings.py b/recombee_api_client/api_requests/list_item_ratings.py
index 0762678..58dda6e 100644
--- a/recombee_api_client/api_requests/list_item_ratings.py
+++ b/recombee_api_client/api_requests/list_item_ratings.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListItemRatings(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/ratings/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/ratings/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_item_view_portions.py b/recombee_api_client/api_requests/list_item_view_portions.py
index f882b0d..b223787 100644
--- a/recombee_api_client/api_requests/list_item_view_portions.py
+++ b/recombee_api_client/api_requests/list_item_view_portions.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -15,21 +16,18 @@ class ListItemViewPortions(Request):
"""
- def __init__(self, item_id):
+ def __init__(self, item_id: str):
+ super().__init__(path="/items/%s/viewportions/" % (item_id), method='get', timeout=100000, ensure_https=False)
self.item_id = item_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/%s/viewportions/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_items.py b/recombee_api_client/api_requests/list_items.py
index 104eb3f..ecb69dd 100644
--- a/recombee_api_client/api_requests/list_items.py
+++ b/recombee_api_client/api_requests/list_items.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -90,25 +91,22 @@ class ListItems(Request):
"""
- def __init__(self, filter=DEFAULT, count=DEFAULT, offset=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT):
+ def __init__(self, filter: str = DEFAULT, count: int = DEFAULT, offset: int = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT):
+ super().__init__(path="/items/list/" % (), method='get', timeout=100000, ensure_https=False)
self.filter = filter
self.count = count
self.offset = offset
self.return_properties = return_properties
self.included_properties = included_properties
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/items/list/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_search_synonyms.py b/recombee_api_client/api_requests/list_search_synonyms.py
index 65a0d1b..ddec260 100644
--- a/recombee_api_client/api_requests/list_search_synonyms.py
+++ b/recombee_api_client/api_requests/list_search_synonyms.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -16,22 +17,19 @@ class ListSearchSynonyms(Request):
"""
- def __init__(self, count=DEFAULT, offset=DEFAULT):
+ def __init__(self, count: int = DEFAULT, offset: int = DEFAULT):
+ super().__init__(path="/synonyms/items/" % (), method='get', timeout=100000, ensure_https=False)
self.count = count
self.offset = offset
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/synonyms/items/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_series.py b/recombee_api_client/api_requests/list_series.py
index 88f4a97..97b95e1 100644
--- a/recombee_api_client/api_requests/list_series.py
+++ b/recombee_api_client/api_requests/list_series.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -10,19 +11,16 @@ class ListSeries(Request):
"""
def __init__(self):
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/series/list/" % ()
+ super().__init__(path="/series/list/" % (), method='get', timeout=100000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_series_items.py b/recombee_api_client/api_requests/list_series_items.py
index aba3386..9970b2a 100644
--- a/recombee_api_client/api_requests/list_series_items.py
+++ b/recombee_api_client/api_requests/list_series_items.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListSeriesItems(Request):
"""
- def __init__(self, series_id):
+ def __init__(self, series_id: str):
+ super().__init__(path="/series/%s/items/" % (series_id), method='get', timeout=100000, ensure_https=False)
self.series_id = series_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/series/%s/items/" % (self.series_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_bookmarks.py b/recombee_api_client/api_requests/list_user_bookmarks.py
index 1fe4184..35094f6 100644
--- a/recombee_api_client/api_requests/list_user_bookmarks.py
+++ b/recombee_api_client/api_requests/list_user_bookmarks.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListUserBookmarks(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/bookmarks/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/bookmarks/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_cart_additions.py b/recombee_api_client/api_requests/list_user_cart_additions.py
index 1e6da95..307caab 100644
--- a/recombee_api_client/api_requests/list_user_cart_additions.py
+++ b/recombee_api_client/api_requests/list_user_cart_additions.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListUserCartAdditions(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/cartadditions/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/cartadditions/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_detail_views.py b/recombee_api_client/api_requests/list_user_detail_views.py
index 12fd535..e31935a 100644
--- a/recombee_api_client/api_requests/list_user_detail_views.py
+++ b/recombee_api_client/api_requests/list_user_detail_views.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListUserDetailViews(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/detailviews/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/detailviews/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_properties.py b/recombee_api_client/api_requests/list_user_properties.py
index 8007200..c7ec356 100644
--- a/recombee_api_client/api_requests/list_user_properties.py
+++ b/recombee_api_client/api_requests/list_user_properties.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -11,19 +12,16 @@ class ListUserProperties(Request):
"""
def __init__(self):
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/properties/list/" % ()
+ super().__init__(path="/users/properties/list/" % (), method='get', timeout=100000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_purchases.py b/recombee_api_client/api_requests/list_user_purchases.py
index d5d6254..875eb58 100644
--- a/recombee_api_client/api_requests/list_user_purchases.py
+++ b/recombee_api_client/api_requests/list_user_purchases.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListUserPurchases(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/purchases/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/purchases/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_ratings.py b/recombee_api_client/api_requests/list_user_ratings.py
index 959c043..7e4b4c4 100644
--- a/recombee_api_client/api_requests/list_user_ratings.py
+++ b/recombee_api_client/api_requests/list_user_ratings.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -13,21 +14,18 @@ class ListUserRatings(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/ratings/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/ratings/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_user_view_portions.py b/recombee_api_client/api_requests/list_user_view_portions.py
index 76e9dbe..9aca665 100644
--- a/recombee_api_client/api_requests/list_user_view_portions.py
+++ b/recombee_api_client/api_requests/list_user_view_portions.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -14,21 +15,18 @@ class ListUserViewPortions(Request):
"""
- def __init__(self, user_id):
+ def __init__(self, user_id: str):
+ super().__init__(path="/users/%s/viewportions/" % (user_id), method='get', timeout=100000, ensure_https=False)
self.user_id = user_id
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/%s/viewportions/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/list_users.py b/recombee_api_client/api_requests/list_users.py
index 963243f..ab08bd4 100644
--- a/recombee_api_client/api_requests/list_users.py
+++ b/recombee_api_client/api_requests/list_users.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -78,25 +79,22 @@ class ListUsers(Request):
"""
- def __init__(self, filter=DEFAULT, count=DEFAULT, offset=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT):
+ def __init__(self, filter: str = DEFAULT, count: int = DEFAULT, offset: int = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT):
+ super().__init__(path="/users/list/" % (), method='get', timeout=100000, ensure_https=False)
self.filter = filter
self.count = count
self.offset = offset
self.return_properties = return_properties
self.included_properties = included_properties
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'get'
- self.path = "/users/list/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/merge_users.py b/recombee_api_client/api_requests/merge_users.py
index f419e75..eb6fe59 100644
--- a/recombee_api_client/api_requests/merge_users.py
+++ b/recombee_api_client/api_requests/merge_users.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -24,23 +25,20 @@ class MergeUsers(Request):
"""
- def __init__(self, target_user_id, source_user_id, cascade_create=DEFAULT):
+ def __init__(self, target_user_id: str, source_user_id: str, cascade_create: bool = DEFAULT):
+ super().__init__(path="/users/%s/merge/%s" % (target_user_id,source_user_id), method='put', timeout=10000, ensure_https=False)
self.target_user_id = target_user_id
self.source_user_id = source_user_id
self.cascade_create = cascade_create
- self.timeout = 10000
- self.ensure_https = False
- self.method = 'put'
- self.path = "/users/%s/merge/%s" % (self.target_user_id,self.source_user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/recommend_items_to_item.py b/recombee_api_client/api_requests/recommend_items_to_item.py
index 05fe12a..58ddf1a 100644
--- a/recombee_api_client/api_requests/recommend_items_to_item.py
+++ b/recombee_api_client/api_requests/recommend_items_to_item.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -216,7 +217,8 @@ class RecommendItemsToItem(Request):
"""
- def __init__(self, item_id, target_user_id, count, scenario=DEFAULT, cascade_create=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, filter=DEFAULT, booster=DEFAULT, logic=DEFAULT, user_impact=DEFAULT, diversity=DEFAULT, min_relevance=DEFAULT, rotation_rate=DEFAULT, rotation_time=DEFAULT, expert_settings=DEFAULT, return_ab_group=DEFAULT):
+ def __init__(self, item_id: str, target_user_id: str, count: int, scenario: str = DEFAULT, cascade_create: bool = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT, filter: str = DEFAULT, booster: str = DEFAULT, logic: Union[str, dict] = DEFAULT, user_impact: float = DEFAULT, diversity: float = DEFAULT, min_relevance: str = DEFAULT, rotation_rate: float = DEFAULT, rotation_time: float = DEFAULT, expert_settings: dict = DEFAULT, return_ab_group: bool = DEFAULT):
+ super().__init__(path="/recomms/items/%s/items/" % (item_id), method='post', timeout=3000, ensure_https=False)
self.item_id = item_id
self.target_user_id = target_user_id
self.count = count
@@ -234,12 +236,8 @@ def __init__(self, item_id, target_user_id, count, scenario=DEFAULT, cascade_cre
self.rotation_time = rotation_time
self.expert_settings = expert_settings
self.return_ab_group = return_ab_group
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/recomms/items/%s/items/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -276,7 +274,7 @@ def get_body_parameters(self):
p['returnAbGroup'] = self.return_ab_group
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/recommend_items_to_user.py b/recombee_api_client/api_requests/recommend_items_to_user.py
index 6bbae96..fe99960 100644
--- a/recombee_api_client/api_requests/recommend_items_to_user.py
+++ b/recombee_api_client/api_requests/recommend_items_to_user.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -171,7 +172,7 @@ class RecommendItemsToUser(Request):
:param min_relevance: **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested relevance, and may return less than *count* items when there is not enough data to fulfill it.
- :param rotation_rate: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0.1`.
+ :param rotation_rate: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0`.
:param rotation_time: **Expert option** Taking *rotationRate* into account, specifies how long time it takes to an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized. Default: `7200.0`.
@@ -186,7 +187,8 @@ class RecommendItemsToUser(Request):
"""
- def __init__(self, user_id, count, scenario=DEFAULT, cascade_create=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, filter=DEFAULT, booster=DEFAULT, logic=DEFAULT, diversity=DEFAULT, min_relevance=DEFAULT, rotation_rate=DEFAULT, rotation_time=DEFAULT, expert_settings=DEFAULT, return_ab_group=DEFAULT):
+ def __init__(self, user_id: str, count: int, scenario: str = DEFAULT, cascade_create: bool = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT, filter: str = DEFAULT, booster: str = DEFAULT, logic: Union[str, dict] = DEFAULT, diversity: float = DEFAULT, min_relevance: str = DEFAULT, rotation_rate: float = DEFAULT, rotation_time: float = DEFAULT, expert_settings: dict = DEFAULT, return_ab_group: bool = DEFAULT):
+ super().__init__(path="/recomms/users/%s/items/" % (user_id), method='post', timeout=3000, ensure_https=False)
self.user_id = user_id
self.count = count
self.scenario = scenario
@@ -202,12 +204,8 @@ def __init__(self, user_id, count, scenario=DEFAULT, cascade_create=DEFAULT, ret
self.rotation_time = rotation_time
self.expert_settings = expert_settings
self.return_ab_group = return_ab_group
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/recomms/users/%s/items/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -241,7 +239,7 @@ def get_body_parameters(self):
p['returnAbGroup'] = self.return_ab_group
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/recommend_next_items.py b/recombee_api_client/api_requests/recommend_next_items.py
index 0fb19bc..6eda5cb 100644
--- a/recombee_api_client/api_requests/recommend_next_items.py
+++ b/recombee_api_client/api_requests/recommend_next_items.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -32,15 +33,12 @@ class RecommendNextItems(Request):
"""
- def __init__(self, recomm_id, count):
+ def __init__(self, recomm_id: str, count: int):
+ super().__init__(path="/recomms/next/items/%s" % (recomm_id), method='post', timeout=3000, ensure_https=False)
self.recomm_id = recomm_id
self.count = count
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/recomms/next/items/%s" % (self.recomm_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -48,7 +46,7 @@ def get_body_parameters(self):
p['count'] = self.count
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/recommend_users_to_item.py b/recombee_api_client/api_requests/recommend_users_to_item.py
index 507272b..3ff01e2 100644
--- a/recombee_api_client/api_requests/recommend_users_to_item.py
+++ b/recombee_api_client/api_requests/recommend_users_to_item.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -156,7 +157,8 @@ class RecommendUsersToItem(Request):
"""
- def __init__(self, item_id, count, scenario=DEFAULT, cascade_create=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, filter=DEFAULT, booster=DEFAULT, logic=DEFAULT, diversity=DEFAULT, expert_settings=DEFAULT, return_ab_group=DEFAULT):
+ def __init__(self, item_id: str, count: int, scenario: str = DEFAULT, cascade_create: bool = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT, filter: str = DEFAULT, booster: str = DEFAULT, logic: Union[str, dict] = DEFAULT, diversity: float = DEFAULT, expert_settings: dict = DEFAULT, return_ab_group: bool = DEFAULT):
+ super().__init__(path="/recomms/items/%s/users/" % (item_id), method='post', timeout=50000, ensure_https=False)
self.item_id = item_id
self.count = count
self.scenario = scenario
@@ -169,12 +171,8 @@ def __init__(self, item_id, count, scenario=DEFAULT, cascade_create=DEFAULT, ret
self.diversity = diversity
self.expert_settings = expert_settings
self.return_ab_group = return_ab_group
- self.timeout = 50000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/recomms/items/%s/users/" % (self.item_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -202,7 +200,7 @@ def get_body_parameters(self):
p['returnAbGroup'] = self.return_ab_group
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/recommend_users_to_user.py b/recombee_api_client/api_requests/recommend_users_to_user.py
index b98ff95..885d0d8 100644
--- a/recombee_api_client/api_requests/recommend_users_to_user.py
+++ b/recombee_api_client/api_requests/recommend_users_to_user.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -165,7 +166,8 @@ class RecommendUsersToUser(Request):
"""
- def __init__(self, user_id, count, scenario=DEFAULT, cascade_create=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, filter=DEFAULT, booster=DEFAULT, logic=DEFAULT, diversity=DEFAULT, min_relevance=DEFAULT, rotation_rate=DEFAULT, rotation_time=DEFAULT, expert_settings=DEFAULT, return_ab_group=DEFAULT):
+ def __init__(self, user_id: str, count: int, scenario: str = DEFAULT, cascade_create: bool = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT, filter: str = DEFAULT, booster: str = DEFAULT, logic: Union[str, dict] = DEFAULT, diversity: float = DEFAULT, min_relevance: str = DEFAULT, rotation_rate: float = DEFAULT, rotation_time: float = DEFAULT, expert_settings: dict = DEFAULT, return_ab_group: bool = DEFAULT):
+ super().__init__(path="/recomms/users/%s/users/" % (user_id), method='post', timeout=50000, ensure_https=False)
self.user_id = user_id
self.count = count
self.scenario = scenario
@@ -181,12 +183,8 @@ def __init__(self, user_id, count, scenario=DEFAULT, cascade_create=DEFAULT, ret
self.rotation_time = rotation_time
self.expert_settings = expert_settings
self.return_ab_group = return_ab_group
- self.timeout = 50000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/recomms/users/%s/users/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -220,7 +218,7 @@ def get_body_parameters(self):
p['returnAbGroup'] = self.return_ab_group
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/remove_from_group.py b/recombee_api_client/api_requests/remove_from_group.py
index 53f9f78..0d2af8a 100644
--- a/recombee_api_client/api_requests/remove_from_group.py
+++ b/recombee_api_client/api_requests/remove_from_group.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -17,23 +18,20 @@ class RemoveFromGroup(Request):
"""
- def __init__(self, group_id, item_type, item_id):
+ def __init__(self, group_id: str, item_type: str, item_id: str):
+ super().__init__(path="/groups/%s/items/" % (group_id), method='delete', timeout=1000, ensure_https=False)
self.group_id = group_id
self.item_type = item_type
self.item_id = item_id
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/groups/%s/items/" % (self.group_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/remove_from_series.py b/recombee_api_client/api_requests/remove_from_series.py
index 7b2c9cc..ab9fb29 100644
--- a/recombee_api_client/api_requests/remove_from_series.py
+++ b/recombee_api_client/api_requests/remove_from_series.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -19,24 +20,21 @@ class RemoveFromSeries(Request):
"""
- def __init__(self, series_id, item_type, item_id, time):
+ def __init__(self, series_id: str, item_type: str, item_id: str, time: float):
+ super().__init__(path="/series/%s/items/" % (series_id), method='delete', timeout=1000, ensure_https=False)
self.series_id = series_id
self.item_type = item_type
self.item_id = item_id
self.time = time
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/series/%s/items/" % (self.series_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/request.py b/recombee_api_client/api_requests/request.py
index 4ced599..48afeff 100644
--- a/recombee_api_client/api_requests/request.py
+++ b/recombee_api_client/api_requests/request.py
@@ -2,4 +2,20 @@ class Request(object):
"""
Base class for all the requests
"""
- pass
\ No newline at end of file
+ def __init__(self, path: str, method: str, timeout: int, ensure_https: bool):
+ self.path = path
+ self.method = method
+ self.timeout = timeout
+ self.ensure_https = ensure_https
+
+ def get_body_parameters(self) -> dict:
+ """
+ Values of body parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ raise NotImplementedError()
+
+ def get_query_parameters(self) -> dict:
+ """
+ Values of query parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ raise NotImplementedError()
diff --git a/recombee_api_client/api_requests/reset_database.py b/recombee_api_client/api_requests/reset_database.py
index 299b5b2..dea7da6 100644
--- a/recombee_api_client/api_requests/reset_database.py
+++ b/recombee_api_client/api_requests/reset_database.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -11,19 +12,16 @@ class ResetDatabase(Request):
"""
def __init__(self):
- self.timeout = 100000
- self.ensure_https = False
- self.method = 'delete'
- self.path = "/" % ()
+ super().__init__(path="/" % (), method='delete', timeout=100000, ensure_https=False)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
p = dict()
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/search_items.py b/recombee_api_client/api_requests/search_items.py
index c4af79c..667c782 100644
--- a/recombee_api_client/api_requests/search_items.py
+++ b/recombee_api_client/api_requests/search_items.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -176,7 +177,8 @@ class SearchItems(Request):
"""
- def __init__(self, user_id, search_query, count, scenario=DEFAULT, cascade_create=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, filter=DEFAULT, booster=DEFAULT, logic=DEFAULT, expert_settings=DEFAULT, return_ab_group=DEFAULT):
+ def __init__(self, user_id: str, search_query: str, count: int, scenario: str = DEFAULT, cascade_create: bool = DEFAULT, return_properties: bool = DEFAULT, included_properties: list = DEFAULT, filter: str = DEFAULT, booster: str = DEFAULT, logic: Union[str, dict] = DEFAULT, expert_settings: dict = DEFAULT, return_ab_group: bool = DEFAULT):
+ super().__init__(path="/search/users/%s/items/" % (user_id), method='post', timeout=3000, ensure_https=False)
self.user_id = user_id
self.search_query = search_query
self.count = count
@@ -189,12 +191,8 @@ def __init__(self, user_id, search_query, count, scenario=DEFAULT, cascade_creat
self.logic = logic
self.expert_settings = expert_settings
self.return_ab_group = return_ab_group
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/search/users/%s/items/" % (self.user_id)
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -221,7 +219,7 @@ def get_body_parameters(self):
p['returnAbGroup'] = self.return_ab_group
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/set_item_values.py b/recombee_api_client/api_requests/set_item_values.py
index 327262e..f94f9d3 100644
--- a/recombee_api_client/api_requests/set_item_values.py
+++ b/recombee_api_client/api_requests/set_item_values.py
@@ -1,5 +1,6 @@
from recombee_api_client.api_requests.set_values import SetValues
+
class SetItemValues(SetValues):
"""
Set/update (some) property values of a given item. The properties (columns) must be previously created by [Add item property](https://docs.recombee.com/api.html#add-item-property).
@@ -34,8 +35,6 @@ class SetItemValues(SetValues):
"""
- def __init__(self,item_id, values, cascade_create=None):
- super(SetItemValues, self).__init__(values, cascade_create=cascade_create)
-
+ def __init__(self, item_id: str, values: dict, cascade_create: bool = None):
+ super().__init__(path="/items/%s" % item_id, values=values, cascade_create=cascade_create)
self.item_id = item_id
- self.path = "/items/%s" % (self.item_id)
\ No newline at end of file
diff --git a/recombee_api_client/api_requests/set_user_values.py b/recombee_api_client/api_requests/set_user_values.py
index c97dd64..1cb4398 100644
--- a/recombee_api_client/api_requests/set_user_values.py
+++ b/recombee_api_client/api_requests/set_user_values.py
@@ -1,5 +1,6 @@
from recombee_api_client.api_requests.set_values import SetValues
+
class SetUserValues(SetValues):
"""
Set/update (some) property values of a given user. The properties (columns) must be previously created by [Add user property](https://docs.recombee.com/api.html#add-user-property).
@@ -27,8 +28,6 @@ class SetUserValues(SetValues):
:param cascade_create: Sets whether the given user should be created if not present in the database.
"""
- def __init__(self,user_id, values, cascade_create=None):
- super(SetUserValues, self).__init__(values, cascade_create=cascade_create)
-
+ def __init__(self, user_id: str, values: dict, cascade_create: bool = None):
+ super().__init__(path="/users/%s" % user_id, values=values, cascade_create=cascade_create)
self.user_id = user_id
- self.path = "/users/%s" % (self.user_id)
\ No newline at end of file
diff --git a/recombee_api_client/api_requests/set_values.py b/recombee_api_client/api_requests/set_values.py
index 6ab95a5..b216cbe 100644
--- a/recombee_api_client/api_requests/set_values.py
+++ b/recombee_api_client/api_requests/set_values.py
@@ -1,6 +1,7 @@
from recombee_api_client.api_requests.request import Request
from datetime import datetime
+
class SetValues(Request):
"""
Set/update (some) property values of an entity.
@@ -31,14 +32,12 @@ class SetValues(Request):
"""
- def __init__(self, values, cascade_create=None):
+ def __init__(self, path: str, values: dict, cascade_create: bool = None):
+ super().__init__(path=path, method='post', timeout=1000, ensure_https=False)
self.values = values
self.cascade_create = cascade_create
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -49,8 +48,8 @@ def get_body_parameters(self):
values['!cascadeCreate'] = self.cascade_create
return values
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
- return dict()
\ No newline at end of file
+ return dict()
diff --git a/recombee_api_client/api_requests/set_view_portion.py b/recombee_api_client/api_requests/set_view_portion.py
index ffffa2d..e866208 100644
--- a/recombee_api_client/api_requests/set_view_portion.py
+++ b/recombee_api_client/api_requests/set_view_portion.py
@@ -1,4 +1,5 @@
from recombee_api_client.api_requests.request import Request
+from typing import Union, List
import uuid
DEFAULT = uuid.uuid4()
@@ -32,7 +33,8 @@ class SetViewPortion(Request):
"""
- def __init__(self, user_id, item_id, portion, session_id=DEFAULT, timestamp=DEFAULT, cascade_create=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT):
+ def __init__(self, user_id: str, item_id: str, portion: float, session_id: str = DEFAULT, timestamp: Union[str, int] = DEFAULT, cascade_create: bool = DEFAULT, recomm_id: str = DEFAULT, additional_data: dict = DEFAULT):
+ super().__init__(path="/viewportions/" % (), method='post', timeout=1000, ensure_https=False)
self.user_id = user_id
self.item_id = item_id
self.portion = portion
@@ -41,12 +43,8 @@ def __init__(self, user_id, item_id, portion, session_id=DEFAULT, timestamp=DEFA
self.cascade_create = cascade_create
self.recomm_id = recomm_id
self.additional_data = additional_data
- self.timeout = 1000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/viewportions/" % ()
- def get_body_parameters(self):
+ def get_body_parameters(self) -> dict:
"""
Values of body parameters as a dictionary (name of parameter: value of the parameter).
"""
@@ -66,7 +64,7 @@ def get_body_parameters(self):
p['additionalData'] = self.additional_data
return p
- def get_query_parameters(self):
+ def get_query_parameters(self) -> dict:
"""
Values of query parameters as a dictionary (name of parameter: value of the parameter).
"""
diff --git a/recombee_api_client/api_requests/update_more_items.py b/recombee_api_client/api_requests/update_more_items.py
new file mode 100644
index 0000000..25f98f3
--- /dev/null
+++ b/recombee_api_client/api_requests/update_more_items.py
@@ -0,0 +1,48 @@
+from recombee_api_client.api_requests.request import Request
+from typing import Union, List
+import uuid
+
+DEFAULT = uuid.uuid4()
+
+class UpdateMoreItems(Request):
+ """
+ Update (some) property values of all the items that pass the filter.
+
+ Example: *Setting all the items that are older than a week as unavailable*
+
+ ```
+ {
+ "filter": "'releaseDate' < now() - 7*24*3600",
+ "changes": {"available": false}
+ }
+ ```
+
+ Required parameters:
+
+ :param filter: A [ReQL](https://docs.recombee.com/reql.html) expression, which return `true` for the items that shall be updated.
+
+ :param changes: A dictionary where the keys are properties which shall be updated.
+
+
+ """
+
+ def __init__(self, filter: str, changes: dict):
+ super().__init__(path="/more-items/" % (), method='post', timeout=1000, ensure_https=False)
+ self.filter = filter
+ self.changes = changes
+
+ def get_body_parameters(self) -> dict:
+ """
+ Values of body parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ p = dict()
+ p['filter'] = self.filter
+ p['changes'] = self.changes
+ return p
+
+ def get_query_parameters(self) -> dict:
+ """
+ Values of query parameters as a dictionary (name of parameter: value of the parameter).
+ """
+ params = dict()
+ return params
diff --git a/recombee_api_client/api_requests/user_based_recommendation.py b/recombee_api_client/api_requests/user_based_recommendation.py
deleted file mode 100644
index e86fa91..0000000
--- a/recombee_api_client/api_requests/user_based_recommendation.py
+++ /dev/null
@@ -1,180 +0,0 @@
-from recombee_api_client.api_requests.request import Request
-import uuid
-
-DEFAULT = uuid.uuid4()
-
-class UserBasedRecommendation(Request):
- """
- Deprecated since version 2.0.0. Use RecommendItemsToUser request instead.
-
- Based on user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for a given user.
-
- It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
-
- Required parameters:
-
- :param user_id: ID of the user for whom the personalized recommendations are to be generated.
-
- :param count: Number of items to be recommended (N for the top-N recommendation).
-
-
- Optional parameters:
-
- :param filter: Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
-
- :param booster: Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
-
- :param allow_nonexistent: If the user does not exist in the database, returns a list of non-personalized recommendations instead of causing HTTP 404 error. It doesn't create the user in the database.
-
- :param cascade_create: If the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.
-
- :param scenario: Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing". You can see each scenario in the UI separately, so you can check how well each application performs. The AI which optimizes models in order to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
-
- :param return_properties: With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used for easy displaying of the recommended items to the user.
-
-
- Example response:
-
- ```
-
- [
-
- E{lb}
-
- "itemId": "tv-178",
-
- "description": "4K TV with 3D feature",
-
- "categories": ["Electronics", "Televisions"],
-
- "price": 342,
-
- "url": "myshop.com/tv-178"
- E{rb},
-
- E{lb}
-
- "itemId": "mixer-42",
-
- "description": "Stainless Steel Mixer",
-
- "categories": ["Home & Kitchen"],
-
- "price": 39,
-
- "url": "myshop.com/mixer-42"
- E{rb}
-
- ]
-
- ```
-
-
- :param included_properties: Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
-
-
- Example response for `includedProperties=description,price`:
-
- ```
-
- [
-
- E{lb}
-
- "itemId": "tv-178",
-
- "description": "4K TV with 3D feature",
-
- "price": 342
- E{rb},
-
- E{lb}
-
- "itemId": "mixer-42",
-
- "description": "Stainless Steel Mixer",
-
- "price": 39
- E{rb}
-
- ]
-
- ```
-
-
- :param diversity: **Expert option** Real number from [0.0, 1.0] which determines how much mutually dissimilar should the recommended items be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
-
-
- :param min_relevance: **Expert option** Specifies the threshold of how much relevant must the recommended items be to the user. Possible values one of: "low", "medium", "high". The default value is "low", meaning that the system attempts to recommend number of items equal to *count* at any cost. If there are not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations to be appended to reach the full *count*. This behavior may be suppressed by using "medium" or "high" values. In such case, the system only recommends items of at least the requested qualit, and may return less than *count* items when there is not enough data to fulfill it.
-
-
- :param rotation_rate: **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per-request in backward fashion. You may penalize an item for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example `rotationRate=0.2` for only slight rotation of recommended items. Default: `0.1`.
-
-
- :param rotation_time: **Expert option** Taking *rotationRate* into account, specifies how long time it takes to an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized. Default: `7200.0`.
-
-
- :param expert_settings: Dictionary of custom options.
-
-
-
- """
-
- def __init__(self, user_id, count, filter=DEFAULT, booster=DEFAULT, allow_nonexistent=DEFAULT, cascade_create=DEFAULT, scenario=DEFAULT, return_properties=DEFAULT, included_properties=DEFAULT, diversity=DEFAULT, min_relevance=DEFAULT, rotation_rate=DEFAULT, rotation_time=DEFAULT, expert_settings=DEFAULT):
- self.user_id = user_id
- self.count = count
- self.filter = filter
- self.booster = booster
- self.allow_nonexistent = allow_nonexistent
- self.cascade_create = cascade_create
- self.scenario = scenario
- self.return_properties = return_properties
- self.included_properties = included_properties
- self.diversity = diversity
- self.min_relevance = min_relevance
- self.rotation_rate = rotation_rate
- self.rotation_time = rotation_time
- self.expert_settings = expert_settings
- self.timeout = 3000
- self.ensure_https = False
- self.method = 'post'
- self.path = "/users/%s/recomms/" % (self.user_id)
-
- def get_body_parameters(self):
- """
- Values of body parameters as a dictionary (name of parameter: value of the parameter).
- """
- p = dict()
- p['count'] = self.count
- if self.filter is not DEFAULT:
- p['filter'] = self.filter
- if self.booster is not DEFAULT:
- p['booster'] = self.booster
- if self.allow_nonexistent is not DEFAULT:
- p['allowNonexistent'] = self.allow_nonexistent
- if self.cascade_create is not DEFAULT:
- p['cascadeCreate'] = self.cascade_create
- if self.scenario is not DEFAULT:
- p['scenario'] = self.scenario
- if self.return_properties is not DEFAULT:
- p['returnProperties'] = self.return_properties
- if self.included_properties is not DEFAULT:
- p['includedProperties'] = self.included_properties
- if self.diversity is not DEFAULT:
- p['diversity'] = self.diversity
- if self.min_relevance is not DEFAULT:
- p['minRelevance'] = self.min_relevance
- if self.rotation_rate is not DEFAULT:
- p['rotationRate'] = self.rotation_rate
- if self.rotation_time is not DEFAULT:
- p['rotationTime'] = self.rotation_time
- if self.expert_settings is not DEFAULT:
- p['expertSettings'] = self.expert_settings
- return p
-
- def get_query_parameters(self):
- """
- Values of query parameters as a dictionary (name of parameter: value of the parameter).
- """
- params = dict()
- return params
diff --git a/recombee_api_client/exceptions.py b/recombee_api_client/exceptions.py
index b3f01ee..a71072e 100644
--- a/recombee_api_client/exceptions.py
+++ b/recombee_api_client/exceptions.py
@@ -1,14 +1,18 @@
+from recombee_api_client.api_requests import Request
+
+
class APIException(Exception):
"""
Base class for exceptions that occur because of errors in requests reported by API or because of a timeout
"""
pass
+
class ResponseException(APIException):
"""
Exception which is thrown when response status code is not 200 or 201
"""
- def __init__(self, request, status_code, description):
+ def __init__(self, request: Request, status_code: int, description: str):
super(ResponseException, self).__init__("status: %s, description: %s" % (status_code, description))
@@ -16,11 +20,12 @@ def __init__(self, request, status_code, description):
self.status_code = status_code
self.description = description
+
class ApiTimeoutException(APIException):
"""
Exception which is thrown when a request is not processed within the timeout
"""
- def __init__(self, request):
+ def __init__(self, request: Request):
super(ApiTimeoutException, self).__init__("ApiTimeout: client did not get response within %s ms" % request.timeout)
diff --git a/setup.py b/setup.py
index d3675dd..ac61d33 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@
setup(
name='recombee-api-client',
- version='3.2.0',
+ version='4.0.0',
description='Client for Recombee recommendation API',
long_description=long_description,
@@ -35,14 +35,13 @@
'License :: OSI Approved :: MIT License',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.1',
- 'Programming Language :: Python :: 3.2',
- 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
],
keywords='recommendation engine as a service',
@@ -53,6 +52,8 @@
install_requires=['requests'],
+ python_requires='>=3.4',
+
extras_require={},
package_data={},
diff --git a/tests/test.py b/tests/test.py
index 58a3caa..5107bb0 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -32,6 +32,10 @@
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(GetItemPropertyInfoTestCase))
from tests.test_cases.test_list_item_properties import ListItemPropertiesTestCase
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(ListItemPropertiesTestCase))
+ from tests.test_cases.test_update_more_items import UpdateMoreItemsTestCase
+ suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(UpdateMoreItemsTestCase))
+ from tests.test_cases.test_delete_more_items import DeleteMoreItemsTestCase
+ suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(DeleteMoreItemsTestCase))
from tests.test_cases.test_add_series import AddSeriesTestCase
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(AddSeriesTestCase))
from tests.test_cases.test_delete_series import DeleteSeriesTestCase
@@ -134,10 +138,6 @@
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(RecommendUsersToUserTestCase))
from tests.test_cases.test_recommend_users_to_item import RecommendUsersToItemTestCase
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(RecommendUsersToItemTestCase))
- from tests.test_cases.test_user_based_recommendation import UserBasedRecommendationTestCase
- suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(UserBasedRecommendationTestCase))
- from tests.test_cases.test_item_based_recommendation import ItemBasedRecommendationTestCase
- suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(ItemBasedRecommendationTestCase))
from tests.test_cases.test_search_items import SearchItemsTestCase
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(SearchItemsTestCase))
from tests.test_cases.test_add_search_synonym import AddSearchSynonymTestCase
diff --git a/tests/test_cases/add_entity.py b/tests/test_cases/add_entity.py
index a4ef7e0..2d8b7d2 100644
--- a/tests/test_cases/add_entity.py
+++ b/tests/test_cases/add_entity.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class AddEntityTest (RecombeeTest ):
+class AddEntityTest(RecombeeTest):
def create_request(self,item_id):
pass
diff --git a/tests/test_cases/add_interaction.py b/tests/test_cases/add_interaction.py
index 7ad73b6..10bf3a5 100644
--- a/tests/test_cases/add_interaction.py
+++ b/tests/test_cases/add_interaction.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class AddInteractionTest (RecombeeTest ):
+class AddInteractionTest(RecombeeTest):
def create_request(self,user_id,item_id,timestamp=None,cascade_create=None,recomm_id=None,additional_data=None):
pass
diff --git a/tests/test_cases/add_property.py b/tests/test_cases/add_property.py
index ebc5ac0..b446cbb 100644
--- a/tests/test_cases/add_property.py
+++ b/tests/test_cases/add_property.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class AddPropertyTest (RecombeeTest ):
+class AddPropertyTest(RecombeeTest):
def create_request(self,property_name,type):
pass
diff --git a/tests/test_cases/add_rating.py b/tests/test_cases/add_rating.py
index 33f46b0..fce5817 100644
--- a/tests/test_cases/add_rating.py
+++ b/tests/test_cases/add_rating.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class AddRatingTest (RecombeeTest ):
+class AddRatingTest(RecombeeTest):
def create_request(self,user_id,item_id,rating,timestamp=None,cascade_create=None,recomm_id=None,additional_data=None):
pass
diff --git a/tests/test_cases/add_search_synonym.py b/tests/test_cases/add_search_synonym.py
index ea46ced..5ccab7c 100644
--- a/tests/test_cases/add_search_synonym.py
+++ b/tests/test_cases/add_search_synonym.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class AddSearchSynonymTest (RecombeeTest ):
+class AddSearchSynonymTest(RecombeeTest):
def create_request(self,term,synonym,one_way=None):
pass
diff --git a/tests/test_cases/delete_all_search_synonyms.py b/tests/test_cases/delete_all_search_synonyms.py
index 3f26364..1134e1a 100644
--- a/tests/test_cases/delete_all_search_synonyms.py
+++ b/tests/test_cases/delete_all_search_synonyms.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeleteAllSearchSynonymsTest (RecombeeTest ):
+class DeleteAllSearchSynonymsTest(RecombeeTest):
def create_request(self):
pass
diff --git a/tests/test_cases/delete_entity.py b/tests/test_cases/delete_entity.py
index b10fd3a..f0a3455 100644
--- a/tests/test_cases/delete_entity.py
+++ b/tests/test_cases/delete_entity.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeleteEntityTest (RecombeeTest ):
+class DeleteEntityTest(RecombeeTest):
def create_request(self,item_id):
pass
diff --git a/tests/test_cases/delete_interaction.py b/tests/test_cases/delete_interaction.py
index 181e4a2..b04e0dd 100644
--- a/tests/test_cases/delete_interaction.py
+++ b/tests/test_cases/delete_interaction.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeleteInteractionTest (InteractionsTest ):
+class DeleteInteractionTest(InteractionsTest):
def create_request(self,user_id,item_id,timestamp=None):
pass
diff --git a/tests/test_cases/delete_more_items.py b/tests/test_cases/delete_more_items.py
new file mode 100644
index 0000000..48a4cad
--- /dev/null
+++ b/tests/test_cases/delete_more_items.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# This file is auto-generated, do not edit
+#
+
+from tests.test_cases.recombee_test import RecombeeTest, InteractionsTest, RecommendationsTest
+from recombee_api_client.exceptions import ResponseException
+from recombee_api_client.api_requests import *
+
+class DeleteMoreItemsTest(RecombeeTest):
+
+ def create_request(self,filter):
+ pass
+
+ def test_delete_more_items(self):
+
+ # it 'deletes more items'
+ req = self.create_request('\'int_property\' == 42')
+ resp = self.client.send(req)
+ self.assertEqual(len(resp['itemIds']), 1)
+ self.assertEqual(resp['count'], 1)
+
diff --git a/tests/test_cases/delete_property.py b/tests/test_cases/delete_property.py
index 7055a23..118878e 100644
--- a/tests/test_cases/delete_property.py
+++ b/tests/test_cases/delete_property.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeletePropertyTest (RecombeeTest ):
+class DeletePropertyTest(RecombeeTest):
def create_request(self,property_name):
pass
diff --git a/tests/test_cases/delete_search_synonym.py b/tests/test_cases/delete_search_synonym.py
index de4cd61..ea83575 100644
--- a/tests/test_cases/delete_search_synonym.py
+++ b/tests/test_cases/delete_search_synonym.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeleteSearchSynonymTest (RecombeeTest ):
+class DeleteSearchSynonymTest(RecombeeTest):
def create_request(self,id):
pass
diff --git a/tests/test_cases/delete_view_portion.py b/tests/test_cases/delete_view_portion.py
index 2ce542a..1f252cb 100644
--- a/tests/test_cases/delete_view_portion.py
+++ b/tests/test_cases/delete_view_portion.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class DeleteViewPortionTest (InteractionsTest ):
+class DeleteViewPortionTest(InteractionsTest):
def create_request(self,user_id,item_id,session_id=None):
pass
diff --git a/tests/test_cases/get_property_info.py b/tests/test_cases/get_property_info.py
index 369733f..a2ca2d7 100644
--- a/tests/test_cases/get_property_info.py
+++ b/tests/test_cases/get_property_info.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class GetPropertyInfoTest (RecombeeTest ):
+class GetPropertyInfoTest(RecombeeTest):
def create_request(self,property_name):
pass
diff --git a/tests/test_cases/get_values.py b/tests/test_cases/get_values.py
index 5d570c6..d131167 100644
--- a/tests/test_cases/get_values.py
+++ b/tests/test_cases/get_values.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class GetValuesTest (RecombeeTest ):
+class GetValuesTest(RecombeeTest):
def create_request(self,item_id):
pass
diff --git a/tests/test_cases/insert_to_group.py b/tests/test_cases/insert_to_group.py
index 4b64e77..63c5cc0 100644
--- a/tests/test_cases/insert_to_group.py
+++ b/tests/test_cases/insert_to_group.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class InsertToGroupTest (RecombeeTest ):
+class InsertToGroupTest(RecombeeTest):
def create_request(self,group_id,item_type,item_id,cascade_create=None):
pass
diff --git a/tests/test_cases/insert_to_series.py b/tests/test_cases/insert_to_series.py
index 95b73be..8422a9b 100644
--- a/tests/test_cases/insert_to_series.py
+++ b/tests/test_cases/insert_to_series.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class InsertToSeriesTest (RecombeeTest ):
+class InsertToSeriesTest(RecombeeTest):
def create_request(self,series_id,item_type,item_id,time,cascade_create=None):
pass
diff --git a/tests/test_cases/item_to_item_recommendation.py b/tests/test_cases/item_to_item_recommendation.py
index e1e497c..76c12ce 100644
--- a/tests/test_cases/item_to_item_recommendation.py
+++ b/tests/test_cases/item_to_item_recommendation.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ItemToItemRecommendationTest (RecommendationsTest ):
+class ItemToItemRecommendationTest(RecommendationsTest):
def create_request(self,item_id,target_user_id,count,scenario=None,cascade_create=None,return_properties=None,included_properties=None,filter=None,booster=None,logic=None,user_impact=None,diversity=None,min_relevance=None,rotation_rate=None,rotation_time=None,expert_settings=None,return_ab_group=None):
pass
diff --git a/tests/test_cases/list_entities.py b/tests/test_cases/list_entities.py
index 242946b..2abea73 100644
--- a/tests/test_cases/list_entities.py
+++ b/tests/test_cases/list_entities.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListEntitiesTest (RecombeeTest ):
+class ListEntitiesTest(RecombeeTest):
def create_request(self):
pass
diff --git a/tests/test_cases/list_entities_with_properties.py b/tests/test_cases/list_entities_with_properties.py
index d2d4def..223e121 100644
--- a/tests/test_cases/list_entities_with_properties.py
+++ b/tests/test_cases/list_entities_with_properties.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListEntitiesWithPropertiesTest (RecombeeTest ):
+class ListEntitiesWithPropertiesTest(RecombeeTest):
def create_request(self,filter=None,count=None,offset=None,return_properties=None,included_properties=None):
pass
diff --git a/tests/test_cases/list_item_interactions.py b/tests/test_cases/list_item_interactions.py
index 50da032..997832c 100644
--- a/tests/test_cases/list_item_interactions.py
+++ b/tests/test_cases/list_item_interactions.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListItemInteractionsTest (InteractionsTest ):
+class ListItemInteractionsTest(InteractionsTest):
def create_request(self,item_id):
pass
diff --git a/tests/test_cases/list_properties.py b/tests/test_cases/list_properties.py
index 197b682..58cd613 100644
--- a/tests/test_cases/list_properties.py
+++ b/tests/test_cases/list_properties.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListPropertiesTest (RecombeeTest ):
+class ListPropertiesTest(RecombeeTest):
def create_request(self):
pass
diff --git a/tests/test_cases/list_search_synonyms.py b/tests/test_cases/list_search_synonyms.py
index 04f6cc7..e93be2b 100644
--- a/tests/test_cases/list_search_synonyms.py
+++ b/tests/test_cases/list_search_synonyms.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListSearchSynonymsTest (RecombeeTest ):
+class ListSearchSynonymsTest(RecombeeTest):
def create_request(self,count=None,offset=None):
pass
diff --git a/tests/test_cases/list_set_items.py b/tests/test_cases/list_set_items.py
index e84ca8d..4b8005e 100644
--- a/tests/test_cases/list_set_items.py
+++ b/tests/test_cases/list_set_items.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListSetItemsTest (RecombeeTest ):
+class ListSetItemsTest(RecombeeTest):
def create_request(self,series_id):
pass
diff --git a/tests/test_cases/list_user_interactions.py b/tests/test_cases/list_user_interactions.py
index 1a4ef89..0a07064 100644
--- a/tests/test_cases/list_user_interactions.py
+++ b/tests/test_cases/list_user_interactions.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class ListUserInteractionsTest (InteractionsTest ):
+class ListUserInteractionsTest(InteractionsTest):
def create_request(self,user_id):
pass
diff --git a/tests/test_cases/merge_users.py b/tests/test_cases/merge_users.py
index ea77e21..07c667d 100644
--- a/tests/test_cases/merge_users.py
+++ b/tests/test_cases/merge_users.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class MergeUsersTest (RecombeeTest ):
+class MergeUsersTest(RecombeeTest):
def create_request(self,target_user_id,source_user_id,cascade_create=None):
pass
diff --git a/tests/test_cases/next_items_recommendation.py b/tests/test_cases/next_items_recommendation.py
index 8b63132..85591aa 100644
--- a/tests/test_cases/next_items_recommendation.py
+++ b/tests/test_cases/next_items_recommendation.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class NextItemsRecommendationTest (RecommendationsTest ):
+class NextItemsRecommendationTest(RecommendationsTest):
def create_request(self,recomm_id,count):
pass
diff --git a/tests/test_cases/recombee_test.py b/tests/test_cases/recombee_test.py
index 9225728..9aab328 100644
--- a/tests/test_cases/recombee_test.py
+++ b/tests/test_cases/recombee_test.py
@@ -1,18 +1,33 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import os
import unittest
from random import random
-from recombee_api_client.api_client import RecombeeClient
+from recombee_api_client.api_client import RecombeeClient, Region
from recombee_api_client.api_requests import *
from recombee_api_client.exceptions import *
+
+class MissingEnvironmentVariable(Exception):
+ pass
+
+
class RecombeeTest( unittest.TestCase ):
def __init__(self, *args, **kwargs):
super(RecombeeTest, self).__init__(*args, **kwargs)
- self.client = RecombeeClient('client-test', 'jGGQ6ZKa8rQ1zTAyxTc0EMn55YPF7FJLUtaMLhbsGxmvwxgTwXYqmUk5xVZFw98L')
+
+ db_id = os.environ.get('DB_ID')
+ if db_id is None:
+ raise MissingEnvironmentVariable('DB_ID env var must be specified')
+
+ token = os.environ.get('PRIVATE_TOKEN')
+ if token is None:
+ raise MissingEnvironmentVariable('PRIVATE_TOKEN env var must be specified')
+
+ self.client = RecombeeClient(db_id, token, region=Region.EU_WEST)
def setUp(self):
diff --git a/tests/test_cases/recommendation.py b/tests/test_cases/recommendation.py
index 7cda3fb..4550bbe 100644
--- a/tests/test_cases/recommendation.py
+++ b/tests/test_cases/recommendation.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class RecommendationTest (RecommendationsTest ):
+class RecommendationTest(RecommendationsTest):
def create_request(self,user_id,count,scenario=None,cascade_create=None,return_properties=None,included_properties=None,filter=None,booster=None,logic=None,diversity=None,expert_settings=None,return_ab_group=None):
pass
diff --git a/tests/test_cases/recommendation_deprecated.py b/tests/test_cases/recommendation_deprecated.py
deleted file mode 100644
index 5fd2ef0..0000000
--- a/tests/test_cases/recommendation_deprecated.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# This file is auto-generated, do not edit
-#
-
-from tests.test_cases.recombee_test import RecombeeTest, InteractionsTest, RecommendationsTest
-from recombee_api_client.exceptions import ResponseException
-from recombee_api_client.api_requests import *
-
-class RecommendationDeprecatedTest (RecommendationsTest ):
-
- def create_request(self,user_id,count,filter=None,booster=None,allow_nonexistent=None,cascade_create=None,scenario=None,return_properties=None,included_properties=None,diversity=None,min_relevance=None,rotation_rate=None,rotation_time=None,expert_settings=None):
- pass
-
- def test_recommendation_deprecated(self):
-
- # it 'recommends'
- req = self.create_request('entity_id', 9)
- resp = self.client.send(req)
- self.assertEqual(len(resp), 9)
- # it 'recommends to previously nonexisting entity with cascadeCreate'
- req = self.create_request('nonexisting', 9, cascade_create=True)
- resp = self.client.send(req)
- self.assertEqual(len(resp), 9)
- # it 'recommends with expert settings'
- req = self.create_request('nonexisting2', 9, cascade_create=True, expert_settings={})
- resp = self.client.send(req)
- self.assertEqual(len(resp), 9)
-
diff --git a/tests/test_cases/remove_from_group.py b/tests/test_cases/remove_from_group.py
index 74984f1..7592064 100644
--- a/tests/test_cases/remove_from_group.py
+++ b/tests/test_cases/remove_from_group.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class RemoveFromGroupTest (RecombeeTest ):
+class RemoveFromGroupTest(RecombeeTest):
def create_request(self,group_id,item_type,item_id):
pass
diff --git a/tests/test_cases/remove_from_series.py b/tests/test_cases/remove_from_series.py
index 368a142..12e564e 100644
--- a/tests/test_cases/remove_from_series.py
+++ b/tests/test_cases/remove_from_series.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class RemoveFromSeriesTest (RecombeeTest ):
+class RemoveFromSeriesTest(RecombeeTest):
def create_request(self,series_id,item_type,item_id,time):
pass
diff --git a/tests/test_cases/search.py b/tests/test_cases/search.py
index d91220a..9ff73d9 100644
--- a/tests/test_cases/search.py
+++ b/tests/test_cases/search.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class SearchTest (RecommendationsTest ):
+class SearchTest(RecommendationsTest):
def create_request(self,user_id,search_query,count,scenario=None,cascade_create=None,return_properties=None,included_properties=None,filter=None,booster=None,logic=None,expert_settings=None,return_ab_group=None):
pass
diff --git a/tests/test_cases/set_values.py b/tests/test_cases/set_values.py
index e09bb7f..3db115b 100644
--- a/tests/test_cases/set_values.py
+++ b/tests/test_cases/set_values.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class SetValuesTest (RecombeeTest ):
+class SetValuesTest(RecombeeTest):
def create_request(self,item_id,values,cascade_create=None):
pass
diff --git a/tests/test_cases/set_view_portion.py b/tests/test_cases/set_view_portion.py
index ebbe585..c6ed2dc 100644
--- a/tests/test_cases/set_view_portion.py
+++ b/tests/test_cases/set_view_portion.py
@@ -8,7 +8,7 @@
from recombee_api_client.exceptions import ResponseException
from recombee_api_client.api_requests import *
-class SetViewPortionTest (RecombeeTest ):
+class SetViewPortionTest(RecombeeTest):
def create_request(self,user_id,item_id,portion,session_id=None,timestamp=None,cascade_create=None,recomm_id=None,additional_data=None):
pass
diff --git a/tests/test_cases/test_add_bookmark.py b/tests/test_cases/test_add_bookmark.py
index 7b86633..2b8ae72 100644
--- a/tests/test_cases/test_add_bookmark.py
+++ b/tests/test_cases/test_add_bookmark.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_interaction import AddInteractionTest
from recombee_api_client.api_requests import *
-class AddBookmarkTestCase (AddInteractionTest):
+class AddBookmarkTestCase(AddInteractionTest):
def create_request(self, user_id, item_id, timestamp=None, cascade_create=None, recomm_id=None, additional_data=None):
return AddBookmark(user_id, item_id, timestamp=timestamp, cascade_create=cascade_create, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_add_cart_addition.py b/tests/test_cases/test_add_cart_addition.py
index e45ff83..09a1a8f 100644
--- a/tests/test_cases/test_add_cart_addition.py
+++ b/tests/test_cases/test_add_cart_addition.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_interaction import AddInteractionTest
from recombee_api_client.api_requests import *
-class AddCartAdditionTestCase (AddInteractionTest):
+class AddCartAdditionTestCase(AddInteractionTest):
def create_request(self, user_id, item_id, timestamp=None, cascade_create=None, amount=None, price=None, recomm_id=None, additional_data=None):
return AddCartAddition(user_id, item_id, timestamp=timestamp, cascade_create=cascade_create, amount=amount, price=price, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_add_detail_view.py b/tests/test_cases/test_add_detail_view.py
index d4dd122..d9483f6 100644
--- a/tests/test_cases/test_add_detail_view.py
+++ b/tests/test_cases/test_add_detail_view.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_interaction import AddInteractionTest
from recombee_api_client.api_requests import *
-class AddDetailViewTestCase (AddInteractionTest):
+class AddDetailViewTestCase(AddInteractionTest):
def create_request(self, user_id, item_id, timestamp=None, duration=None, cascade_create=None, recomm_id=None, additional_data=None):
return AddDetailView(user_id, item_id, timestamp=timestamp, duration=duration, cascade_create=cascade_create, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_add_group.py b/tests/test_cases/test_add_group.py
index 70663e5..4fcaf65 100644
--- a/tests/test_cases/test_add_group.py
+++ b/tests/test_cases/test_add_group.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_entity import AddEntityTest
from recombee_api_client.api_requests import *
-class AddGroupTestCase (AddEntityTest):
+class AddGroupTestCase(AddEntityTest):
def create_request(self, group_id):
return AddGroup(group_id)
diff --git a/tests/test_cases/test_add_item.py b/tests/test_cases/test_add_item.py
index 461a24d..89c0208 100644
--- a/tests/test_cases/test_add_item.py
+++ b/tests/test_cases/test_add_item.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_entity import AddEntityTest
from recombee_api_client.api_requests import *
-class AddItemTestCase (AddEntityTest):
+class AddItemTestCase(AddEntityTest):
def create_request(self, item_id):
return AddItem(item_id)
diff --git a/tests/test_cases/test_add_item_property.py b/tests/test_cases/test_add_item_property.py
index 9218a52..b07cf75 100644
--- a/tests/test_cases/test_add_item_property.py
+++ b/tests/test_cases/test_add_item_property.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_property import AddPropertyTest
from recombee_api_client.api_requests import *
-class AddItemPropertyTestCase (AddPropertyTest):
+class AddItemPropertyTestCase(AddPropertyTest):
def create_request(self, property_name, type):
return AddItemProperty(property_name, type)
diff --git a/tests/test_cases/test_add_purchase.py b/tests/test_cases/test_add_purchase.py
index acb7d81..fb326c7 100644
--- a/tests/test_cases/test_add_purchase.py
+++ b/tests/test_cases/test_add_purchase.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_interaction import AddInteractionTest
from recombee_api_client.api_requests import *
-class AddPurchaseTestCase (AddInteractionTest):
+class AddPurchaseTestCase(AddInteractionTest):
def create_request(self, user_id, item_id, timestamp=None, cascade_create=None, amount=None, price=None, profit=None, recomm_id=None, additional_data=None):
return AddPurchase(user_id, item_id, timestamp=timestamp, cascade_create=cascade_create, amount=amount, price=price, profit=profit, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_add_rating.py b/tests/test_cases/test_add_rating.py
index 5f77423..edcf244 100644
--- a/tests/test_cases/test_add_rating.py
+++ b/tests/test_cases/test_add_rating.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_rating import AddRatingTest
from recombee_api_client.api_requests import *
-class AddRatingTestCase (AddRatingTest):
+class AddRatingTestCase(AddRatingTest):
def create_request(self, user_id, item_id, rating, timestamp=None, cascade_create=None, recomm_id=None, additional_data=None):
return AddRating(user_id, item_id, rating, timestamp=timestamp, cascade_create=cascade_create, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_add_search_synonym.py b/tests/test_cases/test_add_search_synonym.py
index a1fce7f..2812dfd 100644
--- a/tests/test_cases/test_add_search_synonym.py
+++ b/tests/test_cases/test_add_search_synonym.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_search_synonym import AddSearchSynonymTest
from recombee_api_client.api_requests import *
-class AddSearchSynonymTestCase (AddSearchSynonymTest):
+class AddSearchSynonymTestCase(AddSearchSynonymTest):
def create_request(self, term, synonym, one_way=None):
return AddSearchSynonym(term, synonym, one_way=one_way)
diff --git a/tests/test_cases/test_add_series.py b/tests/test_cases/test_add_series.py
index 07f4baa..9ae3344 100644
--- a/tests/test_cases/test_add_series.py
+++ b/tests/test_cases/test_add_series.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_entity import AddEntityTest
from recombee_api_client.api_requests import *
-class AddSeriesTestCase (AddEntityTest):
+class AddSeriesTestCase(AddEntityTest):
def create_request(self, series_id):
return AddSeries(series_id)
diff --git a/tests/test_cases/test_add_user.py b/tests/test_cases/test_add_user.py
index 303b9a9..3533328 100644
--- a/tests/test_cases/test_add_user.py
+++ b/tests/test_cases/test_add_user.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_entity import AddEntityTest
from recombee_api_client.api_requests import *
-class AddUserTestCase (AddEntityTest):
+class AddUserTestCase(AddEntityTest):
def create_request(self, user_id):
return AddUser(user_id)
diff --git a/tests/test_cases/test_add_user_property.py b/tests/test_cases/test_add_user_property.py
index 8a80622..8cfc8c2 100644
--- a/tests/test_cases/test_add_user_property.py
+++ b/tests/test_cases/test_add_user_property.py
@@ -7,7 +7,7 @@
from tests.test_cases.add_property import AddPropertyTest
from recombee_api_client.api_requests import *
-class AddUserPropertyTestCase (AddPropertyTest):
+class AddUserPropertyTestCase(AddPropertyTest):
def create_request(self, property_name, type):
return AddUserProperty(property_name, type)
diff --git a/tests/test_cases/test_batch.py b/tests/test_cases/test_batch.py
index 83d2c89..9f31e8c 100644
--- a/tests/test_cases/test_batch.py
+++ b/tests/test_cases/test_batch.py
@@ -24,8 +24,8 @@ def test_batch(self):
ListItems(filter="'num' >= 99"),
AddCartAddition('user', 'item2', timestamp='2013-10-29T09:38:41.341Z'),
AddCartAddition('user', 'item2', cascade_create=True),
- ItemBasedRecommendation('item2', 30),
- UserBasedRecommendation('user_id', 25, filter="'num'==68",allow_nonexistent=True)
+ RecommendItemsToItem('item2', 'user', 30),
+ RecommendItemsToUser('user_id', 25, filter="'num'==68",cascade_create=True)
]
resp = self.client.send(Batch(reqs))
diff --git a/tests/test_cases/test_delete_all_search_synonyms.py b/tests/test_cases/test_delete_all_search_synonyms.py
index af6e58f..b5a2c04 100644
--- a/tests/test_cases/test_delete_all_search_synonyms.py
+++ b/tests/test_cases/test_delete_all_search_synonyms.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_all_search_synonyms import DeleteAllSearchSynonymsTest
from recombee_api_client.api_requests import *
-class DeleteAllSearchSynonymsTestCase (DeleteAllSearchSynonymsTest):
+class DeleteAllSearchSynonymsTestCase(DeleteAllSearchSynonymsTest):
def create_request(self):
return DeleteAllSearchSynonyms()
diff --git a/tests/test_cases/test_delete_bookmark.py b/tests/test_cases/test_delete_bookmark.py
index f21ed71..f1e05d0 100644
--- a/tests/test_cases/test_delete_bookmark.py
+++ b/tests/test_cases/test_delete_bookmark.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_interaction import DeleteInteractionTest
from recombee_api_client.api_requests import *
-class DeleteBookmarkTestCase (DeleteInteractionTest):
+class DeleteBookmarkTestCase(DeleteInteractionTest):
def create_request(self, user_id, item_id, timestamp=None):
return DeleteBookmark(user_id, item_id, timestamp=timestamp)
diff --git a/tests/test_cases/test_delete_cart_addition.py b/tests/test_cases/test_delete_cart_addition.py
index 0a1fc48..ee1c02f 100644
--- a/tests/test_cases/test_delete_cart_addition.py
+++ b/tests/test_cases/test_delete_cart_addition.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_interaction import DeleteInteractionTest
from recombee_api_client.api_requests import *
-class DeleteCartAdditionTestCase (DeleteInteractionTest):
+class DeleteCartAdditionTestCase(DeleteInteractionTest):
def create_request(self, user_id, item_id, timestamp=None):
return DeleteCartAddition(user_id, item_id, timestamp=timestamp)
diff --git a/tests/test_cases/test_delete_detail_view.py b/tests/test_cases/test_delete_detail_view.py
index 3be2197..513a3ee 100644
--- a/tests/test_cases/test_delete_detail_view.py
+++ b/tests/test_cases/test_delete_detail_view.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_interaction import DeleteInteractionTest
from recombee_api_client.api_requests import *
-class DeleteDetailViewTestCase (DeleteInteractionTest):
+class DeleteDetailViewTestCase(DeleteInteractionTest):
def create_request(self, user_id, item_id, timestamp=None):
return DeleteDetailView(user_id, item_id, timestamp=timestamp)
diff --git a/tests/test_cases/test_delete_group.py b/tests/test_cases/test_delete_group.py
index 4df0a9d..bbd3bac 100644
--- a/tests/test_cases/test_delete_group.py
+++ b/tests/test_cases/test_delete_group.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_entity import DeleteEntityTest
from recombee_api_client.api_requests import *
-class DeleteGroupTestCase (DeleteEntityTest):
+class DeleteGroupTestCase(DeleteEntityTest):
def create_request(self, group_id):
return DeleteGroup(group_id)
diff --git a/tests/test_cases/test_delete_item.py b/tests/test_cases/test_delete_item.py
index 1601ea9..220fcbf 100644
--- a/tests/test_cases/test_delete_item.py
+++ b/tests/test_cases/test_delete_item.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_entity import DeleteEntityTest
from recombee_api_client.api_requests import *
-class DeleteItemTestCase (DeleteEntityTest):
+class DeleteItemTestCase(DeleteEntityTest):
def create_request(self, item_id):
return DeleteItem(item_id)
diff --git a/tests/test_cases/test_delete_item_property.py b/tests/test_cases/test_delete_item_property.py
index f16afcf..4cbead4 100644
--- a/tests/test_cases/test_delete_item_property.py
+++ b/tests/test_cases/test_delete_item_property.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_property import DeletePropertyTest
from recombee_api_client.api_requests import *
-class DeleteItemPropertyTestCase (DeletePropertyTest):
+class DeleteItemPropertyTestCase(DeletePropertyTest):
def create_request(self, property_name):
return DeleteItemProperty(property_name)
diff --git a/tests/test_cases/test_delete_more_items.py b/tests/test_cases/test_delete_more_items.py
new file mode 100644
index 0000000..9d4f10d
--- /dev/null
+++ b/tests/test_cases/test_delete_more_items.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# This file is auto-generated, do not edit
+#
+
+from tests.test_cases.delete_more_items import DeleteMoreItemsTest
+from recombee_api_client.api_requests import *
+
+class DeleteMoreItemsTestCase(DeleteMoreItemsTest):
+
+ def create_request(self, filter):
+ return DeleteMoreItems(filter)
diff --git a/tests/test_cases/test_delete_purchase.py b/tests/test_cases/test_delete_purchase.py
index 6308751..d6195d7 100644
--- a/tests/test_cases/test_delete_purchase.py
+++ b/tests/test_cases/test_delete_purchase.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_interaction import DeleteInteractionTest
from recombee_api_client.api_requests import *
-class DeletePurchaseTestCase (DeleteInteractionTest):
+class DeletePurchaseTestCase(DeleteInteractionTest):
def create_request(self, user_id, item_id, timestamp=None):
return DeletePurchase(user_id, item_id, timestamp=timestamp)
diff --git a/tests/test_cases/test_delete_rating.py b/tests/test_cases/test_delete_rating.py
index 6986128..36f2e25 100644
--- a/tests/test_cases/test_delete_rating.py
+++ b/tests/test_cases/test_delete_rating.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_interaction import DeleteInteractionTest
from recombee_api_client.api_requests import *
-class DeleteRatingTestCase (DeleteInteractionTest):
+class DeleteRatingTestCase(DeleteInteractionTest):
def create_request(self, user_id, item_id, timestamp=None):
return DeleteRating(user_id, item_id, timestamp=timestamp)
diff --git a/tests/test_cases/test_delete_search_synonym.py b/tests/test_cases/test_delete_search_synonym.py
index 85e31d2..fb3a552 100644
--- a/tests/test_cases/test_delete_search_synonym.py
+++ b/tests/test_cases/test_delete_search_synonym.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_search_synonym import DeleteSearchSynonymTest
from recombee_api_client.api_requests import *
-class DeleteSearchSynonymTestCase (DeleteSearchSynonymTest):
+class DeleteSearchSynonymTestCase(DeleteSearchSynonymTest):
def create_request(self, id):
return DeleteSearchSynonym(id)
diff --git a/tests/test_cases/test_delete_series.py b/tests/test_cases/test_delete_series.py
index d541958..ea64a7f 100644
--- a/tests/test_cases/test_delete_series.py
+++ b/tests/test_cases/test_delete_series.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_entity import DeleteEntityTest
from recombee_api_client.api_requests import *
-class DeleteSeriesTestCase (DeleteEntityTest):
+class DeleteSeriesTestCase(DeleteEntityTest):
def create_request(self, series_id):
return DeleteSeries(series_id)
diff --git a/tests/test_cases/test_delete_user.py b/tests/test_cases/test_delete_user.py
index 00cda80..c0e3f54 100644
--- a/tests/test_cases/test_delete_user.py
+++ b/tests/test_cases/test_delete_user.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_entity import DeleteEntityTest
from recombee_api_client.api_requests import *
-class DeleteUserTestCase (DeleteEntityTest):
+class DeleteUserTestCase(DeleteEntityTest):
def create_request(self, user_id):
return DeleteUser(user_id)
diff --git a/tests/test_cases/test_delete_user_property.py b/tests/test_cases/test_delete_user_property.py
index 409c61d..e747156 100644
--- a/tests/test_cases/test_delete_user_property.py
+++ b/tests/test_cases/test_delete_user_property.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_property import DeletePropertyTest
from recombee_api_client.api_requests import *
-class DeleteUserPropertyTestCase (DeletePropertyTest):
+class DeleteUserPropertyTestCase(DeletePropertyTest):
def create_request(self, property_name):
return DeleteUserProperty(property_name)
diff --git a/tests/test_cases/test_delete_view_portion.py b/tests/test_cases/test_delete_view_portion.py
index 3fbe921..88d700e 100644
--- a/tests/test_cases/test_delete_view_portion.py
+++ b/tests/test_cases/test_delete_view_portion.py
@@ -7,7 +7,7 @@
from tests.test_cases.delete_view_portion import DeleteViewPortionTest
from recombee_api_client.api_requests import *
-class DeleteViewPortionTestCase (DeleteViewPortionTest):
+class DeleteViewPortionTestCase(DeleteViewPortionTest):
def create_request(self, user_id, item_id, session_id=None):
return DeleteViewPortion(user_id, item_id, session_id=session_id)
diff --git a/tests/test_cases/test_get_item_property_info.py b/tests/test_cases/test_get_item_property_info.py
index 21d66ac..9743a92 100644
--- a/tests/test_cases/test_get_item_property_info.py
+++ b/tests/test_cases/test_get_item_property_info.py
@@ -7,7 +7,7 @@
from tests.test_cases.get_property_info import GetPropertyInfoTest
from recombee_api_client.api_requests import *
-class GetItemPropertyInfoTestCase (GetPropertyInfoTest):
+class GetItemPropertyInfoTestCase(GetPropertyInfoTest):
def create_request(self, property_name):
return GetItemPropertyInfo(property_name)
diff --git a/tests/test_cases/test_get_item_values.py b/tests/test_cases/test_get_item_values.py
index 9a1e89c..2b891d4 100644
--- a/tests/test_cases/test_get_item_values.py
+++ b/tests/test_cases/test_get_item_values.py
@@ -7,7 +7,7 @@
from tests.test_cases.get_values import GetValuesTest
from recombee_api_client.api_requests import *
-class GetItemValuesTestCase (GetValuesTest):
+class GetItemValuesTestCase(GetValuesTest):
def create_request(self, item_id):
return GetItemValues(item_id)
diff --git a/tests/test_cases/test_get_user_property_info.py b/tests/test_cases/test_get_user_property_info.py
index b09fbb8..a0b2afa 100644
--- a/tests/test_cases/test_get_user_property_info.py
+++ b/tests/test_cases/test_get_user_property_info.py
@@ -7,7 +7,7 @@
from tests.test_cases.get_property_info import GetPropertyInfoTest
from recombee_api_client.api_requests import *
-class GetUserPropertyInfoTestCase (GetPropertyInfoTest):
+class GetUserPropertyInfoTestCase(GetPropertyInfoTest):
def create_request(self, property_name):
return GetUserPropertyInfo(property_name)
diff --git a/tests/test_cases/test_get_user_values.py b/tests/test_cases/test_get_user_values.py
index 5ca0c42..ba51818 100644
--- a/tests/test_cases/test_get_user_values.py
+++ b/tests/test_cases/test_get_user_values.py
@@ -7,7 +7,7 @@
from tests.test_cases.get_values import GetValuesTest
from recombee_api_client.api_requests import *
-class GetUserValuesTestCase (GetValuesTest):
+class GetUserValuesTestCase(GetValuesTest):
def create_request(self, user_id):
return GetUserValues(user_id)
diff --git a/tests/test_cases/test_insert_to_group.py b/tests/test_cases/test_insert_to_group.py
index 592765e..88fa97b 100644
--- a/tests/test_cases/test_insert_to_group.py
+++ b/tests/test_cases/test_insert_to_group.py
@@ -7,7 +7,7 @@
from tests.test_cases.insert_to_group import InsertToGroupTest
from recombee_api_client.api_requests import *
-class InsertToGroupTestCase (InsertToGroupTest):
+class InsertToGroupTestCase(InsertToGroupTest):
def create_request(self, group_id, item_type, item_id, cascade_create=None):
return InsertToGroup(group_id, item_type, item_id, cascade_create=cascade_create)
diff --git a/tests/test_cases/test_insert_to_series.py b/tests/test_cases/test_insert_to_series.py
index 20bad52..75757dd 100644
--- a/tests/test_cases/test_insert_to_series.py
+++ b/tests/test_cases/test_insert_to_series.py
@@ -7,7 +7,7 @@
from tests.test_cases.insert_to_series import InsertToSeriesTest
from recombee_api_client.api_requests import *
-class InsertToSeriesTestCase (InsertToSeriesTest):
+class InsertToSeriesTestCase(InsertToSeriesTest):
def create_request(self, series_id, item_type, item_id, time, cascade_create=None):
return InsertToSeries(series_id, item_type, item_id, time, cascade_create=cascade_create)
diff --git a/tests/test_cases/test_list_group_items.py b/tests/test_cases/test_list_group_items.py
index b824586..3d93731 100644
--- a/tests/test_cases/test_list_group_items.py
+++ b/tests/test_cases/test_list_group_items.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_set_items import ListSetItemsTest
from recombee_api_client.api_requests import *
-class ListGroupItemsTestCase (ListSetItemsTest):
+class ListGroupItemsTestCase(ListSetItemsTest):
def create_request(self, group_id):
return ListGroupItems(group_id)
diff --git a/tests/test_cases/test_list_groups.py b/tests/test_cases/test_list_groups.py
index 031c6ad..7d2c610 100644
--- a/tests/test_cases/test_list_groups.py
+++ b/tests/test_cases/test_list_groups.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_entities import ListEntitiesTest
from recombee_api_client.api_requests import *
-class ListGroupsTestCase (ListEntitiesTest):
+class ListGroupsTestCase(ListEntitiesTest):
def create_request(self):
return ListGroups()
diff --git a/tests/test_cases/test_list_item_bookmarks.py b/tests/test_cases/test_list_item_bookmarks.py
index 8a9ab78..0579ba5 100644
--- a/tests/test_cases/test_list_item_bookmarks.py
+++ b/tests/test_cases/test_list_item_bookmarks.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemBookmarksTestCase (ListItemInteractionsTest):
+class ListItemBookmarksTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemBookmarks(item_id)
diff --git a/tests/test_cases/test_list_item_cart_additions.py b/tests/test_cases/test_list_item_cart_additions.py
index 38ecf30..817223f 100644
--- a/tests/test_cases/test_list_item_cart_additions.py
+++ b/tests/test_cases/test_list_item_cart_additions.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemCartAdditionsTestCase (ListItemInteractionsTest):
+class ListItemCartAdditionsTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemCartAdditions(item_id)
diff --git a/tests/test_cases/test_list_item_detail_views.py b/tests/test_cases/test_list_item_detail_views.py
index f4aeeb0..4c4d086 100644
--- a/tests/test_cases/test_list_item_detail_views.py
+++ b/tests/test_cases/test_list_item_detail_views.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemDetailViewsTestCase (ListItemInteractionsTest):
+class ListItemDetailViewsTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemDetailViews(item_id)
diff --git a/tests/test_cases/test_list_item_properties.py b/tests/test_cases/test_list_item_properties.py
index 098dbb8..ef3b834 100644
--- a/tests/test_cases/test_list_item_properties.py
+++ b/tests/test_cases/test_list_item_properties.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_properties import ListPropertiesTest
from recombee_api_client.api_requests import *
-class ListItemPropertiesTestCase (ListPropertiesTest):
+class ListItemPropertiesTestCase(ListPropertiesTest):
def create_request(self):
return ListItemProperties()
diff --git a/tests/test_cases/test_list_item_purchases.py b/tests/test_cases/test_list_item_purchases.py
index 9bf547b..0d13c9a 100644
--- a/tests/test_cases/test_list_item_purchases.py
+++ b/tests/test_cases/test_list_item_purchases.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemPurchasesTestCase (ListItemInteractionsTest):
+class ListItemPurchasesTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemPurchases(item_id)
diff --git a/tests/test_cases/test_list_item_ratings.py b/tests/test_cases/test_list_item_ratings.py
index 1d6da6c..349fe8c 100644
--- a/tests/test_cases/test_list_item_ratings.py
+++ b/tests/test_cases/test_list_item_ratings.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemRatingsTestCase (ListItemInteractionsTest):
+class ListItemRatingsTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemRatings(item_id)
diff --git a/tests/test_cases/test_list_item_view_portions.py b/tests/test_cases/test_list_item_view_portions.py
index 4059a3e..45d38d2 100644
--- a/tests/test_cases/test_list_item_view_portions.py
+++ b/tests/test_cases/test_list_item_view_portions.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_item_interactions import ListItemInteractionsTest
from recombee_api_client.api_requests import *
-class ListItemViewPortionsTestCase (ListItemInteractionsTest):
+class ListItemViewPortionsTestCase(ListItemInteractionsTest):
def create_request(self, item_id):
return ListItemViewPortions(item_id)
diff --git a/tests/test_cases/test_list_items.py b/tests/test_cases/test_list_items.py
index 2fd570e..401322d 100644
--- a/tests/test_cases/test_list_items.py
+++ b/tests/test_cases/test_list_items.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_entities_with_properties import ListEntitiesWithPropertiesTest
from recombee_api_client.api_requests import *
-class ListItemsTestCase (ListEntitiesWithPropertiesTest):
+class ListItemsTestCase(ListEntitiesWithPropertiesTest):
def create_request(self, filter=None, count=None, offset=None, return_properties=None, included_properties=None):
return ListItems(filter=filter, count=count, offset=offset, return_properties=return_properties, included_properties=included_properties)
diff --git a/tests/test_cases/test_list_search_synonyms.py b/tests/test_cases/test_list_search_synonyms.py
index 45641ce..c33fa65 100644
--- a/tests/test_cases/test_list_search_synonyms.py
+++ b/tests/test_cases/test_list_search_synonyms.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_search_synonyms import ListSearchSynonymsTest
from recombee_api_client.api_requests import *
-class ListSearchSynonymsTestCase (ListSearchSynonymsTest):
+class ListSearchSynonymsTestCase(ListSearchSynonymsTest):
def create_request(self, count=None, offset=None):
return ListSearchSynonyms(count=count, offset=offset)
diff --git a/tests/test_cases/test_list_series.py b/tests/test_cases/test_list_series.py
index 2b4c555..8c19688 100644
--- a/tests/test_cases/test_list_series.py
+++ b/tests/test_cases/test_list_series.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_entities import ListEntitiesTest
from recombee_api_client.api_requests import *
-class ListSeriesTestCase (ListEntitiesTest):
+class ListSeriesTestCase(ListEntitiesTest):
def create_request(self):
return ListSeries()
diff --git a/tests/test_cases/test_list_series_items.py b/tests/test_cases/test_list_series_items.py
index 58ce898..f623458 100644
--- a/tests/test_cases/test_list_series_items.py
+++ b/tests/test_cases/test_list_series_items.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_set_items import ListSetItemsTest
from recombee_api_client.api_requests import *
-class ListSeriesItemsTestCase (ListSetItemsTest):
+class ListSeriesItemsTestCase(ListSetItemsTest):
def create_request(self, series_id):
return ListSeriesItems(series_id)
diff --git a/tests/test_cases/test_list_user_bookmarks.py b/tests/test_cases/test_list_user_bookmarks.py
index c9ada38..a580b39 100644
--- a/tests/test_cases/test_list_user_bookmarks.py
+++ b/tests/test_cases/test_list_user_bookmarks.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserBookmarksTestCase (ListUserInteractionsTest):
+class ListUserBookmarksTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserBookmarks(user_id)
diff --git a/tests/test_cases/test_list_user_cart_additions.py b/tests/test_cases/test_list_user_cart_additions.py
index 1abac3b..b069fd0 100644
--- a/tests/test_cases/test_list_user_cart_additions.py
+++ b/tests/test_cases/test_list_user_cart_additions.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserCartAdditionsTestCase (ListUserInteractionsTest):
+class ListUserCartAdditionsTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserCartAdditions(user_id)
diff --git a/tests/test_cases/test_list_user_detail_views.py b/tests/test_cases/test_list_user_detail_views.py
index 613121a..890b6c9 100644
--- a/tests/test_cases/test_list_user_detail_views.py
+++ b/tests/test_cases/test_list_user_detail_views.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserDetailViewsTestCase (ListUserInteractionsTest):
+class ListUserDetailViewsTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserDetailViews(user_id)
diff --git a/tests/test_cases/test_list_user_properties.py b/tests/test_cases/test_list_user_properties.py
index e4493dc..a96e20c 100644
--- a/tests/test_cases/test_list_user_properties.py
+++ b/tests/test_cases/test_list_user_properties.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_properties import ListPropertiesTest
from recombee_api_client.api_requests import *
-class ListUserPropertiesTestCase (ListPropertiesTest):
+class ListUserPropertiesTestCase(ListPropertiesTest):
def create_request(self):
return ListUserProperties()
diff --git a/tests/test_cases/test_list_user_purchases.py b/tests/test_cases/test_list_user_purchases.py
index 51b3534..6c2b540 100644
--- a/tests/test_cases/test_list_user_purchases.py
+++ b/tests/test_cases/test_list_user_purchases.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserPurchasesTestCase (ListUserInteractionsTest):
+class ListUserPurchasesTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserPurchases(user_id)
diff --git a/tests/test_cases/test_list_user_ratings.py b/tests/test_cases/test_list_user_ratings.py
index 7a3f66f..ceea032 100644
--- a/tests/test_cases/test_list_user_ratings.py
+++ b/tests/test_cases/test_list_user_ratings.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserRatingsTestCase (ListUserInteractionsTest):
+class ListUserRatingsTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserRatings(user_id)
diff --git a/tests/test_cases/test_list_user_view_portions.py b/tests/test_cases/test_list_user_view_portions.py
index c3df423..ee9c556 100644
--- a/tests/test_cases/test_list_user_view_portions.py
+++ b/tests/test_cases/test_list_user_view_portions.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_user_interactions import ListUserInteractionsTest
from recombee_api_client.api_requests import *
-class ListUserViewPortionsTestCase (ListUserInteractionsTest):
+class ListUserViewPortionsTestCase(ListUserInteractionsTest):
def create_request(self, user_id):
return ListUserViewPortions(user_id)
diff --git a/tests/test_cases/test_list_users.py b/tests/test_cases/test_list_users.py
index 65138fe..c1fe459 100644
--- a/tests/test_cases/test_list_users.py
+++ b/tests/test_cases/test_list_users.py
@@ -7,7 +7,7 @@
from tests.test_cases.list_entities_with_properties import ListEntitiesWithPropertiesTest
from recombee_api_client.api_requests import *
-class ListUsersTestCase (ListEntitiesWithPropertiesTest):
+class ListUsersTestCase(ListEntitiesWithPropertiesTest):
def create_request(self, filter=None, count=None, offset=None, return_properties=None, included_properties=None):
return ListUsers(filter=filter, count=count, offset=offset, return_properties=return_properties, included_properties=included_properties)
diff --git a/tests/test_cases/test_merge_users.py b/tests/test_cases/test_merge_users.py
index 206947a..4d5ef80 100644
--- a/tests/test_cases/test_merge_users.py
+++ b/tests/test_cases/test_merge_users.py
@@ -7,7 +7,7 @@
from tests.test_cases.merge_users import MergeUsersTest
from recombee_api_client.api_requests import *
-class MergeUsersTestCase (MergeUsersTest):
+class MergeUsersTestCase(MergeUsersTest):
def create_request(self, target_user_id, source_user_id, cascade_create=None):
return MergeUsers(target_user_id, source_user_id, cascade_create=cascade_create)
diff --git a/tests/test_cases/test_recommend_items_to_item.py b/tests/test_cases/test_recommend_items_to_item.py
index 1badd22..67622bf 100644
--- a/tests/test_cases/test_recommend_items_to_item.py
+++ b/tests/test_cases/test_recommend_items_to_item.py
@@ -7,7 +7,7 @@
from tests.test_cases.item_to_item_recommendation import ItemToItemRecommendationTest
from recombee_api_client.api_requests import *
-class RecommendItemsToItemTestCase (ItemToItemRecommendationTest):
+class RecommendItemsToItemTestCase(ItemToItemRecommendationTest):
def create_request(self, item_id, target_user_id, count, scenario=None, cascade_create=None, return_properties=None, included_properties=None, filter=None, booster=None, logic=None, user_impact=None, diversity=None, min_relevance=None, rotation_rate=None, rotation_time=None, expert_settings=None, return_ab_group=None):
return RecommendItemsToItem(item_id, target_user_id, count, scenario=scenario, cascade_create=cascade_create, return_properties=return_properties, included_properties=included_properties, filter=filter, booster=booster, logic=logic, user_impact=user_impact, diversity=diversity, min_relevance=min_relevance, rotation_rate=rotation_rate, rotation_time=rotation_time, expert_settings=expert_settings, return_ab_group=return_ab_group)
diff --git a/tests/test_cases/test_recommend_items_to_user.py b/tests/test_cases/test_recommend_items_to_user.py
index c41e1c8..bb7723b 100644
--- a/tests/test_cases/test_recommend_items_to_user.py
+++ b/tests/test_cases/test_recommend_items_to_user.py
@@ -7,7 +7,7 @@
from tests.test_cases.recommendation import RecommendationTest
from recombee_api_client.api_requests import *
-class RecommendItemsToUserTestCase (RecommendationTest):
+class RecommendItemsToUserTestCase(RecommendationTest):
def create_request(self, user_id, count, scenario=None, cascade_create=None, return_properties=None, included_properties=None, filter=None, booster=None, logic=None, diversity=None, min_relevance=None, rotation_rate=None, rotation_time=None, expert_settings=None, return_ab_group=None):
return RecommendItemsToUser(user_id, count, scenario=scenario, cascade_create=cascade_create, return_properties=return_properties, included_properties=included_properties, filter=filter, booster=booster, logic=logic, diversity=diversity, min_relevance=min_relevance, rotation_rate=rotation_rate, rotation_time=rotation_time, expert_settings=expert_settings, return_ab_group=return_ab_group)
diff --git a/tests/test_cases/test_recommend_next_items.py b/tests/test_cases/test_recommend_next_items.py
index 39f892a..9b32758 100644
--- a/tests/test_cases/test_recommend_next_items.py
+++ b/tests/test_cases/test_recommend_next_items.py
@@ -7,7 +7,7 @@
from tests.test_cases.next_items_recommendation import NextItemsRecommendationTest
from recombee_api_client.api_requests import *
-class RecommendNextItemsTestCase (NextItemsRecommendationTest):
+class RecommendNextItemsTestCase(NextItemsRecommendationTest):
def create_request(self, recomm_id, count):
return RecommendNextItems(recomm_id, count)
diff --git a/tests/test_cases/test_recommend_users_to_item.py b/tests/test_cases/test_recommend_users_to_item.py
index 5bc45ab..f56406a 100644
--- a/tests/test_cases/test_recommend_users_to_item.py
+++ b/tests/test_cases/test_recommend_users_to_item.py
@@ -7,7 +7,7 @@
from tests.test_cases.recommendation import RecommendationTest
from recombee_api_client.api_requests import *
-class RecommendUsersToItemTestCase (RecommendationTest):
+class RecommendUsersToItemTestCase(RecommendationTest):
def create_request(self, item_id, count, scenario=None, cascade_create=None, return_properties=None, included_properties=None, filter=None, booster=None, logic=None, diversity=None, expert_settings=None, return_ab_group=None):
return RecommendUsersToItem(item_id, count, scenario=scenario, cascade_create=cascade_create, return_properties=return_properties, included_properties=included_properties, filter=filter, booster=booster, logic=logic, diversity=diversity, expert_settings=expert_settings, return_ab_group=return_ab_group)
diff --git a/tests/test_cases/test_recommend_users_to_user.py b/tests/test_cases/test_recommend_users_to_user.py
index cf95e06..577c4fd 100644
--- a/tests/test_cases/test_recommend_users_to_user.py
+++ b/tests/test_cases/test_recommend_users_to_user.py
@@ -7,7 +7,7 @@
from tests.test_cases.recommendation import RecommendationTest
from recombee_api_client.api_requests import *
-class RecommendUsersToUserTestCase (RecommendationTest):
+class RecommendUsersToUserTestCase(RecommendationTest):
def create_request(self, user_id, count, scenario=None, cascade_create=None, return_properties=None, included_properties=None, filter=None, booster=None, logic=None, diversity=None, min_relevance=None, rotation_rate=None, rotation_time=None, expert_settings=None, return_ab_group=None):
return RecommendUsersToUser(user_id, count, scenario=scenario, cascade_create=cascade_create, return_properties=return_properties, included_properties=included_properties, filter=filter, booster=booster, logic=logic, diversity=diversity, min_relevance=min_relevance, rotation_rate=rotation_rate, rotation_time=rotation_time, expert_settings=expert_settings, return_ab_group=return_ab_group)
diff --git a/tests/test_cases/test_remove_from_group.py b/tests/test_cases/test_remove_from_group.py
index 088e97b..3799c65 100644
--- a/tests/test_cases/test_remove_from_group.py
+++ b/tests/test_cases/test_remove_from_group.py
@@ -7,7 +7,7 @@
from tests.test_cases.remove_from_group import RemoveFromGroupTest
from recombee_api_client.api_requests import *
-class RemoveFromGroupTestCase (RemoveFromGroupTest):
+class RemoveFromGroupTestCase(RemoveFromGroupTest):
def create_request(self, group_id, item_type, item_id):
return RemoveFromGroup(group_id, item_type, item_id)
diff --git a/tests/test_cases/test_remove_from_series.py b/tests/test_cases/test_remove_from_series.py
index caa3253..8c9ecf3 100644
--- a/tests/test_cases/test_remove_from_series.py
+++ b/tests/test_cases/test_remove_from_series.py
@@ -7,7 +7,7 @@
from tests.test_cases.remove_from_series import RemoveFromSeriesTest
from recombee_api_client.api_requests import *
-class RemoveFromSeriesTestCase (RemoveFromSeriesTest):
+class RemoveFromSeriesTestCase(RemoveFromSeriesTest):
def create_request(self, series_id, item_type, item_id, time):
return RemoveFromSeries(series_id, item_type, item_id, time)
diff --git a/tests/test_cases/test_search_items.py b/tests/test_cases/test_search_items.py
index 27510df..e3d52a4 100644
--- a/tests/test_cases/test_search_items.py
+++ b/tests/test_cases/test_search_items.py
@@ -7,7 +7,7 @@
from tests.test_cases.search import SearchTest
from recombee_api_client.api_requests import *
-class SearchItemsTestCase (SearchTest):
+class SearchItemsTestCase(SearchTest):
def create_request(self, user_id, search_query, count, scenario=None, cascade_create=None, return_properties=None, included_properties=None, filter=None, booster=None, logic=None, expert_settings=None, return_ab_group=None):
return SearchItems(user_id, search_query, count, scenario=scenario, cascade_create=cascade_create, return_properties=return_properties, included_properties=included_properties, filter=filter, booster=booster, logic=logic, expert_settings=expert_settings, return_ab_group=return_ab_group)
diff --git a/tests/test_cases/test_set_item_values.py b/tests/test_cases/test_set_item_values.py
index e1f2ffb..d285124 100644
--- a/tests/test_cases/test_set_item_values.py
+++ b/tests/test_cases/test_set_item_values.py
@@ -7,7 +7,7 @@
from tests.test_cases.set_values import SetValuesTest
from recombee_api_client.api_requests import *
-class SetItemValuesTestCase (SetValuesTest):
+class SetItemValuesTestCase(SetValuesTest):
def create_request(self, item_id, values, cascade_create=None):
return SetItemValues(item_id, values, cascade_create=cascade_create)
diff --git a/tests/test_cases/test_set_user_values.py b/tests/test_cases/test_set_user_values.py
index 94f8552..b7be1da 100644
--- a/tests/test_cases/test_set_user_values.py
+++ b/tests/test_cases/test_set_user_values.py
@@ -7,7 +7,7 @@
from tests.test_cases.set_values import SetValuesTest
from recombee_api_client.api_requests import *
-class SetUserValuesTestCase (SetValuesTest):
+class SetUserValuesTestCase(SetValuesTest):
def create_request(self, user_id, values, cascade_create=None):
return SetUserValues(user_id, values, cascade_create=cascade_create)
diff --git a/tests/test_cases/test_set_view_portion.py b/tests/test_cases/test_set_view_portion.py
index f080189..b5fe08f 100644
--- a/tests/test_cases/test_set_view_portion.py
+++ b/tests/test_cases/test_set_view_portion.py
@@ -7,7 +7,7 @@
from tests.test_cases.set_view_portion import SetViewPortionTest
from recombee_api_client.api_requests import *
-class SetViewPortionTestCase (SetViewPortionTest):
+class SetViewPortionTestCase(SetViewPortionTest):
def create_request(self, user_id, item_id, portion, session_id=None, timestamp=None, cascade_create=None, recomm_id=None, additional_data=None):
return SetViewPortion(user_id, item_id, portion, session_id=session_id, timestamp=timestamp, cascade_create=cascade_create, recomm_id=recomm_id, additional_data=additional_data)
diff --git a/tests/test_cases/test_update_more_items.py b/tests/test_cases/test_update_more_items.py
new file mode 100644
index 0000000..28e0723
--- /dev/null
+++ b/tests/test_cases/test_update_more_items.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# This file is auto-generated, do not edit
+#
+
+from tests.test_cases.update_more_items import UpdateMoreItemsTest
+from recombee_api_client.api_requests import *
+
+class UpdateMoreItemsTestCase(UpdateMoreItemsTest):
+
+ def create_request(self, filter, changes):
+ return UpdateMoreItems(filter, changes)
diff --git a/tests/test_cases/test_user_based_recommendation.py b/tests/test_cases/test_user_based_recommendation.py
deleted file mode 100644
index ebea50b..0000000
--- a/tests/test_cases/test_user_based_recommendation.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# This file is auto-generated, do not edit
-#
-
-from tests.test_cases.recommendation_deprecated import RecommendationDeprecatedTest
-from recombee_api_client.api_requests import *
-
-class UserBasedRecommendationTestCase (RecommendationDeprecatedTest):
-
- def create_request(self, user_id, count, filter=None, booster=None, allow_nonexistent=None, cascade_create=None, scenario=None, return_properties=None, included_properties=None, diversity=None, min_relevance=None, rotation_rate=None, rotation_time=None, expert_settings=None):
- return UserBasedRecommendation(user_id, count, filter=filter, booster=booster, allow_nonexistent=allow_nonexistent, cascade_create=cascade_create, scenario=scenario, return_properties=return_properties, included_properties=included_properties, diversity=diversity, min_relevance=min_relevance, rotation_rate=rotation_rate, rotation_time=rotation_time, expert_settings=expert_settings)
diff --git a/tests/test_cases/update_more_items.py b/tests/test_cases/update_more_items.py
new file mode 100644
index 0000000..0eb4537
--- /dev/null
+++ b/tests/test_cases/update_more_items.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# This file is auto-generated, do not edit
+#
+
+from tests.test_cases.recombee_test import RecombeeTest, InteractionsTest, RecommendationsTest
+from recombee_api_client.exceptions import ResponseException
+from recombee_api_client.api_requests import *
+
+class UpdateMoreItemsTest(RecombeeTest):
+
+ def create_request(self,filter,changes):
+ pass
+
+ def test_update_more_items(self):
+
+ # it 'updates more items'
+ req = self.create_request('\'int_property\' == 42', {'int_property': 77})
+ resp = self.client.send(req)
+ self.assertEqual(len(resp['itemIds']), 1)
+ self.assertEqual(resp['count'], 1)
+