skip to navigation
skip to content

prestapyt 0.5.2

A library to access Prestashop Web Service from Python.

Latest Version: 0.9.0


prestapyt is a library for Python to interact with the PrestaShop’s Web Service API.

Learn more about the PrestaShop Web Service from the [Official Prestashop Documentation].

prestapyt is a direct port of the PrestaShop PHP API Client, PSWebServiceLibrary.php

Similar to PSWebServiceLibrary.php, prestapyt is a thin wrapper around the PrestaShop Web Service: it takes care of making the call to your PrestaShop instance’s Web Service, supports the Web Service’s HTTP-based CRUD operations (handling any errors) and then returns the XML ready for you to work with in Python (as well as prestasac if you work with scala).


The easiest way to install prestapyt (needs setuptools):

easy_install prestapyt

Or, better, using pip:

pip install prestapyt

If you do not have setuptools, download prestapyt as a .tar.gz or .zip from [Prestapyt Source Archives], untar it and run:

python install


from prestapyt import PrestaShopWebServiceError, PrestaShopWebService

prestashop = PrestaShopWebService(‘http://localhost:8080/api’, ‘BVWPFFYBT97WKM959D7AVVD0M4815Y1L’) # messages will be as xml # or prestashop = PrestaShopWebServiceDict(‘http://localhost:8080/api’, ‘BVWPFFYBT97WKM959D7AVVD0M4815Y1L’) # messages will be as dict

# search / get all addresses prestashop.get(‘addresses’) # will return the same xml message than‘addresses’) # but when using PrestaShopWebServiceDict‘addresses’) will return a list of ids

# search with filters‘addresses’, options={‘limit’: 10})‘addresses’, options={‘display’: ‘[firstname,lastname]’, ‘filter[id]’: ‘[1|5]’}) # reference for the options :

# get address 1 prestashop.get(‘addresses’, resource_id=1) # returns ElementTree (PrestaShopWebService) or dict (PrestaShopWebServiceDict) prestashop.get(‘addresses/1’)

# full url prestashop.get(‘http://localhost:8080/api/addresses/1’)

# head print prestashop.head(‘addresses’)

# delete a resource prestashop.delete(‘addresses’, resource_ids=4)

# delete many resources prestashop.delete(‘addresses’, resource_ids=[5,6])

# add prestashop.add(‘addresses’, xml)

# edit prestashop.edit(‘addresses’, 5, xml)

# get a blank xml prestashop.get(‘addresses’, options={‘schema’: ‘blank’})

API Documentation

Documentation for the PrestaShop Web Service can be found on the PrestaShop wiki: [Using the REST webservice]


Thanks to Prestashop SA for their PHP API Client PSWebServiceLibrary.php

Thanks to Alex Dean for his port of PSWebServiceLibrary.php to the Scala language, [prestasac] from which I also inspired my library.

File Type Py Version Uploaded on Size
prestapyt-0.5.2-py2.6.egg (md5) Python Egg 2.6 2012-09-04 24KB
prestapyt-0.5.2.tar.gz (md5) Source 2012-09-04 11KB