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.7, 3.4, 3.5, 3.6, 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
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.
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.
You can use
easy_install for installing the package.
pip install lob easy_install lob
To initialize the wrapper, import
lob and set the
import lob lob.api_key = 'your-api-key' // set an api version (optional) lob.api_version = 'api-version'
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.
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.
- Rate Limiting
- Cancellation Windows
- Scheduled Mailings
- HTML Templates
- Asset URLs
- US Verification API
- Int'l Verification API
- Postcards API
- Letters API
- Checks API
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