Metadata-Version: 1.0
Name: factuursturen
Version: 0.1
Summary: a REST client class for the API of www.factuursturen.nl
Home-page: https://github.com/reinoud/factuursturen
Author: Reinoud van Leeuwen
Author-email: reinoud.v@n.leeuwen.net
License: Copyright (c) 2013, Reinoud van Leeuwen
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:


    - Redistributions of source code must retain the above copyright notice, 
      this list of conditions and the following disclaimer.

    - Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation 
      and/or other materials provided with the distribution.

      
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description: ====
        factuursturen.nl
        ====
        
        The factuursturen.nl package is a client for the dutch webservice www.factuursturen.nl API.
        
        To be able to use the API, you will need an API key. You can get one with these steps:
        * log in on http://www.factuursturen.nl
        * click 'Instellingen'
        * click 'Verbindingen'
        * click 'Maak API Sleutel'
        
        API documentation can be found at http://www.factuursturen.nl/docs/api_v0_beta.pdf (or there might be a newer version
        present at the moment you read this)
        
        Synopsis
        ========
        Typical usage is something like this:
        
            #!/usr/bin/env python
            import factuursturen
        
            username = 'foo'
            apikey = 'some_long_string'
        
        
            fact = factuursturen.client(apikey, username)
        
            clients = fact.get('clients')
        
            new_product = {u'code': 'Productcode',
                           u'name': 'Name of this product',
                           u'price': 123.45,
                           u'taxes': 21}
            try:
                fact.post('products', data)
            except FactuursturenWrongPostvalue as errormessage:
                print "oops! {errormessage}".format(errormessage=errormessage)
        
            invoices = fact.get('invoices')
        
            for invoice in invoices:
            invoicenr = invoice[u'invoicenr']
            try:
                pdf = fact.get('invoices_pdf', invoicenr)
        
                filename = '/tmp/{invoicenr}.pdf'.format(invoicenr=invoicenr)
                with open(filename, 'w') as f:
                    f.write(pdf)
                print "{} written".format(filename)
            except factuursturenEmptyResult:
                print "factuur {invoicenr} is empty".format(invoicenr=invoicenr)
        
        Changes from the API documentation
        ==================================
        This client is pythonic, so some things are translated:
        - booleans are returned as true booleans (not as strings with 'true')
        - nested dictionaries can be used in posting (will be flattened automatically)
        - returned dicts are the same structure as a dict that can be used for posting
        
Platform: UNKNOWN
