Skip to main content

Passbook file generator

Project description

Python library to read/write Apple Passbook (.pkpass) files

Typical usage often looks like this:

#!/usr/bin/env python

from passbook.models import Pass, Barcode, StoreCard

cardInfo = StoreCard()
cardInfo.addPrimaryField('name', 'John Doe', 'Name')

organizationName = 'Your organization'
passTypeIdentifier = 'pass.com.your.organization'
teamIdentifier = 'AGK5BZEN3E'

passfile = Pass(cardInfo, \
    passTypeIdentifier=passTypeIdentifier, \
    organizationName=organizationName, \
    teamIdentifier=teamIdentifier)
passfile.serialNumber = '1234567'
passfile.barcode = Barcode(message = 'Barcode message')
passfile.addFile('icon.png', open('images/icon.png', 'r'))
passfile.addFile('logo.png', open('images/logo.png', 'r'))
passfile.create('certificate.pem', 'key.pem', 'wwdr.pem', '123456', 'test.pkpass') # Create and output the Passbook file (.pkpass)

Creating Pass Certificates

  1. First

iOS Provisioning Portal -> Pass Type IDs -> New Pass Type ID Select pass type id -> Configure (Follow steps and download generated pass.cer file) Use Keychain tool to export a p12 file (need Apple Root Certificate installed)

  1. Second.

openssl pkcs12 -in “Certificates.p12” -clcerts -nokeys -out certificate.pem openssl pkcs12 -in “Certificates.p12” -nocerts -out key.pem

Developed by devartis <http://www.devartis.com>.

Getting WWDR Certificate

Certificate is available @ http://developer.apple.com/certificationauthority/AppleWWDRCA.cer It can be easily exported from KeyChain right to .pem

Project details


Release history Release notifications

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

This version
History Node

0.1.0

History Node

0.1.0dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Passbook-0.1.0.tar.gz (5.6 kB) Copy SHA256 hash SHA256 Source None Sep 28, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page