Skip to main content

Passbook file generator

Project description

# Wallet-py3k

Python library to read/write [Apple Wallet]( (.pkpass) files

This is a fork of which doesn't support py3k.

## Getting Started

1. Get a Pass Type Id

Visit the 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 Certificates.p12 file (need Apple Root Certificate installed)

2. Generate the necessary certificate and key .pem files

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

## Typical Usage

from wallet.models import Pass, Barcode, StoreCard

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

organizationName = 'Your organization'
passTypeIdentifier = ''
teamIdentifier = 'AGK5BZEN3E'

passfile = Pass(cardInfo, \
passTypeIdentifier=passTypeIdentifier, \
organizationName=organizationName, \

passfile.serialNumber = '1234567'
passfile.barcode = Barcode(message = 'Barcode message')

# Including the icon and logo is necessary for the passbook to be valid.
passfile.addFile('icon.png', open('images/icon.png', 'rb'))
passfile.addFile('logo.png', open('images/logo.png', 'rb'))
passfile.create('certificate.pem', 'key.pem', 'wwdr.pem', '123456', 'test.pkpass') # Create and output the Passbook file (.pkpass)
## Note: Getting WWDR Certificate

Certificate is available @
It can be exported from KeyChain into a .pem (e.g. wwdr.pem)

Project details

Download files

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

Source Distribution

wallet-py3k-0.0.4.tar.gz (6.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page