Metadata-Version: 1.2
Name: stannp
Version: 1.0.0
Summary: An API wrapper for Stannp, a service for sending snail mail via a web api, such as postcards and letters.
Home-page: https://github.com/andy-pi/stannp-api
Author: AndyPi
Author-email: info@andypi.co.uk
License: GNU
Project-URL: Author, https://andypi.co.uk/
Project-URL: Stannp API, https://www.stannp.com/direct-mail-api
Description-Content-Type: UNKNOWN
Description: A Python API wrapper for Stannp by AndyPi
        =========================================
        
        What is Stannp?
        ---------------
        
        Stannp allows you to send snail mail via a web api. It includes
        postcards and letters. See stannp.com for more details.
        
        Installation
        ------------
        
        ::
        
            pip install stannp
        
        Example Usage
        =============
        
        Initialisation
        --------------
        
        import the module and create an instance with your Stannp API Key
        
        ::
        
            from stannp import StannpClient
            STANNP_API_KEY="XXXXXXXXXXXX"
            stannpinstance=StannpClient(STANNP_API_KEY)
        
        Test send a postcard and return the JSON repsonse
        -------------------------------------------------
        
        ::
        
            # set recipient using a python dictionary
            recipient={'title': 'Mr', 'firstname':'Andy', 'lastname':'Pi', 'address1': 'My House', 'address2': 'My Town', 'city':My City', 'postcode': 'Postcode', 'country':'GB'}  
            # Set the message text
            message="Hi Friend,\n\n This is a sample postcard using AndyPi's stannp-api wrapper for python"
            # Creates the postcard (where test.jpg is the filename of the front of the card)
            card=stannpinstance.send_postcard(size="A6", test=True, recipient=recipient, front="test.jpg", back=None, message=message, signature=None)
            # Prints the JSON repsonse from the stannp server, including the URL of a PDF preview
            print card
        
        Test send a letter and return the PDF preview URL from the repsonse
        -------------------------------------------------------------------
        
        ::
        
            # set recipient using a python dictionary
            recipient={'title': 'Mr', 'firstname':'Andy', 'lastname':'Pi', 'address1': 'My House', 'address2': 'My Town', 'city':My City', 'postcode': 'Postcode', 'country':'GB'}  
            # Set the message text to be a PDF named test.pdf (note the first page will have the recipients address)
            letter=stannpinstance.send_letter(test=True, template=None, recipient=recipient, background=None, pages="test.pdf", pdforhtml="pdf")
            # print the URL of the preview PDF
            print letter['data']['pdf']
        
        Other
        -----
        
        Please see the comments / doctrings in stannp.py to understand how to
        use all the functions.
        
Keywords: stannp,postcard,letters,api,snail mail
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Requires-Python: >=3
