Skip to content

Commit a7e0f8f

Browse files
author
Sharoon Thomas
committed
Cleanup the README file
* Convert to ReST syntax * Update the code examples * Add LICENSE
1 parent cbdc743 commit a7e0f8f

File tree

2 files changed

+48
-38
lines changed

2 files changed

+48
-38
lines changed

README

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Magento Python API
2+
==================
3+
4+
Python library to connect to Magento Webservices.
5+
6+
Check documentation source code
7+
8+
Usage
9+
-----
10+
11+
.. code-block:: python
12+
13+
import magento
14+
15+
url = 'http://domain.com/'
16+
apiuser = 'user'
17+
apipass = 'password'
18+
19+
with magento.Product(url, apiuser, apipass) as product_api:
20+
order_filter = {'created_at':{'from':'2011-09-15 00:00:00'}}
21+
products = product_api.list(order_filter)
22+
23+
with magento.ProductTypes(url, apiuser, apipass) as product_type_api:
24+
product_type = product_type_api.list()
25+
26+
with magento.Product(url, apiuser, apipass) as product_api:
27+
sku = 'prod1'
28+
product = product_api.info(sku)
29+
30+
with magento.API(url, apiuser, apipass) as magento_api:
31+
# Calling custom APIs if you have extension modules on your
32+
# magento installation
33+
websites = magento_api.call('ol_websites.list', [])
34+
store_group = magento_api.call('ol_groups.list', [])
35+
store_views = magento_api.call('ol_storeviews.list', [])
36+
37+
with magento.Order(url, apiuser, apipass) as order_api:
38+
order_increment_id = '100000001 '
39+
status = 'canceled'
40+
order_api.addcomment(order_increment_id, status)
41+
42+
43+
License
44+
-------
45+
46+
GNU Affero General Public License version 3
47+
48+
See LICENSE for more details

0 commit comments

Comments
 (0)