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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file prodmatic-2024.5.14.tar.gz.

File metadata

  • Download URL: prodmatic-2024.5.14.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for prodmatic-2024.5.14.tar.gz
Algorithm Hash digest
SHA256 6f967e5ade06cd327e4c97206371e90bf70bc47e104b5b1c33a1fdc12cdb399e
MD5 e33415e7c09427b05737a0c4831eaa85
BLAKE2b-256 0c972d44b7b8fec890d1a1b1be9622ff4d42dc12fcc33b9c0ad94f1b7f2d46b1

See more details on using hashes here.

File details

Details for the file prodmatic-2024.5.14-py3-none-any.whl.

File metadata

File hashes

Hashes for prodmatic-2024.5.14-py3-none-any.whl
Algorithm Hash digest
SHA256 e743dc87fdb0de670637adcdd7cbcb840ed01bfea92d2efe1ebbda19919a2856
MD5 1507dbaefb23b2fc4e5f84421c7b5805
BLAKE2b-256 390e2bee48e45a65b6635c4f7bc05dcaed654fe226cbd8edf0d4d0e3283e01ad

See more details on using hashes here.

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