Skip to content

Printful API Client for Python 3

License

Notifications You must be signed in to change notification settings

stuartgl/printful

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

printful

Printful API Client for Python 3

The Printful API client wrapper makes life a bit easier when working with the API. This is an update from the original Python 2.7 client library that was provided here . The module requires an API key as input. The key can be generated in the store settings of your Printful account.

Quickstart

from printful import Printful
pf = Printful(key)
orders = pf.get('orders')

The Printful class extends the Requests library so data, param, json, etc. can be passed just as you would with requests.

address = {
    'recipient': {
        'country_code': 'US',
        'state_code': 'CA'
    },
    'items': [
        {'variant_id': 1, 'quantity': 1},
        {'variant_id': 1118, 'quantity': 2}
    ]
}

pf.post('shipping/rates', json=address)

Or, retrieve only certain orders using offset and limit.

pf.get('orders', params={'offset': 5, 'limit':10})

is equivalent to:

pf.get('orders&offset=10&limit=5')

About

Printful API Client for Python 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%