/lob-python

Python Wrapper for Lob API

Primary LanguagePythonMIT LicenseMIT

lob-python

Build Status PyPI version Coverage Status Dependency Status

This is the python wrapper for the Lob.com API. See full Lob.com documentation here. For best results, be sure that you're using the latest version of the Lob API and the latest version of the python wrapper.

This wrapper supports Python 2.6, 2.7, 3.3, 3.4, 3.5, pypy, and pypy3 and works in the object oriented style. That is, to make calls you have to call the method on a class and the return types are python objects. To get a dict on any object, you can call the to_dict() method of the object.

Table of Contents

Getting Started

Here's a general overview of the Lob services available, click through to read more.

Please read through the official API Documentation to get a complete sense of what to expect from each endpoint.

Registration

First, you will need to first create an account at Lob.com and obtain your Test and Live API Keys.

Once you have created an account, you can access your API Keys from the Settings Panel.

Installation

You can use pip or easy_install for installing the package.

pip install lob
easy_install lob

To initialize the wrapper, import lob and set the api_key

import lob
lob.api_key = 'your-api-key'

// set an api version (optional)
lob.api_version = 'api-version'

Usage

We've provided an example script you can run in examples/ that has examples of how to use the lob-python wrapper with some of our core endpoints.

Examples

We've provided various examples for you to try out here.

There are simple scripts to demonstrate how to create all the core Lob objects (checks, letters, postcards. etc.) as well as more complex examples that utilize other libraries and external files.

API Documentation

Testing

Install all requirements with pip install -r requirements.txt.

You can run all tests with the command nosetests in the main directory.

=======================

Copyright © 2013 Lob.com

Released under the MIT License, which can be found in the repository in LICENSE.txt.