|
| 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