<commit_before><commit_msg>README.md<commit_after>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 Documentation](http://wiki.prestashop.com/display/enEN/Using+the+REST+webservice).

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)

Beta version, the post and put doesn't yet work.

#Credits:
Thanks to Prestashop SA for their PHP API Client PSWebServiceLibrary.php
Thanks to <NAME> for his port of PSWebServiceLibrary.php to the Scala language, prestasac (https://github.com/orderly/prestashop-scala-client) from which I also inspired my library.

#Installation
TODO

#Usage

    from prestapyt import PrestaShopWebServiceError, PrestaShopWebService

    prestashop = PrestaShopWebService('http://localhost:8080/api', 'BVWPFFYBT97WKM959D7AVVD0M4815Y1L')

    # get all addresses
    print ElementTree.tostring(prestashop.get('addresses'))

    # get address 1
    print ElementTree.tostring(prestashop.get('addresses', resource_id=1))
    print ElementTree.tostring(prestashop.get('addresses/1'))

    #filters
    print ElementTree.tostring(prestashop.get('addresses', options={'limit': 10}))

    # head
    print prestashop.head('addresses')

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

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

#API Documentation
Documentation for the PrestaShop Web Service can be found on the PrestaShop wiki:
[Using the REST webservice](http://wiki.prestashop.com/display/enEN/Using+the+REST+webservice)

#Copyright and License

prestapyt is copyright (c) 2012 <NAME>

prestapyt is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

prestapyt is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with prestapyt. If not, see [GNU licenses](http://www.gnu.org/licenses/).

{'fraction_non_alphanumeric': 0.07113745831789552, 'fraction_numerical': 0.010744720266765468, 'mean_word_length': 4.986696230598669, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3413384', 'n_tokens_mistral': 806, 'n_tokens_neox': 765, 'n_words': 306}