This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description


pip install pyinapp


Currently pyinapp supports Google Play and App Store receipts validation.

Google Play:

from pyinapp import GooglePlayValidator, InAppValidationError

bundle_id = 'com.yourcompany.yourapp'
api_key = 'API key from the developer console'
validator = GooglePlayValidator(bundle_id, api_key)

    purchase = validator.validate('receipt', 'signature')
except InAppValidationError:
    """ handle validation error """

App Store:

from pyinapp import AppStoreValidator, InAppValidationError

bundle_id = 'com.yourcompany.yourapp'
validator = AppStoreValidator(bundle_id)

    purchase = validator.validate('receipt')
except InAppValidationError:
    """ handle validation error """

Important! On iOS 7+ all receipts may contain more than one purchase so you have to deal with a list of purchases. For the sake of convenience you can process purchases this way:

def process_purchase(purchase):
    process(*purchase) if isinstance(purchase, list) else process(purchase)

def process(*purchases):
    for p in purchases:
        """ for instance, save p to db and add a player some coins for it """

This approach allows to process both Google Play and App Store purchases the same way.


Purchase is a universal wrapper for Google Play and App Store receipts. It contains the following fields:

  • transaction_id: id of the purchase (transaction_id for App Store and orderId for Google Play);
  • product_id: what product has been purchased (product_id for App Store and productId for Google Play);
  • quantity: how many products have been purchased (quantity for App Store and always 1 for Google Play - there’s no such field in Google Play receipt);
  • purchased_at: when the product has been purchased, UNIX timestamp (purchase_date for App Store and purchaseTime for Google Play).
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyinapp-0.1.1.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Sep 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting