diff --git a/LICENSE b/LICENSE index dce51a1..c27424b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2018 RetailDriver LLC +Copyright (c) 2015-2020 RetailDriver LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README b/README index f69296c..af2aa67 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ -retailCRM python API client +RetailCRM python API client =========================== -This is python retailCRM API client. This library allows to use all +This is python RetailCRM API client. This library allows to use all available API versions. Install @@ -22,7 +22,7 @@ Usage import retailcrm - client = retailcrm.v3('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') + client = retailcrm.v3('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') order = { 'firstName': 'John', @@ -42,7 +42,7 @@ Usage import retailcrm - client = retailcrm.v4('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') + client = retailcrm.v4('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') result = client.customers_history(filter={'sinceId': '1500', 'startDate': '2018-03-01'}) @@ -56,7 +56,7 @@ Usage import retailcrm - client = retailcrm.v5('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') + client = retailcrm.v5('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') site = 'example-com' task = { 'text': 'Product availability problem', @@ -68,12 +68,3 @@ Usage } result = client.task_create(task, site) - -Documentation -------------- - -- `English`_ -- `Russian`_ - -.. _English: https://help.retailcrm.pro/Developers/Index -.. _Russian: https://help.retailcrm.ru/Developers/Index diff --git a/README.md b/README.md index 74480a9..7ba84f2 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -[![Build Status](https://img.shields.io/travis/retailcrm/api-client-python/master.svg?style=flat-square)](https://travis-ci.org/retailcrm/api-client-python) -[![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/api-client-python/master.svg?style=flat-square)](https://codecov.io/gh/retailcrm/api-client-python) -[![PyPI](https://img.shields.io/pypi/v/retailcrm.svg?style=flat-square)](https://pypi.python.org/pypi/retailcrm) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/retailcrm.svg?style=flat-square)](https://pypi.python.org/pypi/retailcrm) +[![Build Status](https://img.shields.io/travis/retailcrm/api-client-python/master.svg)](https://travis-ci.org/retailcrm/api-client-python) +[![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/api-client-python/master.svg?logo=codecov&logoColor=white)](https://codecov.io/gh/retailcrm/api-client-python) +[![PyPI](https://img.shields.io/pypi/v/retailcrm.svg?logo=pypi&logoColor=white)](https://pypi.python.org/pypi/retailcrm) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/retailcrm.svg?logo=python&logoColor=white)](https://pypi.python.org/pypi/retailcrm) -retailCRM python API client +RetailCRM python API client =========================== -This is python retailCRM API client. This library allows to use all available API versions. +This is python RetailCRM API client. This library allows to use all available API versions. ## Install @@ -25,7 +25,7 @@ pip install retailcrm import retailcrm -client = retailcrm.v3('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') +client = retailcrm.v3('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') order = { 'firstName': 'John', @@ -46,7 +46,7 @@ result = client.order_create(order) import retailcrm -client = retailcrm.v4('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') +client = retailcrm.v4('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') result = client.customers_history(filter={'sinceId': '1500', 'startDate': '2018-03-01'}) @@ -61,7 +61,7 @@ print(result['pagination']['totalCount']) import retailcrm -client = retailcrm.v5('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') +client = retailcrm.v5('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc') site = 'example-com' task = { 'text': 'Product availability problem', @@ -74,8 +74,3 @@ task = { result = client.task_create(task, site) ``` - -## Documentation - -* [English](https://help.retailcrm.pro/Developers/Index) -* [Russian](https://help.retailcrm.ru/Developers/Index) diff --git a/retailcrm/versions/base.py b/retailcrm/versions/base.py index fa1d33c..09dbbeb 100644 --- a/retailcrm/versions/base.py +++ b/retailcrm/versions/base.py @@ -11,7 +11,7 @@ from retailcrm.response import Response class Base(object): - """retailCRM API client""" + """RetailCRM API client""" def __init__(self, crm_url, api_key, version): self.api_url = crm_url + '/api' diff --git a/retailcrm/versions/v3.py b/retailcrm/versions/v3.py index d248343..bb9ba3e 100644 --- a/retailcrm/versions/v3.py +++ b/retailcrm/versions/v3.py @@ -10,7 +10,7 @@ from retailcrm.versions.base import Base class Client(Base): - """retailCRM API client""" + """RetailCRM API client""" apiVersion = 'v3' diff --git a/retailcrm/versions/v4.py b/retailcrm/versions/v4.py index 6c357d7..d392dd3 100644 --- a/retailcrm/versions/v4.py +++ b/retailcrm/versions/v4.py @@ -10,7 +10,7 @@ from retailcrm.versions.base import Base class Client(Base): - """retailCRM API client""" + """RetailCRM API client""" apiVersion = 'v4' diff --git a/retailcrm/versions/v5.py b/retailcrm/versions/v5.py index 8819bcd..d3d76c5 100644 --- a/retailcrm/versions/v5.py +++ b/retailcrm/versions/v5.py @@ -10,7 +10,7 @@ from retailcrm.versions.base import Base class Client(Base): - """retailCRM API client""" + """RetailCRM API client""" apiVersion = 'v5' diff --git a/setup.py b/setup.py index 1aeb58e..a38d90a 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,11 @@ def read(filename): setup( name='retailcrm', version='5.1.0', - description='retailCRM API client', + description='RetailCRM API client', long_description=read('README'), url='https://github.com/retailcrm/api-client-python', - author='retailCRM', - author_email='integration@retailcrm.ru', + author='RetailCRM', + author_email='support@retailcrm.pro', keywords='crm saas rest e-commerce', license='MIT', packages=['retailcrm', 'retailcrm/versions'], diff --git a/tests/v3_tests.py b/tests/v3_tests.py index 70465a9..19d1b70 100644 --- a/tests/v3_tests.py +++ b/tests/v3_tests.py @@ -2,7 +2,7 @@ """ -retailCRM API client v3 tests +RetailCRM API client v3 tests """ from urllib.parse import urlencode @@ -124,7 +124,7 @@ class TestVersion3(unittest.TestCase): V3 Test wrong api url """ - (pook.get('https://epoqq.retailcrm.ru' + '/api/v3/statistic/update') + (pook.get('https://epoqq.retailcrm.pro' + '/api/v3/statistic/update') .headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')}) .reply(404) .headers(self.__header) @@ -136,7 +136,7 @@ class TestVersion3(unittest.TestCase): ) ) - client = retailcrm.v3('https://epoqq.retailcrm.ru', os.getenv('RETAILCRM_KEY')) + client = retailcrm.v3('https://epoqq.retailcrm.pro', os.getenv('RETAILCRM_KEY')) response = client.statistic_update() pook.off() @@ -1572,7 +1572,7 @@ class TestVersion3(unittest.TestCase): 'firstName': 'yyy', 'lastName': 'xxxx', 'patronymic': 's789', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7' }, 'customer': { @@ -1581,7 +1581,7 @@ class TestVersion3(unittest.TestCase): 'firstName': 'ccc', 'lastName': 's789', 'patronymic': 's789', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7', 'phones': [{'number': '+71111111111'}] }, diff --git a/tests/v4_tests.py b/tests/v4_tests.py index 96069ce..c055522 100644 --- a/tests/v4_tests.py +++ b/tests/v4_tests.py @@ -2,7 +2,7 @@ """ -retailCRM API client v4 tests +RetailCRM API client v4 tests """ from urllib.parse import urlencode @@ -120,7 +120,7 @@ class TestVersion4(unittest.TestCase): V4 Test wrong api url """ - (pook.get('https://epoqq.retailcrm.ru' + '/api/v4/statistic/update') + (pook.get('https://epoqq.retailcrm.pro' + '/api/v4/statistic/update') .headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')}) .reply(404) .headers(self.__header) @@ -132,7 +132,7 @@ class TestVersion4(unittest.TestCase): ) ) - client = retailcrm.v4('https://epoqq.retailcrm.ru', os.getenv('RETAILCRM_KEY')) + client = retailcrm.v4('https://epoqq.retailcrm.pro', os.getenv('RETAILCRM_KEY')) response = client.statistic_update() pook.off() @@ -1690,7 +1690,7 @@ class TestVersion4(unittest.TestCase): (pook.get(os.getenv('RETAILCRM_URL') + '/api/v4/store/inventories') .headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')}) - .params({'filter[site]': 'https://retailcrm.ru'}) + .params({'filter[site]': 'https://retailcrm.pro'}) .reply(200) .headers(self.__header) .json( @@ -1706,13 +1706,13 @@ class TestVersion4(unittest.TestCase): { 'id': 33937, 'externalId': 'werew', - 'site': 'https://retailcrm.ru', + 'site': 'https://retailcrm.pro', 'quantity': 102 }, { 'id': 33933, 'externalId': '46', - 'site': 'https://retailcrm.ru', + 'site': 'https://retailcrm.pro', 'quantity': 0 } ] @@ -1720,7 +1720,7 @@ class TestVersion4(unittest.TestCase): ) ) - response = self.client.inventories({'site': 'https://retailcrm.ru'}) + response = self.client.inventories({'site': 'https://retailcrm.pro'}) pook.off() self.assertTrue(response.is_successful(), True) @@ -1981,7 +1981,7 @@ class TestVersion4(unittest.TestCase): 'firstName': 'yyy', 'lastName': 'xxxx', 'patronymic': 'www', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7' }, 'customer': { @@ -1990,7 +1990,7 @@ class TestVersion4(unittest.TestCase): 'firstName': 'ccc', 'lastName': 'zzz', 'patronymic': 'sss', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7', 'phones': [{'number': '+71111111111'}] }, @@ -2027,7 +2027,7 @@ class TestVersion4(unittest.TestCase): { 'success': 'true', 'configuration': { - 'makeCallUrl': 'https://retailcrm.ru', + 'makeCallUrl': 'https://retailcrm.pro', 'allowEdit': 'false', 'inputEventSupported': 'false', 'outputEventSupported': 'false', @@ -2056,7 +2056,7 @@ class TestVersion4(unittest.TestCase): configuration = { 'code': 'www', 'clientId': '5604', - 'makeCallUrl': 'https://retailcrm.ru' + 'makeCallUrl': 'https://retailcrm.pro' } (pook.post(os.getenv('RETAILCRM_URL') + '/api/v4/telephony/setting/' + configuration['code'] + '/edit') @@ -2150,7 +2150,7 @@ class TestVersion4(unittest.TestCase): 'id': 777, 'createdAt': '2020-04-05 11:23:46', 'active': 'true', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'firstName': 'yyy', 'lastName': 'xxxx', 'status': 'free', @@ -2189,7 +2189,7 @@ class TestVersion4(unittest.TestCase): 'id': 777, 'createdAt': '2020-04-05 11:23:46', 'active': 'true', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'firstName': 'yyy', 'lastName': 'xxxx', 'status': 'free', diff --git a/tests/v5_tests.py b/tests/v5_tests.py index afdb5ab..f1c4f37 100644 --- a/tests/v5_tests.py +++ b/tests/v5_tests.py @@ -2,7 +2,7 @@ """ -retailCRM API client v5 tests +RetailCRM API client v5 tests """ from urllib.parse import urlencode @@ -202,7 +202,7 @@ class TestVersion5(unittest.TestCase): V5 Test wrong api url """ - (pook.get('https://epoqq.retailcrm.ru' + '/api/v5/statistic/update') + (pook.get('https://epoqq.retailcrm.pro' + '/api/v5/statistic/update') .headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')}) .reply(404) .headers(self.__header) @@ -214,7 +214,7 @@ class TestVersion5(unittest.TestCase): ) ) - client = retailcrm.v5('https://epoqq.retailcrm.ru', os.getenv('RETAILCRM_KEY')) + client = retailcrm.v5('https://epoqq.retailcrm.pro', os.getenv('RETAILCRM_KEY')) response = client.statistic_update() pook.off() @@ -4020,7 +4020,7 @@ class TestVersion5(unittest.TestCase): (pook.get(os.getenv('RETAILCRM_URL') + '/api/v5/store/inventories') .headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')}) - .params({'filter[site]': 'https://retailcrm.ru'}) + .params({'filter[site]': 'https://retailcrm.pro'}) .reply(200) .headers(self.__header) .json( @@ -4036,13 +4036,13 @@ class TestVersion5(unittest.TestCase): { 'id': 33937, 'externalId': '89387', - 'site': 'https://retailcrm.ru', + 'site': 'https://retailcrm.pro', 'quantity': 102 }, { 'id': 33933, 'externalId': '46', - 'site': 'https://retailcrm.ru', + 'site': 'https://retailcrm.pro', 'quantity': 0 } ] @@ -4050,7 +4050,7 @@ class TestVersion5(unittest.TestCase): ) ) - response = self.client.inventories({'site': 'https://retailcrm.ru'}) + response = self.client.inventories({'site': 'https://retailcrm.pro'}) pook.off() self.assertTrue(response.is_successful(), True) @@ -4477,7 +4477,7 @@ class TestVersion5(unittest.TestCase): 'firstName': 'John', 'lastName': 'Doe', 'patronymic': 'H.', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7' }, 'customer': { @@ -4486,7 +4486,7 @@ class TestVersion5(unittest.TestCase): 'firstName': 'John', 'lastName': 'Doe', 'patronymic': 'H.', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'code': 'ccc7', 'phones': [{'number': '+71111111111'}] }, @@ -4583,7 +4583,7 @@ class TestVersion5(unittest.TestCase): 'id': 777, 'createdAt': '2020-04-05 11:23:46', 'active': 'true', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'firstName': 'yyy', 'lastName': 'xxxx', 'status': 'free', @@ -4622,7 +4622,7 @@ class TestVersion5(unittest.TestCase): 'id': 777, 'createdAt': '2020-04-05 11:23:46', 'active': 'true', - 'email': 'mail@retailcrm.ru', + 'email': 'mail@retailcrm.pro', 'firstName': 'yyy', 'lastName': 'xxxx', 'status': 'free',