mirror of
https://github.com/retailcrm/api-client-python.git
synced 2025-04-05 14:13:35 +03:00
Compare commits
46 commits
Author | SHA1 | Date | |
---|---|---|---|
|
9429f1574c | ||
|
f17fbc6801 | ||
|
bd3998f823 | ||
|
d0a558a8fe | ||
|
1c36f3464b | ||
|
2c7061d8bf | ||
|
3582b077f4 | ||
|
bfdb4cc554 | ||
|
27ff0849ec | ||
|
c52f95e95f | ||
|
7c9a81d135 | ||
|
d420bdb0b3 | ||
|
e3e3de9e4b | ||
|
b488af91c7 | ||
|
963e779172 | ||
|
f5b7e315bb | ||
|
4d25347f95 | ||
|
12790245f9 | ||
|
41084fd4be | ||
|
30c135380c | ||
|
b85adb50ca | ||
|
8dc72b6c90 | ||
|
c198372abb | ||
|
ea22c7266a | ||
|
6e51a8cfc9 | ||
|
a1da7796c4 | ||
|
2d45f82287 | ||
|
d4bed324d3 | ||
|
d87c5b3986 | ||
|
cfb2bb80db | ||
|
a04e807f71 | ||
|
09c6a496e3 | ||
|
15d772079e | ||
|
f9d81948bf | ||
|
361d2cc537 | ||
|
cde242118b | ||
|
85aaec98a7 | ||
|
02c4a96087 | ||
|
857aba1f5c | ||
|
e233b97ed3 | ||
|
d96eadbc53 | ||
|
f9a10e59c5 | ||
|
69384fdcf3 | ||
|
5e154a2f02 | ||
|
4b73be0e1e | ||
|
fe262b267d |
18 changed files with 11645 additions and 670 deletions
67
.github/workflows/ci.yml
vendored
Normal file
67
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags-ignore:
|
||||
- '*.*'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
RETAILCRM_URL: https://test.retailcrm.pro
|
||||
RETAILCRM_KEY: key
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11']
|
||||
include:
|
||||
- python-version: '3.12'
|
||||
coverage: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
${{ runner.os }}-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=F401
|
||||
- name: Tests
|
||||
env:
|
||||
COVERAGE: ${{ matrix.coverage }}
|
||||
if: env.COVERAGE != 1
|
||||
run: python -m unittest tests/*.py
|
||||
- name: Tests with coverage
|
||||
env:
|
||||
COVERAGE: ${{ matrix.coverage }}
|
||||
if: env.COVERAGE == 1
|
||||
run: |
|
||||
coverage run -m unittest tests/*.py
|
||||
- name: Coverage
|
||||
env:
|
||||
COVERAGE: ${{ matrix.coverage }}
|
||||
if: env.COVERAGE == 1
|
||||
run: |
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
rm .coverage coverage.xml
|
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -1,4 +1,11 @@
|
|||
*.swp
|
||||
*.pyc
|
||||
*.nose*
|
||||
/*.egg-info
|
||||
/dist/
|
||||
/venv/
|
||||
/.vscode/
|
||||
/build/
|
||||
.python-version
|
||||
.coverage
|
||||
coverage.xml
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 RetailDriver LLC
|
||||
Copyright (c) 2015-2021 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
|
||||
|
|
70
README
Normal file
70
README
Normal file
|
@ -0,0 +1,70 @@
|
|||
RetailCRM python API client
|
||||
===========================
|
||||
|
||||
This is python RetailCRM API client. This library allows to use all
|
||||
available API versions.
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
::
|
||||
|
||||
pip3 install retailcrm
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
|
||||
.. code:: python
|
||||
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.v3('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
|
||||
order = {
|
||||
'firstName': 'John',
|
||||
'lastName': 'Doe',
|
||||
'phone': '+79000000000',
|
||||
'email': 'john@example.com',
|
||||
'orderMethod': 'call-request',
|
||||
}
|
||||
|
||||
result = client.order_create(order)
|
||||
|
||||
|
||||
.. code:: python
|
||||
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.v4('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
|
||||
result = client.customers_history(filter={'sinceId': '1500', 'startDate': '2018-03-01'})
|
||||
|
||||
print(result['pagination']['totalCount'])
|
||||
|
||||
|
||||
.. code:: python
|
||||
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.v5('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
site = 'example-com'
|
||||
task = {
|
||||
'text': 'Product availability problem',
|
||||
'commentary': 'Take a look ASAP',
|
||||
'order': {
|
||||
'externalId': '100500'
|
||||
},
|
||||
'performerId': 1
|
||||
}
|
||||
|
||||
result = client.task_create(task, site)
|
67
README.md
67
README.md
|
@ -1,31 +1,76 @@
|
|||
retailCRM API python client
|
||||
[](https://github.com/retailcrm/api-client-python/actions)
|
||||
[](https://codecov.io/gh/retailcrm/api-client-python)
|
||||
[](https://pypi.python.org/pypi/retailcrm)
|
||||
[](https://pypi.python.org/pypi/retailcrm)
|
||||
|
||||
|
||||
RetailCRM python API client
|
||||
===========================
|
||||
|
||||
### Install
|
||||
This is Python RetailCRM API client. This library allows to use all available API versions.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
pip install retailcrm
|
||||
pip3 install retailcrm
|
||||
```
|
||||
|
||||
### Usage
|
||||
## Usage
|
||||
|
||||
#### API version 3 order create
|
||||
|
||||
```python
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.Client('https://demo.intarocrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
client = retailcrm.v3('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
|
||||
order = {
|
||||
'firstName': 'Ivan',
|
||||
'lastName': 'Ivanov',
|
||||
'firstName': 'John',
|
||||
'lastName': 'Doe',
|
||||
'phone': '+79000000000',
|
||||
'email': 'ivan@example.com',
|
||||
'email': 'john@example.com',
|
||||
'orderMethod': 'call-request',
|
||||
}
|
||||
|
||||
result = crm.orders_create(order)
|
||||
result = client.order_create(order)
|
||||
```
|
||||
|
||||
### Documentation
|
||||
#### API version 4 customers history
|
||||
|
||||
* http://www.retailcrm.pro/docs/Developers/ApiVersion3
|
||||
```python
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.v4('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
|
||||
result = client.customers_history(filters={'sinceId': '1500', 'startDate': '2018-03-01'})
|
||||
|
||||
print(result['pagination']['totalCount'])
|
||||
```
|
||||
|
||||
#### API version 5 task create
|
||||
|
||||
```python
|
||||
# coding utf-8
|
||||
|
||||
import retailcrm
|
||||
|
||||
|
||||
client = retailcrm.v5('https://demo.retailcrm.pro', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')
|
||||
site = 'example-com'
|
||||
task = {
|
||||
'text': 'Product availability problem',
|
||||
'commentary': 'Take a look ASAP',
|
||||
'order': {
|
||||
'externalId': '100500'
|
||||
},
|
||||
'performerId': 1
|
||||
}
|
||||
|
||||
result = client.task_create(task, site)
|
||||
```
|
||||
|
|
6
requirements.txt
Normal file
6
requirements.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
multidimensional-urlencode==0.0.4
|
||||
nose==1.3.7
|
||||
requests==2.32.1
|
||||
coverage==4.5.4
|
||||
pook==1.3.0
|
||||
setuptools==70.0.0
|
|
@ -1,2 +1,9 @@
|
|||
from client import Client
|
||||
from response import Response
|
||||
# coding=utf-8
|
||||
|
||||
"""
|
||||
Init
|
||||
"""
|
||||
|
||||
from retailcrm.versions.v3 import Client as v3
|
||||
from retailcrm.versions.v4 import Client as v4
|
||||
from retailcrm.versions.v5 import Client as v5
|
||||
|
|
|
@ -1,642 +0,0 @@
|
|||
# coding=utf-8
|
||||
import requests
|
||||
import json
|
||||
from response import Response
|
||||
|
||||
|
||||
class Client(object):
|
||||
"""retailCRM API client"""
|
||||
|
||||
apiVersion = '3'
|
||||
|
||||
def __init__(self, crm_url, api_key):
|
||||
self.apiUrl = crm_url + '/api/v' + self.apiVersion + '/'
|
||||
self.apiKey = api_key
|
||||
self.parameters = {'apiKey': api_key}
|
||||
|
||||
def make_request(self, url, method='GET'):
|
||||
"""
|
||||
:param url: string
|
||||
:param method: string
|
||||
:return: Response
|
||||
"""
|
||||
global result
|
||||
if method == 'GET':
|
||||
result = requests.get(url, params=self.parameters)
|
||||
elif method == 'POST':
|
||||
result = requests.post(url, data=self.parameters)
|
||||
|
||||
response_code = result.status_code
|
||||
response_body = result.json()
|
||||
|
||||
return Response(response_code, response_body)
|
||||
|
||||
def orders(self, filters, limit=20, page=1):
|
||||
"""
|
||||
:param filters: array
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
url = self.apiUrl + 'orders'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def orders_get(self, uid, by='externalId', site=None):
|
||||
"""
|
||||
:param uid: string
|
||||
:param by: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
url = self.apiUrl + 'orders/' + str(uid)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
if by != 'externalId':
|
||||
self.parameters['by'] = by
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def orders_create(self, order, site=None):
|
||||
"""
|
||||
|
||||
:param order:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(order)
|
||||
self.parameters['order'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'orders/create'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def orders_edit(self, order, site=None):
|
||||
"""
|
||||
|
||||
:param order:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(order)
|
||||
self.parameters['order'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'orders/' + str(order['externalId']) + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def orders_upload(self, orders, site=None):
|
||||
"""
|
||||
|
||||
:param orders:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(orders)
|
||||
self.parameters['orders'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'orders/upload'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def orders_fix_external_ids(self, orders, site=None):
|
||||
"""
|
||||
|
||||
:param orders:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(orders)
|
||||
self.parameters['orders'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'orders/fix-external-ids'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def orders_statuses(self, ids, external_ids):
|
||||
"""
|
||||
|
||||
:param ids:
|
||||
:param external_ids:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['ids'] = ids
|
||||
self.parameters['externalIds'] = external_ids
|
||||
url = self.apiUrl + 'orders/statuses'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def orders_history(self, start_date=None, end_date=None, limit=100, offset=0, skip_my_changes=True):
|
||||
"""
|
||||
|
||||
:param start_date:
|
||||
:param end_date:
|
||||
:param limit:
|
||||
:param offset:
|
||||
:param skip_my_changes:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['startDate'] = start_date
|
||||
self.parameters['endDate'] = end_date
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['offset'] = offset
|
||||
self.parameters['skipMyChanges'] = skip_my_changes
|
||||
url = self.apiUrl + 'orders/history'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def customers(self, filters, limit=20, page=0):
|
||||
"""
|
||||
|
||||
:param filters:
|
||||
:param limit:
|
||||
:param page:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
url = self.apiUrl + 'customers'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def customers_get(self, uid, by='externalId', site=None):
|
||||
"""
|
||||
|
||||
:param uid:
|
||||
:param by:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'customers/' + str(uid)
|
||||
|
||||
if by != 'externalId':
|
||||
self.parameters['by'] = by
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def customers_create(self, customer, site=None):
|
||||
"""
|
||||
|
||||
:param customer:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(customer)
|
||||
self.parameters['customer'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'customers/create'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def customers_edit(self, customer, site=None):
|
||||
"""
|
||||
|
||||
:param customer:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(customer)
|
||||
self.parameters['customer'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'customers/' + customer['externalId'] + '/edit'
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def customers_upload(self, customers, site=None):
|
||||
"""
|
||||
|
||||
:param customers:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(customers)
|
||||
self.parameters['customers'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'customers/upload'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def customers_fix_external_ids(self, customers, site=None):
|
||||
"""
|
||||
|
||||
:param customers:
|
||||
:param site:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(customers)
|
||||
self.parameters['customers'] = data_json
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
url = self.apiUrl + 'customers/fix-external-ids'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def inventories(self, filters, limit=20, page=1):
|
||||
"""
|
||||
|
||||
:param filters:
|
||||
:param limit:
|
||||
:param page:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
url = self.apiUrl + 'store/inventories'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def inventories_upload(self, offers):
|
||||
"""
|
||||
|
||||
:param offers:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(offers)
|
||||
self.parameters['offers'] = data_json
|
||||
url = self.apiUrl + 'store/inventories/upload'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def packs(self, filters, limit=20, page=1):
|
||||
"""
|
||||
|
||||
:param filters:
|
||||
:param limit:
|
||||
:param page:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
url = self.apiUrl + 'orders/packs'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def packs_get(self, uid):
|
||||
"""
|
||||
|
||||
:param uid:
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'orders/packs/' + str(uid)
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def packs_create(self, pack):
|
||||
"""
|
||||
|
||||
:param pack:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(pack)
|
||||
self.parameters['pack'] = data_json
|
||||
url = self.apiUrl + 'orders/packs/create'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def packs_edit(self, pack, uid):
|
||||
"""
|
||||
|
||||
:param pack:
|
||||
:param uid:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(pack)
|
||||
self.parameters['pack'] = data_json
|
||||
url = self.apiUrl + 'orders/packs/' + str(uid) + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def packs_delete(self, uid):
|
||||
"""
|
||||
|
||||
:param uid:
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'orders/packs/' + str(uid) + '/delete'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def packs_history(self, filters, limit=20, page=1):
|
||||
"""
|
||||
|
||||
:param filters:
|
||||
:param limit:
|
||||
:param page:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
url = self.apiUrl + 'orders/packs/history'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def countries(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/countries'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def delivery_types(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/delivery-types'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def delivery_types_edit(self, delivery_type):
|
||||
"""
|
||||
|
||||
:param delivery_type:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(delivery_type)
|
||||
self.parameters['deliveryType'] = data_json
|
||||
url = self.apiUrl + 'reference/delivery-types/' + delivery_type['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def delivery_services(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/delivery-services'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def delivery_services_edit(self, delivery_service):
|
||||
"""
|
||||
|
||||
:param delivery_service:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(delivery_service)
|
||||
self.parameters['deliveryService'] = data_json
|
||||
url = self.apiUrl + 'reference/delivery-services/' + delivery_service['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def payment_types(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/payment-types'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def payment_types_edit(self, payment_type):
|
||||
"""
|
||||
|
||||
:param payment_type:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(payment_type)
|
||||
self.parameters['paymentType'] = data_json
|
||||
url = self.apiUrl + 'reference/payment-types/' + payment_type['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def payment_statuses(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/payment-statuses'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def payment_statuses_edit(self, payment_status):
|
||||
"""
|
||||
|
||||
:param payment_status:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(payment_status)
|
||||
self.parameters['paymentStatus'] = data_json
|
||||
url = self.apiUrl + 'reference/payment-statuses/' + payment_status['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def product_statuses(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/product-statuses'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def product_statuses_edit(self, product_status):
|
||||
"""
|
||||
|
||||
:param product_status:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(product_status)
|
||||
self.parameters['productStatus'] = data_json
|
||||
url = self.apiUrl + 'reference/product-statuses/' + product_status['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def order_types(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/order-types'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def order_types_edit(self, order_type):
|
||||
"""
|
||||
|
||||
:param order_type:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(order_type)
|
||||
self.parameters['orderType'] = data_json
|
||||
url = self.apiUrl + 'reference/order-types/' + order_type['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def order_methods(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/order-methods'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def order_methods_edit(self, order_method):
|
||||
"""
|
||||
|
||||
:param order_method:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(order_method)
|
||||
self.parameters['orderMethod'] = data_json
|
||||
url = self.apiUrl + 'reference/order-methods/' + order_method['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def status_groups(self):
|
||||
"""
|
||||
:return
|
||||
"""
|
||||
url = self.apiUrl + 'reference/status-groups'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def statuses(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/statuses'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def statuses_edit(self, status):
|
||||
"""
|
||||
|
||||
:param status:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(status)
|
||||
self.parameters['status'] = data_json
|
||||
url = self.apiUrl + 'reference/statuses/' + status['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def stores(self):
|
||||
"""
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = self.apiUrl + 'reference/stores'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def stores_edit(self, store):
|
||||
"""
|
||||
|
||||
:param store:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(store)
|
||||
self.parameters['status'] = data_json
|
||||
url = self.apiUrl + 'reference/stores/' + store['code'] + '/edit'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def statistic_update(self):
|
||||
"""
|
||||
:return
|
||||
"""
|
||||
url = self.apiUrl + 'statistic/update'
|
||||
|
||||
return self.make_request(url)
|
||||
|
||||
def telephony_call_event(self, phone, call_type, code, status):
|
||||
"""
|
||||
|
||||
:param phone:
|
||||
:param call_type:
|
||||
:param code:
|
||||
:param status:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['hangupStatus'] = status
|
||||
self.parameters['phone'] = phone
|
||||
self.parameters['code'] = code
|
||||
self.parameters['type'] = call_type
|
||||
url = self.apiUrl + 'telephony/call/event'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def telephony_calls_upload(self, calls):
|
||||
"""
|
||||
|
||||
:param calls:
|
||||
:return:
|
||||
"""
|
||||
data_json = json.dumps(calls)
|
||||
self.parameters['calls'] = data_json
|
||||
url = self.apiUrl + 'telephony/calls/upload'
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def telephony_settings(self, code, client_id, make_call_url, active, name, image):
|
||||
"""
|
||||
|
||||
:param code:
|
||||
:param client_id:
|
||||
:param make_call_url:
|
||||
:param active:
|
||||
:param name:
|
||||
:param image:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['code'] = code
|
||||
self.parameters['clientId'] = client_id
|
||||
self.parameters['makeCallUrl'] = make_call_url
|
||||
self.parameters['active'] = active
|
||||
self.parameters['name'] = name
|
||||
self.parameters['image'] = image
|
||||
url = self.apiUrl + 'telephony/settings/' + str(code)
|
||||
|
||||
return self.make_request(url, 'POST')
|
||||
|
||||
def telephony_manager(self, phone, details=True):
|
||||
"""
|
||||
|
||||
:param phone:
|
||||
:param details:
|
||||
:return:
|
||||
"""
|
||||
self.parameters['phone'] = phone
|
||||
self.parameters['details'] = details
|
||||
url = self.apiUrl + 'telephony/manager'
|
||||
|
||||
return self.make_request(url)
|
|
@ -1,5 +1,9 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
Response class
|
||||
"""
|
||||
|
||||
|
||||
class Response(object):
|
||||
"""
|
||||
|
@ -7,23 +11,38 @@ class Response(object):
|
|||
"""
|
||||
|
||||
def __init__(self, code, body):
|
||||
self.response_body = body
|
||||
self.status_code = code
|
||||
self.__status_code = code
|
||||
self.__response_body = body
|
||||
|
||||
def get_status_code(self):
|
||||
"""
|
||||
:return: integer
|
||||
"""
|
||||
return self.status_code
|
||||
return self.__status_code
|
||||
|
||||
def get_response(self):
|
||||
"""
|
||||
:return: dict
|
||||
:return: string
|
||||
"""
|
||||
return self.response_body
|
||||
return self.__response_body
|
||||
|
||||
def is_successfull(self):
|
||||
def is_successful(self):
|
||||
"""
|
||||
:return: boolean
|
||||
"""
|
||||
return int(self.status_code) < 400
|
||||
return int(self.__status_code) < 400
|
||||
|
||||
def get_error_msg(self):
|
||||
"""
|
||||
:return: string
|
||||
"""
|
||||
return self.__response_body['errorMsg']
|
||||
|
||||
def get_errors(self):
|
||||
"""
|
||||
:return: collection
|
||||
"""
|
||||
|
||||
errors = self.__response_body.get('errors', {})
|
||||
|
||||
return errors
|
||||
|
|
5
retailcrm/versions/__init__.py
Normal file
5
retailcrm/versions/__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
Init
|
||||
"""
|
66
retailcrm/versions/base.py
Normal file
66
retailcrm/versions/base.py
Normal file
|
@ -0,0 +1,66 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
API Client base class
|
||||
"""
|
||||
|
||||
import requests
|
||||
|
||||
from multidimensional_urlencode import urlencode as query_builder
|
||||
from retailcrm.response import Response
|
||||
|
||||
|
||||
class Base(object):
|
||||
"""RetailCRM API client"""
|
||||
|
||||
def __init__(self, crm_url, api_key, version):
|
||||
self.api_url = crm_url + '/api'
|
||||
self.api_key = api_key
|
||||
self.api_version = version
|
||||
self.parameters = {}
|
||||
|
||||
def get(self, url, version=True):
|
||||
"""
|
||||
Get request
|
||||
:param url: string
|
||||
:param version: boolean
|
||||
:return: Response
|
||||
"""
|
||||
base_url = self.api_url + '/' + self.api_version if version else self.api_url
|
||||
requests_url = base_url + url if not self.parameters else base_url + url + "?" + query_builder(self.parameters)
|
||||
response = requests.get(requests_url, headers={
|
||||
'X-API-KEY': self.api_key})
|
||||
self.parameters = {}
|
||||
|
||||
return Response(response.status_code, response.json())
|
||||
|
||||
def post(self, url, version=True):
|
||||
"""
|
||||
Post request
|
||||
:return: Response
|
||||
"""
|
||||
base_url = self.api_url + '/' + self.api_version if version else self.api_url
|
||||
requests_url = base_url + url
|
||||
response = requests.post(requests_url, data=self.parameters, headers={
|
||||
'X-API-KEY': self.api_key})
|
||||
self.parameters = {}
|
||||
|
||||
return Response(response.status_code, response.json())
|
||||
|
||||
def api_versions(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
return self.get('/api-versions', False)
|
||||
|
||||
def api_credentials(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
return self.get('/credentials', False)
|
||||
|
||||
def statistic_update(self):
|
||||
"""
|
||||
:return Response
|
||||
"""
|
||||
return self.get('/statistic/update')
|
536
retailcrm/versions/v3.py
Normal file
536
retailcrm/versions/v3.py
Normal file
|
@ -0,0 +1,536 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
API Client version 3
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
from retailcrm.versions.base import Base
|
||||
|
||||
|
||||
class Client(Base):
|
||||
"""RetailCRM API client"""
|
||||
|
||||
apiVersion = 'v3'
|
||||
|
||||
def __init__(self, crm_url, api_key):
|
||||
Base.__init__(self, crm_url, api_key, self.apiVersion)
|
||||
|
||||
def customers(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/customers')
|
||||
|
||||
def customer_create(self, customer, site=None):
|
||||
"""
|
||||
:param customer: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customer'] = json.dumps(customer)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/create')
|
||||
|
||||
def customers_fix_external_ids(self, customers, site=None):
|
||||
"""
|
||||
:param customers: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customers'] = json.dumps(customers)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/fix-external-ids')
|
||||
|
||||
def customers_upload(self, customers, site=None):
|
||||
"""
|
||||
:param customers: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customers'] = json.dumps(customers)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/upload')
|
||||
|
||||
def customer(self, uid, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param uid: string
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.get('/customers/' + str(uid))
|
||||
|
||||
def customer_edit(self, customer, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param customer: object
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customer'] = json.dumps(customer)
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/' + customer[uid_type] + '/edit')
|
||||
|
||||
def orders(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders')
|
||||
|
||||
def order_create(self, order, site=None):
|
||||
"""
|
||||
:param order: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['order'] = json.dumps(order)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/create')
|
||||
|
||||
def orders_fix_external_ids(self, orders, site=None):
|
||||
"""
|
||||
:param orders: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orders'] = json.dumps(orders)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/fix-external-ids')
|
||||
|
||||
def orders_history(self, start=None, end=None, limit=100, offset=0, skip=True):
|
||||
"""
|
||||
:param start: DateTime
|
||||
:param end: DateTime
|
||||
:param limit: integer
|
||||
:param offset: integer
|
||||
:param skip: boolean
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['startDate'] = start
|
||||
self.parameters['endDate'] = end
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['offset'] = offset
|
||||
self.parameters['skipMyChanges'] = skip
|
||||
|
||||
return self.get('/orders/history')
|
||||
|
||||
def orders_statuses(self, ids, external_ids):
|
||||
"""
|
||||
:param ids: array
|
||||
:param external_ids: array
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['ids'] = ids
|
||||
self.parameters['externalIds'] = external_ids
|
||||
|
||||
return self.get('/orders/statuses')
|
||||
|
||||
def orders_upload(self, orders, site=None):
|
||||
"""
|
||||
:param orders: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orders'] = json.dumps(orders)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/upload')
|
||||
|
||||
def order(self, uid, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param uid: string
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
return self.get('/orders/' + str(uid))
|
||||
|
||||
def order_edit(self, order, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param order: object
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['order'] = json.dumps(order)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
return self.post('/orders/' + str(order[uid_type]) + '/edit')
|
||||
|
||||
def packs(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders/packs')
|
||||
|
||||
def pack_create(self, pack):
|
||||
"""
|
||||
:param pack: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['pack'] = json.dumps(pack)
|
||||
|
||||
return self.post('/orders/packs/create')
|
||||
|
||||
def packs_history(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders/packs/history')
|
||||
|
||||
def pack(self, uid):
|
||||
"""
|
||||
:param uid: integer
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/orders/packs/' + str(uid))
|
||||
|
||||
def pack_delete(self, uid):
|
||||
"""
|
||||
:param uid: integer
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.post('/orders/packs/' + str(uid) + '/delete')
|
||||
|
||||
def pack_edit(self, pack):
|
||||
"""
|
||||
:param pack: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['pack'] = json.dumps(pack)
|
||||
|
||||
return self.post('/orders/packs/' + str(pack['id']) + '/edit')
|
||||
|
||||
def countries(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/countries')
|
||||
|
||||
def delivery_services(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/delivery-services')
|
||||
|
||||
def delivery_services_edit(self, delivery_service):
|
||||
"""
|
||||
:param delivery_service: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['deliveryService'] = json.dumps(delivery_service)
|
||||
|
||||
return self.post('/reference/delivery-services/' + delivery_service['code'] + '/edit')
|
||||
|
||||
def delivery_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/delivery-types')
|
||||
|
||||
def delivery_types_edit(self, delivery_type):
|
||||
"""
|
||||
:param delivery_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['deliveryType'] = json.dumps(delivery_type)
|
||||
|
||||
return self.post('/reference/delivery-types/' + delivery_type['code'] + '/edit')
|
||||
|
||||
def order_methods(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/order-methods')
|
||||
|
||||
def order_methods_edit(self, order_method):
|
||||
"""
|
||||
|
||||
:param order_method: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orderMethod'] = json.dumps(order_method)
|
||||
|
||||
return self.post('/reference/order-methods/' + order_method['code'] + '/edit')
|
||||
|
||||
def order_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/order-types')
|
||||
|
||||
def order_types_edit(self, order_type):
|
||||
"""
|
||||
:param order_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orderType'] = json.dumps(order_type)
|
||||
|
||||
return self.post('/reference/order-types/' + order_type['code'] + '/edit')
|
||||
|
||||
def payment_statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/payment-statuses')
|
||||
|
||||
def payment_statuses_edit(self, payment_status):
|
||||
"""
|
||||
:param payment_status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['paymentStatus'] = json.dumps(payment_status)
|
||||
|
||||
return self.post('/reference/payment-statuses/' + payment_status['code'] + '/edit')
|
||||
|
||||
def payment_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/payment-types')
|
||||
|
||||
def payment_types_edit(self, payment_type):
|
||||
"""
|
||||
:param payment_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['paymentType'] = json.dumps(payment_type)
|
||||
|
||||
return self.post('/reference/payment-types/' + payment_type['code'] + '/edit')
|
||||
|
||||
def product_statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/product-statuses')
|
||||
|
||||
def product_statuses_edit(self, product_status):
|
||||
"""
|
||||
:param product_status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['productStatus'] = json.dumps(product_status)
|
||||
|
||||
return self.post('/reference/product-statuses/' + product_status['code'] + '/edit')
|
||||
|
||||
def sites(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/sites')
|
||||
|
||||
def sites_edit(self, site):
|
||||
"""
|
||||
:param site: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['site'] = json.dumps(site)
|
||||
|
||||
return self.post('/reference/sites/' + site['code'] + '/edit')
|
||||
|
||||
def status_groups(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/status-groups')
|
||||
|
||||
def statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/statuses')
|
||||
|
||||
def statuses_edit(self, status):
|
||||
"""
|
||||
:param status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['status'] = json.dumps(status)
|
||||
|
||||
return self.post('/reference/statuses/' + status['code'] + '/edit')
|
||||
|
||||
def stores(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/stores')
|
||||
|
||||
def stores_edit(self, store):
|
||||
"""
|
||||
:param store: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['store'] = json.dumps(store)
|
||||
|
||||
return self.post('/reference/stores/' + store['code'] + '/edit')
|
||||
|
||||
def inventories(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/store/inventories')
|
||||
|
||||
def inventories_upload(self, offers, site=None):
|
||||
"""
|
||||
:param offers: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
self.parameters['offers'] = json.dumps(offers)
|
||||
|
||||
return self.post('/store/inventories/upload')
|
||||
|
||||
def telephony_call_event(self, phone, call_type, code, status):
|
||||
"""
|
||||
:param phone: string
|
||||
:param call_type: string
|
||||
:param code: string
|
||||
:param status: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['hangupStatus'] = status
|
||||
self.parameters['phone'] = phone
|
||||
self.parameters['code'] = code
|
||||
self.parameters['type'] = call_type
|
||||
|
||||
return self.post('/telephony/call/event')
|
||||
|
||||
def telephony_calls_upload(self, calls):
|
||||
"""
|
||||
:param calls: array of objects
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['calls'] = json.dumps(calls)
|
||||
|
||||
return self.post('/telephony/calls/upload')
|
||||
|
||||
def telephony_manager(self, phone, details=True):
|
||||
"""
|
||||
:param phone: string
|
||||
:param details: string
|
||||
:return: Response string
|
||||
"""
|
||||
self.parameters['phone'] = phone
|
||||
self.parameters['details'] = details
|
||||
|
||||
return self.get('/telephony/manager')
|
||||
|
||||
def telephony_settings(self, code, client_id, make_call_url, active, name, image):
|
||||
"""
|
||||
:param code: string
|
||||
:param client_id: string
|
||||
:param make_call_url: string
|
||||
:param active: string
|
||||
:param name: string
|
||||
:param image: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['code'] = code
|
||||
self.parameters['clientId'] = client_id
|
||||
self.parameters['makeCallUrl'] = make_call_url
|
||||
self.parameters['active'] = active
|
||||
self.parameters['name'] = name
|
||||
self.parameters['image'] = image
|
||||
|
||||
return self.post('/telephony/settings/' + str(code))
|
||||
|
||||
def statistic_update(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/statistic/update')
|
662
retailcrm/versions/v4.py
Normal file
662
retailcrm/versions/v4.py
Normal file
|
@ -0,0 +1,662 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
API Client version 4
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
from retailcrm.versions.base import Base
|
||||
|
||||
|
||||
class Client(Base):
|
||||
"""RetailCRM API client"""
|
||||
|
||||
apiVersion = 'v4'
|
||||
|
||||
def __init__(self, crm_url, api_key):
|
||||
Base.__init__(self, crm_url, api_key, self.apiVersion)
|
||||
|
||||
def customers(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/customers')
|
||||
|
||||
def customer_create(self, customer, site=None):
|
||||
"""
|
||||
:param customer: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customer'] = json.dumps(customer)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/create')
|
||||
|
||||
def customers_fix_external_ids(self, customers, site=None):
|
||||
"""
|
||||
:param customers: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customers'] = json.dumps(customers)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/fix-external-ids')
|
||||
|
||||
def customers_history(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/customers/history')
|
||||
|
||||
def customers_upload(self, customers, site=None):
|
||||
"""
|
||||
:param customers: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customers'] = json.dumps(customers)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/upload')
|
||||
|
||||
def customer(self, uid, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param uid: string
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.get('/customers/' + str(uid))
|
||||
|
||||
def customer_edit(self, customer, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param customer: object
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['customer'] = json.dumps(customer)
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/customers/' + customer[uid_type] + '/edit')
|
||||
|
||||
def delivery_setting(self, code):
|
||||
"""
|
||||
:param code: string
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/delivery/generic/setting/' + str(code))
|
||||
|
||||
def delivery_setting_edit(self, configuration):
|
||||
"""
|
||||
:param configuration: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['configuration'] = json.dumps(configuration)
|
||||
|
||||
return self.post('/delivery/generic/setting/' + str(configuration['code']) + '/edit')
|
||||
|
||||
def delivery_tracking(self, code, status_update):
|
||||
"""
|
||||
:param code: string
|
||||
:param status_update: array of objects
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['statusUpdate'] = json.dumps(status_update)
|
||||
|
||||
return self.post('/delivery/generic/' + str(code) + '/tracking')
|
||||
|
||||
def marketplace_setting_edit(self, configuration):
|
||||
"""
|
||||
:param configuration: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['configuration'] = json.dumps(configuration)
|
||||
|
||||
return self.post('/marketplace/external/setting/' + str(configuration['code']) + '/edit')
|
||||
|
||||
def orders(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders')
|
||||
|
||||
def order_create(self, order, site=None):
|
||||
"""
|
||||
:param order: object
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['order'] = json.dumps(order)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/create')
|
||||
|
||||
def orders_fix_external_ids(self, orders, site=None):
|
||||
"""
|
||||
:param orders: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orders'] = json.dumps(orders)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/fix-external-ids')
|
||||
|
||||
def orders_history(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders/history')
|
||||
|
||||
def orders_statuses(self, ids, external_ids):
|
||||
"""
|
||||
:param ids: array
|
||||
:param external_ids: array
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['ids'] = ids
|
||||
self.parameters['externalIds'] = external_ids
|
||||
|
||||
return self.get('/orders/statuses')
|
||||
|
||||
def orders_upload(self, orders, site=None):
|
||||
"""
|
||||
:param orders: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orders'] = json.dumps(orders)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
return self.post('/orders/upload')
|
||||
|
||||
def order(self, uid, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param uid: string
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
return self.get('/orders/' + str(uid))
|
||||
|
||||
def order_edit(self, order, uid_type='externalId', site=None):
|
||||
"""
|
||||
:param order: object
|
||||
:param uid_type: string
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['order'] = json.dumps(order)
|
||||
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
if uid_type != 'externalId':
|
||||
self.parameters['by'] = uid_type
|
||||
|
||||
return self.post('/orders/' + str(order[uid_type]) + '/edit')
|
||||
|
||||
def packs(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders/packs')
|
||||
|
||||
def pack_create(self, pack):
|
||||
"""
|
||||
:param pack: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['pack'] = json.dumps(pack)
|
||||
|
||||
return self.post('/orders/packs/create')
|
||||
|
||||
def packs_history(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/orders/packs/history')
|
||||
|
||||
def pack(self, uid):
|
||||
"""
|
||||
:param uid: integer
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/orders/packs/' + str(uid))
|
||||
|
||||
def pack_delete(self, uid):
|
||||
"""
|
||||
:param uid: integer
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.post('/orders/packs/' + str(uid) + '/delete')
|
||||
|
||||
def pack_edit(self, pack):
|
||||
"""
|
||||
:param pack: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['pack'] = json.dumps(pack)
|
||||
|
||||
return self.post('/orders/packs/' + str(pack['id']) + '/edit')
|
||||
|
||||
def countries(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/countries')
|
||||
|
||||
def delivery_services(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/delivery-services')
|
||||
|
||||
def delivery_services_edit(self, delivery_service):
|
||||
"""
|
||||
:param delivery_service: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['deliveryService'] = json.dumps(delivery_service)
|
||||
|
||||
return self.post('/reference/delivery-services/' + delivery_service['code'] + '/edit')
|
||||
|
||||
def delivery_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/delivery-types')
|
||||
|
||||
def delivery_types_edit(self, delivery_type):
|
||||
"""
|
||||
:param delivery_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['deliveryType'] = json.dumps(delivery_type)
|
||||
|
||||
return self.post('/reference/delivery-types/' + delivery_type['code'] + '/edit')
|
||||
|
||||
def order_methods(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/order-methods')
|
||||
|
||||
def order_methods_edit(self, order_method):
|
||||
"""
|
||||
|
||||
:param order_method: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orderMethod'] = json.dumps(order_method)
|
||||
|
||||
return self.post('/reference/order-methods/' + order_method['code'] + '/edit')
|
||||
|
||||
def order_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/order-types')
|
||||
|
||||
def order_types_edit(self, order_type):
|
||||
"""
|
||||
:param order_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['orderType'] = json.dumps(order_type)
|
||||
|
||||
return self.post('/reference/order-types/' + order_type['code'] + '/edit')
|
||||
|
||||
def payment_statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/payment-statuses')
|
||||
|
||||
def payment_statuses_edit(self, payment_status):
|
||||
"""
|
||||
:param payment_status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['paymentStatus'] = json.dumps(payment_status)
|
||||
|
||||
return self.post('/reference/payment-statuses/' + payment_status['code'] + '/edit')
|
||||
|
||||
def payment_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/payment-types')
|
||||
|
||||
def payment_types_edit(self, payment_type):
|
||||
"""
|
||||
:param payment_type:
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['paymentType'] = json.dumps(payment_type)
|
||||
|
||||
return self.post('/reference/payment-types/' + payment_type['code'] + '/edit')
|
||||
|
||||
def price_types(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/price-types')
|
||||
|
||||
def price_types_edit(self, price_type):
|
||||
"""
|
||||
:param price_type: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['priceType'] = json.dumps(price_type)
|
||||
|
||||
return self.post('/reference/price-types/' + price_type['code'] + '/edit')
|
||||
|
||||
def product_statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/product-statuses')
|
||||
|
||||
def product_statuses_edit(self, product_status):
|
||||
"""
|
||||
:param product_status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['productStatus'] = json.dumps(product_status)
|
||||
|
||||
return self.post('/reference/product-statuses/' + product_status['code'] + '/edit')
|
||||
|
||||
def sites(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/sites')
|
||||
|
||||
def sites_edit(self, site):
|
||||
"""
|
||||
:param site: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['site'] = json.dumps(site)
|
||||
|
||||
return self.post('/reference/sites/' + site['code'] + '/edit')
|
||||
|
||||
def status_groups(self):
|
||||
"""
|
||||
:return
|
||||
"""
|
||||
|
||||
return self.get('/reference/status-groups')
|
||||
|
||||
def statuses(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/statuses')
|
||||
|
||||
def statuses_edit(self, status):
|
||||
"""
|
||||
:param status: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['status'] = json.dumps(status)
|
||||
|
||||
return self.post('/reference/statuses/' + status['code'] + '/edit')
|
||||
|
||||
def stores(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/reference/stores')
|
||||
|
||||
def stores_edit(self, store):
|
||||
"""
|
||||
:param store: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['store'] = json.dumps(store)
|
||||
|
||||
return self.post('/reference/stores/' + store['code'] + '/edit')
|
||||
|
||||
def inventories(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/store/inventories')
|
||||
|
||||
def inventories_upload(self, offers, site=None):
|
||||
"""
|
||||
:param offers: array of objects
|
||||
:param site: string
|
||||
:return: Response
|
||||
"""
|
||||
if site is not None:
|
||||
self.parameters['site'] = site
|
||||
|
||||
self.parameters['offers'] = json.dumps(offers)
|
||||
|
||||
return self.post('/store/inventories/upload')
|
||||
|
||||
def prices_upload(self, prices):
|
||||
"""
|
||||
:param prices: array of objects
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['prices'] = json.dumps(prices)
|
||||
|
||||
return self.post('/store/prices/upload')
|
||||
|
||||
def products(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/store/products')
|
||||
|
||||
def store_setting(self, code):
|
||||
"""
|
||||
:param code: string
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/store/setting/' + str(code))
|
||||
|
||||
def store_setting_edit(self, configuration):
|
||||
"""
|
||||
:param configuration: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['configuration'] = json.dumps(configuration)
|
||||
|
||||
return self.post('/store/setting/' + str(configuration['code']) + '/edit')
|
||||
|
||||
def telephony_call_event(self, event):
|
||||
"""
|
||||
:param event: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['event'] = json.dumps(event)
|
||||
|
||||
return self.post('/telephony/call/event')
|
||||
|
||||
def telephony_calls_upload(self, calls):
|
||||
"""
|
||||
:param calls: array of objects
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['calls'] = json.dumps(calls)
|
||||
|
||||
return self.post('/telephony/calls/upload')
|
||||
|
||||
def telephony_manager(self, phone, details=True, ignore_status=False):
|
||||
"""
|
||||
:param phone: string
|
||||
:param details: string
|
||||
:param ignore_status: string
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['phone'] = phone
|
||||
self.parameters['details'] = details
|
||||
self.parameters['ignoreStatus'] = ignore_status
|
||||
|
||||
return self.get('/telephony/manager')
|
||||
|
||||
def telephony_setting(self, code):
|
||||
"""
|
||||
:param code: string
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/telephony/setting/' + str(code))
|
||||
|
||||
def telephony_setting_edit(self, configuration):
|
||||
"""
|
||||
:param configuration: object
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['configuration'] = json.dumps(configuration)
|
||||
|
||||
return self.post('/telephony/setting/' + str(configuration['code']) + '/edit')
|
||||
|
||||
def user_groups(self, limit=20, page=1):
|
||||
"""
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/user-groups')
|
||||
|
||||
def users(self, filters=None, limit=20, page=1):
|
||||
"""
|
||||
:param filters: object
|
||||
:param limit: integer
|
||||
:param page: integer
|
||||
:return: Response
|
||||
"""
|
||||
self.parameters['filter'] = filters
|
||||
self.parameters['limit'] = limit
|
||||
self.parameters['page'] = page
|
||||
|
||||
return self.get('/users')
|
||||
|
||||
def user(self, uid):
|
||||
"""
|
||||
:param uid: integer
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/users/' + str(uid))
|
||||
|
||||
def statistic_update(self):
|
||||
"""
|
||||
:return: Response
|
||||
"""
|
||||
|
||||
return self.get('/statistic/update')
|
1558
retailcrm/versions/v5.py
Normal file
1558
retailcrm/versions/v5.py
Normal file
File diff suppressed because it is too large
Load diff
43
setup.py
43
setup.py
|
@ -1,16 +1,45 @@
|
|||
# coding=utf-8
|
||||
|
||||
"""
|
||||
Setup file
|
||||
"""
|
||||
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
def read(filename):
|
||||
"""Read readme for long description"""
|
||||
return open(os.path.join(os.path.dirname(__file__), filename)).read()
|
||||
|
||||
|
||||
setup(
|
||||
name='retailcrm',
|
||||
version='3.0.5',
|
||||
description='Client for retailCRM API',
|
||||
version='5.1.2',
|
||||
description='RetailCRM API client',
|
||||
long_description=read('README'),
|
||||
url='https://github.com/retailcrm/api-client-python',
|
||||
author='retailCRM',
|
||||
author_email='integration@retailcrm.ru',
|
||||
keywords='crm, saas, rest, e-commerce',
|
||||
author='RetailCRM',
|
||||
author_email='support@retailcrm.pro',
|
||||
keywords='crm saas rest e-commerce',
|
||||
license='MIT',
|
||||
packages=['retailcrm'],
|
||||
packages=['retailcrm', 'retailcrm/versions'],
|
||||
package_data={},
|
||||
install_requires=['requests']
|
||||
install_requires=['requests', 'multidimensional_urlencode', 'nose', 'coverage', 'pook', 'setuptools'],
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Other Environment',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Programming Language :: Python :: 3.12',
|
||||
'Programming Language :: Python :: 3 :: Only',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
]
|
||||
)
|
||||
|
|
1642
tests/v3_tests.py
Normal file
1642
tests/v3_tests.py
Normal file
File diff suppressed because it is too large
Load diff
2226
tests/v4_tests.py
Normal file
2226
tests/v4_tests.py
Normal file
File diff suppressed because it is too large
Load diff
4672
tests/v5_tests.py
Normal file
4672
tests/v5_tests.py
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue