Skip to main content

A Python package for seamless management and pricing of in-app products and subscriptions

Project description

Prodmatic

Prodmatic is a Python library that provides seamless management and pricing solutions for in-app products and subscriptions on both Google Play Store and Apple App Store. It simplifies access to store APIs and provides country-specific pricing using Public-Private Partnership (PPP) conversions.

Features

  • Google Play Store Integration:

    • List, add, update, and delete in-app products and subscriptions
    • Convert in-app prices to store-compatible formats based on PPP and forex exchange rates
  • Apple App Store Integration (WIP):

    • Placeholder for future features
  • Pricing Module:

    • Convert prices based on PPP, forex rates, and store pricing guidelines
    • Support for Google Play Store reference pricing

Installation

You can install Prodmatic using pip:

pip install prodmatic

Usage

Play Store Integration

To integrate with the Google Play Store, you'll need a service account with the appropriate permissions.

from google.oauth2 import service_account
from googleapiclient.discovery import build
from prodmatic.playstore.api import PlayStoreAPI

SCOPES = ['https://www.googleapis.com/auth/androidpublisher']
SERVICE_ACCOUNT_FILE = 'path/to/your/service-account.json'

credentials = service_account.Credentials.from_service_account_file(
    SERVICE_ACCOUNT_FILE, scopes=SCOPES)
service = build('androidpublisher', 'v3', credentials=credentials)

# Initialize PlayStoreAPI
play_store_api = PlayStoreAPI(service, 'com.example.app')

# List all in-app products
iaps = play_store_api.list_iaps()

# Add a new in-app product
iap_data = {
    'sku': 'new_sku',
    'title': 'New In-App Product',
    'description': 'Description of the new in-app product',
    # Add other fields as required
}
play_store_api.add_iap('new_sku', iap_data)

Play Store Pricing

To get equivalent in-app product pricing in different countries based on PPP and store pricing formats:

from prodmatic.playstore.pricing import PlayStorePricing

# Initialize PlayStorePricing
play_store_pricing = PlayStorePricing()

# Get store price mapping
price_mapping = play_store_pricing.get_store_price_mapping(
    source_country='US',
    source_price=79,
    destination_country='IN'
)

print(price_mapping)

Directory Structure

prodmatic
├── __init__.py
├── appstore
│   ├── __init__.py
│   ├── api.py (WIP)
│   └── pricing.py (WIP)
├── base
│   ├── __init__.py
│   ├── api.py
│   └── pricing.py
├── playstore
│   ├── __init__.py
│   ├── api.py
│   └── pricing.py
└── resources
    ├── appstore_reference_prices.csv
    ├── data_sources.json
    └── playstore_reference_prices.csv

Resources

  • data_sources.json: Contains URLs for currency mappings
  • playstore_reference_prices.csv: Google Play Store reference pricing data

License

Prodmatic is licensed under the GNU Affero General Public License v3.0.

Repository

For more information and to contribute, please visit the GitHub repository: https://github.com/musicmuni/prodmatic

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

prodmatic-2024.5.14.tar.gz (24.1 kB view hashes)

Uploaded Source

Built Distribution

prodmatic-2024.5.14-py3-none-any.whl (25.3 kB view hashes)

Uploaded Python 3

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