forked from openlabs/magento
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME
38 lines (28 loc) · 1009 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Magento Python
**************
Python library to connect Magento Webservices
Check documentation source code
Examples:
from magento import *
url = 'http://domain.com/'
apiuser = 'user'
apipass = 'password'
"""Product"""
with Product(url, apiuser, apipass) as product_api:
ofilter = {'created_at':{'from':'2011-09-15 00:00:00'}}
products = product_api.list(ofilter)
with ProductTypes(url, apiuser, apipass) as product_type_api:
product_type = product_type_api.list()
with Product(url, apiuser, apipass) as product_api:
sku = 'prod1'
product = product_api.info(sku)
"""Websites"""
with API(url, apiuser, apipass) as magento_api:
websites = magento_api.call('ol_websites.list', [])
store_group = magento_api.call('ol_groups.list', [])
store_views = magento_api.call('ol_storeviews.list', [])
"""Order"""
with Order(url, apiuser, apipass) as order_api:
order_increment_id = '100000001 '
status = 'canceled'
order_api.addcomment(order_increment_id, status)