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 mappingsplaystore_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prodmatic-2024.5.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22dc1d3685a81afa41a9bbe502de980b94d24301375e1a7be996433a66ba2779 |
|
MD5 | 5732ce2e65fbf6fff2be9bb3f4b371ca |
|
BLAKE2b-256 | 8b5e5b1363ae114e40fc3ac74bb41021ccb1dc1ad792b47098350db7fa47df88 |