Skip to content


Subversion checkout URL

You can clone with
Download ZIP
More just just a Python wrapper for CheddarGetter, pycheddar gives you class objects that work a lot like Django models, making the whole experience of integrating with CheddarGetter just a little more awesome and Pythonic
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A Python wrapper for CheddarGetter

PyCheddar is a Python wrapper for CheddarGetter - which is a great service for handling recurring subscription payments without having to reinvent a mini-app to handle payments with each new project.


Just clone this repository anywhere in your PythonPath like this:

$ git clone

Eventually - but not just yet - you will be able to use easy_install like this:

$ easy_install pycheddar

Once you've done one of the above, you can test to see if it is installed from the Python interactive terminal:

>>> import pycheddar

If you don't get an error, you should be good to go.

A Note From FeedMagnet

PyCheddar was created as part of the code base for FeedMagnet - an online app that helps businesses harness with social media. We use CheddarGetter to handle all of our payment processing for premium accounts.

We really believe in open source software - and we've benefited a lot from it. We use Ubuntu, Python, Django, MySQL, CouchDB - and a ton of other open source tools to make FeedMagnet run. Open source only works if we all give back. This is hopefully just our first minor contribution to the open source community.

Example Usage

Set up your CheddarGetter login info:

>>> from pycheddar import *
>>> CheddarGetter.auth('e-mail address', 'password')
>>> CheddarGetter.set_product_code('product code')

Get all customers (returns a list of Customer objects):

>>> customers = Customer.all()
>>> for customer in Customer.all():
...     print customer.last_name

Get a customer that already exists, either by the ID or the code in CheddarGetter:

>>> customer = Customer.get('4072cc12-5375-102d-86dc-40402145ee8b')
>>> customer = Customer.get('MY_CODE')

Get customers based on arbitrary criteria:

>>> customers = = 'Smith')

Edit information about a customer:

>>> customer = Customer.get('4072cc12-5375-102d-86dc-40402145ee8b')
>>> customer.last_name = 'Jones'

Add a new customer:

>>> # this works...
>>> customer = Customer(code = 'JOHN_SMITH', first_name = 'John', last_name = 'Smith', email = '', plan_code = 'FREE')
>>> # and this does too...
>>> customer = Customer()
>>> customer.code = 'JOHN_SMITH'
>>> customer.first_name = 'John'
>>> customer.last_name = 'Smith'
>>> = ''
>>> customer.plan_code = 'FREE'

Get a customer's subscription information:

>>> subscription = Customer.get('JOHN_SMITH').subscription

Edit a customer's subscription information:

>>> subscription = Customer.get('JOHN_SMITH').subscription
>>> subscription.cc_number = '4111111111111111'
>>> subscription.cc_first_name = 'John'
>>> subscription.cc_last_name = 'Smith'
>>> subscription.cc_expiration = '01/2013'
>>> subscription.cc_zip = '77777'
>>> subscription.cc_card_code = '000'

Switch a customer to a new plan:

>>> # lots of ways to do's one:
>>> subscription.plan = Plan.get('COMPREHENSIVE')
>>> # or...
>>> subscription.plan = 'COMPREHENSIVE'
>>> # or...
>>> customer.plan_code = 'COMPREHENSIVE'

View the items included in a plan...

>>> for item in plan.items:
...     print (item.code, item.quantity)

Set an item's quantity (if the item is attached to a customer):

>>> item = customer.items[0]
>>> item.quantity = 5
>>> # note, CheddarGetter doesn't let you edit item quantity on
>>> # plans through the API, so that will fail...
>>> item = plan.items[0]
>>> item.quantity = 5
pycheddar.exceptions.ValidationError: Items may only have their quantity altered if they are directly attached to a customer.
Something went wrong with that request. Please try again.