apple-appstore-connect-client 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apple_appstore_connect_client-0.1.0/CHANGELOG.md +190 -0
- apple_appstore_connect_client-0.1.0/CLAUDE.md +115 -0
- apple_appstore_connect_client-0.1.0/LICENSE +21 -0
- apple_appstore_connect_client-0.1.0/MANIFEST.in +24 -0
- apple_appstore_connect_client-0.1.0/PKG-INFO +304 -0
- apple_appstore_connect_client-0.1.0/README.md +259 -0
- apple_appstore_connect_client-0.1.0/TESTING.md +279 -0
- apple_appstore_connect_client-0.1.0/docs/API_REFERENCE.md +550 -0
- apple_appstore_connect_client-0.1.0/docs/GETTING_STARTED.md +374 -0
- apple_appstore_connect_client-0.1.0/docs/TROUBLESHOOTING.md +462 -0
- apple_appstore_connect_client-0.1.0/docs/integration-testing.md +264 -0
- apple_appstore_connect_client-0.1.0/examples/advanced_reporting.py +155 -0
- apple_appstore_connect_client-0.1.0/examples/basic_usage.py +97 -0
- apple_appstore_connect_client-0.1.0/examples/batch_metadata_operations.py +217 -0
- apple_appstore_connect_client-0.1.0/examples/integration_example.py +273 -0
- apple_appstore_connect_client-0.1.0/examples/metadata_management.py +181 -0
- apple_appstore_connect_client-0.1.0/pyproject.toml +123 -0
- apple_appstore_connect_client-0.1.0/requirements-dev.txt +21 -0
- apple_appstore_connect_client-0.1.0/requirements.txt +7 -0
- apple_appstore_connect_client-0.1.0/setup.cfg +4 -0
- apple_appstore_connect_client-0.1.0/setup.py +45 -0
- apple_appstore_connect_client-0.1.0/src/apple_appstore_connect_client.egg-info/PKG-INFO +304 -0
- apple_appstore_connect_client-0.1.0/src/apple_appstore_connect_client.egg-info/SOURCES.txt +44 -0
- apple_appstore_connect_client-0.1.0/src/apple_appstore_connect_client.egg-info/dependency_links.txt +1 -0
- apple_appstore_connect_client-0.1.0/src/apple_appstore_connect_client.egg-info/requires.txt +14 -0
- apple_appstore_connect_client-0.1.0/src/apple_appstore_connect_client.egg-info/top_level.txt +1 -0
- apple_appstore_connect_client-0.1.0/tests/__init__.py +1 -0
- apple_appstore_connect_client-0.1.0/tests/conftest.py +259 -0
- apple_appstore_connect_client-0.1.0/tests/test_client.py +455 -0
- apple_appstore_connect_client-0.1.0/tests/test_client_auth.py +231 -0
- apple_appstore_connect_client-0.1.0/tests/test_client_errors.py +291 -0
- apple_appstore_connect_client-0.1.0/tests/test_client_final_coverage.py +244 -0
- apple_appstore_connect_client-0.1.0/tests/test_client_metadata.py +745 -0
- apple_appstore_connect_client-0.1.0/tests/test_client_reporting.py +517 -0
- apple_appstore_connect_client-0.1.0/tests/test_correct_coverage.py +346 -0
- apple_appstore_connect_client-0.1.0/tests/test_error_handling_coverage.py +478 -0
- apple_appstore_connect_client-0.1.0/tests/test_exceptions.py +246 -0
- apple_appstore_connect_client-0.1.0/tests/test_integration.py +391 -0
- apple_appstore_connect_client-0.1.0/tests/test_metadata.py +509 -0
- apple_appstore_connect_client-0.1.0/tests/test_metadata_additional.py +273 -0
- apple_appstore_connect_client-0.1.0/tests/test_remaining_coverage.py +368 -0
- apple_appstore_connect_client-0.1.0/tests/test_reports.py +300 -0
- apple_appstore_connect_client-0.1.0/tests/test_reports_additional.py +236 -0
- apple_appstore_connect_client-0.1.0/tests/test_utils.py +328 -0
- apple_appstore_connect_client-0.1.0/tests/test_utils_additional.py +168 -0
- apple_appstore_connect_client-0.1.0/utils/verify_credentials.py +246 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2025-01-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Core API Client
|
|
13
|
+
- `AppStoreConnectAPI` class for direct App Store Connect API access
|
|
14
|
+
- JWT ES256 authentication with automatic token refresh
|
|
15
|
+
- Built-in rate limiting (50 requests/hour) with exponential backoff
|
|
16
|
+
- Comprehensive error handling with specific exception types
|
|
17
|
+
|
|
18
|
+
#### Sales Reporting
|
|
19
|
+
- `get_sales_report()` - Fetch daily, weekly, monthly, yearly sales reports
|
|
20
|
+
- `get_subscription_report()` - Subscription status and metrics
|
|
21
|
+
- `get_subscription_event_report()` - Subscription lifecycle events
|
|
22
|
+
- `get_financial_report()` - Financial and revenue data
|
|
23
|
+
- `fetch_multiple_days()` - Optimized bulk data fetching with smart frequency selection
|
|
24
|
+
|
|
25
|
+
#### App Metadata Management
|
|
26
|
+
- `get_apps()` - List all apps in account
|
|
27
|
+
- `get_current_metadata()` - Comprehensive app metadata retrieval
|
|
28
|
+
- `update_app_name()` - Update app store name (always available)
|
|
29
|
+
- `update_app_subtitle()` - Update app subtitle (always available)
|
|
30
|
+
- `update_privacy_url()` - Update privacy policy URL (always available)
|
|
31
|
+
- `update_app_description()` - Update app description (requires editable version)
|
|
32
|
+
- `update_app_keywords()` - Update keywords (requires editable version)
|
|
33
|
+
- `update_promotional_text()` - Update promotional text (requires editable version)
|
|
34
|
+
- `create_app_store_version()` - Create new app versions
|
|
35
|
+
- `get_editable_version()` - Find versions available for editing
|
|
36
|
+
|
|
37
|
+
#### Advanced Analytics (ReportProcessor)
|
|
38
|
+
- `get_sales_summary()` - Comprehensive sales analytics with breakdowns
|
|
39
|
+
- `get_subscription_analysis()` - Subscription metrics and event analysis
|
|
40
|
+
- `compare_periods()` - Period-over-period performance comparison
|
|
41
|
+
- `get_app_performance_ranking()` - App ranking by revenue, units, or countries
|
|
42
|
+
- `export_summary_report()` - Export analytics to CSV
|
|
43
|
+
|
|
44
|
+
#### Portfolio Management (MetadataManager)
|
|
45
|
+
- `get_app_portfolio()` - Complete portfolio overview with caching
|
|
46
|
+
- `update_app_listing()` - Multi-field app store listing updates
|
|
47
|
+
- `batch_update_apps()` - Update multiple apps simultaneously
|
|
48
|
+
- `standardize_app_names()` - Bulk app name standardization
|
|
49
|
+
- `prepare_version_releases()` - Batch version creation
|
|
50
|
+
- `get_localization_status()` - Localization analysis across portfolio
|
|
51
|
+
- `export_app_metadata()` - Portfolio data export to CSV
|
|
52
|
+
|
|
53
|
+
#### Utility Functions
|
|
54
|
+
- Comprehensive validation functions for all input types
|
|
55
|
+
- Date handling and normalization utilities
|
|
56
|
+
- String sanitization and formatting helpers
|
|
57
|
+
- DataFrame combination and processing utilities
|
|
58
|
+
- Currency formatting and display functions
|
|
59
|
+
|
|
60
|
+
#### Exception Handling
|
|
61
|
+
- `AppStoreConnectError` - Base exception for all API errors
|
|
62
|
+
- `AuthenticationError` - Authentication failures (401)
|
|
63
|
+
- `PermissionError` - Insufficient permissions (403)
|
|
64
|
+
- `NotFoundError` - Resource not found (404)
|
|
65
|
+
- `RateLimitError` - Rate limit exceeded (429)
|
|
66
|
+
- `ValidationError` - Input validation failures
|
|
67
|
+
|
|
68
|
+
#### Testing & Quality
|
|
69
|
+
- Comprehensive test suite with 80%+ coverage
|
|
70
|
+
- Unit tests for all major components
|
|
71
|
+
- Mock-based testing for API interactions
|
|
72
|
+
- Validation and error handling tests
|
|
73
|
+
- pytest configuration with coverage reporting
|
|
74
|
+
|
|
75
|
+
#### Documentation
|
|
76
|
+
- Complete API reference documentation
|
|
77
|
+
- Getting started guide with examples
|
|
78
|
+
- Troubleshooting guide for common issues
|
|
79
|
+
- Multiple usage examples covering all features
|
|
80
|
+
- Integration examples showing migration paths
|
|
81
|
+
|
|
82
|
+
#### Developer Experience
|
|
83
|
+
- Convenient factory functions (`create_report_processor`, `create_metadata_manager`)
|
|
84
|
+
- Type hints throughout the codebase
|
|
85
|
+
- Detailed docstrings for all public methods
|
|
86
|
+
- Clear error messages with actionable suggestions
|
|
87
|
+
- Consistent naming conventions and patterns
|
|
88
|
+
|
|
89
|
+
### Features by Use Case
|
|
90
|
+
|
|
91
|
+
#### For App Store Analytics Teams
|
|
92
|
+
- Period comparison and trend analysis
|
|
93
|
+
- App performance ranking and benchmarking
|
|
94
|
+
- Revenue and subscription analytics
|
|
95
|
+
- Top performer identification
|
|
96
|
+
- Export capabilities for further analysis
|
|
97
|
+
|
|
98
|
+
#### For App Store Optimization Teams
|
|
99
|
+
- Batch metadata management across portfolios
|
|
100
|
+
- Localization status tracking
|
|
101
|
+
- App store listing optimization workflows
|
|
102
|
+
- Version management and release preparation
|
|
103
|
+
- Portfolio analysis and optimization insights
|
|
104
|
+
|
|
105
|
+
#### For Development Teams
|
|
106
|
+
- Direct API access with comprehensive error handling
|
|
107
|
+
- Backward compatibility with existing implementations
|
|
108
|
+
- Smart data fetching with optimized API usage
|
|
109
|
+
- Extensible architecture for custom workflows
|
|
110
|
+
- Integration examples and migration guides
|
|
111
|
+
|
|
112
|
+
### Technical Specifications
|
|
113
|
+
|
|
114
|
+
#### Requirements
|
|
115
|
+
- Python 3.7+
|
|
116
|
+
- pandas >= 2.0.0
|
|
117
|
+
- requests >= 2.31.0
|
|
118
|
+
- PyJWT >= 2.8.0
|
|
119
|
+
- cryptography >= 41.0.0
|
|
120
|
+
- python-dateutil >= 2.8.0
|
|
121
|
+
- ratelimit >= 2.2.1
|
|
122
|
+
|
|
123
|
+
#### API Compatibility
|
|
124
|
+
- App Store Connect API v1
|
|
125
|
+
- Sales Reports API versions 1_1 and 1_4
|
|
126
|
+
- Subscription Events API version 1_4
|
|
127
|
+
- Financial Reports API
|
|
128
|
+
- App Metadata Management API
|
|
129
|
+
|
|
130
|
+
#### Rate Limiting
|
|
131
|
+
- Automatic handling of Apple's 50 requests/hour limit
|
|
132
|
+
- Exponential backoff for rate limit errors
|
|
133
|
+
- Smart frequency selection to minimize API calls
|
|
134
|
+
- Bulk operations to reduce request count
|
|
135
|
+
|
|
136
|
+
### Installation Methods
|
|
137
|
+
|
|
138
|
+
#### Standard Installation
|
|
139
|
+
```bash
|
|
140
|
+
pip install appstore-connect-client
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Development Installation
|
|
144
|
+
```bash
|
|
145
|
+
pip install appstore-connect-client[dev]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### From Source
|
|
149
|
+
```bash
|
|
150
|
+
git clone https://github.com/chrisbick/appstore-connect-client.git
|
|
151
|
+
cd appstore-connect-client
|
|
152
|
+
pip install -e .[dev]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Migration Support
|
|
156
|
+
|
|
157
|
+
#### From BicksterAppStoreSales
|
|
158
|
+
- Drop-in replacement for existing `AppStoreConnectAPI` usage
|
|
159
|
+
- Same method signatures for core reporting functions
|
|
160
|
+
- Enhanced functionality with additional features
|
|
161
|
+
- Migration guide and compatibility examples
|
|
162
|
+
|
|
163
|
+
#### From Custom Implementations
|
|
164
|
+
- Standard REST API patterns
|
|
165
|
+
- Comprehensive documentation for method mapping
|
|
166
|
+
- Examples showing equivalent functionality
|
|
167
|
+
- Gradual migration path with coexistence support
|
|
168
|
+
|
|
169
|
+
### Backward Compatibility
|
|
170
|
+
|
|
171
|
+
- All core sales reporting methods maintain same signatures
|
|
172
|
+
- Enhanced methods are additive, not breaking
|
|
173
|
+
- Optional parameters with sensible defaults
|
|
174
|
+
- Clear deprecation path for any future changes
|
|
175
|
+
|
|
176
|
+
### Performance Optimizations
|
|
177
|
+
|
|
178
|
+
- Smart frequency selection for date ranges
|
|
179
|
+
- Automatic DataFrame filtering and processing
|
|
180
|
+
- Memory-efficient data handling for large datasets
|
|
181
|
+
- Caching for metadata operations
|
|
182
|
+
- Batch operations to minimize API calls
|
|
183
|
+
|
|
184
|
+
### Security Features
|
|
185
|
+
|
|
186
|
+
- Secure JWT token handling with automatic refresh
|
|
187
|
+
- No credential storage in memory longer than necessary
|
|
188
|
+
- Input validation to prevent injection attacks
|
|
189
|
+
- HTTPS-only communication with Apple APIs
|
|
190
|
+
- Comprehensive error handling without credential leakage
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude AI when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
`appstore-connect-client` is a Python library for interacting with Apple's App Store Connect API. It provides:
|
|
8
|
+
- Sales and financial reporting
|
|
9
|
+
- App metadata management
|
|
10
|
+
- Subscription analytics
|
|
11
|
+
- Portfolio-wide operations
|
|
12
|
+
|
|
13
|
+
## Key Design Principles
|
|
14
|
+
|
|
15
|
+
1. **Backward Compatibility**: The library maintains compatibility with existing implementations while adding new features
|
|
16
|
+
2. **Clear Error Handling**: All API errors are mapped to specific exception types
|
|
17
|
+
3. **Rate Limiting**: Built-in rate limiting (50 requests/hour) with exponential backoff
|
|
18
|
+
4. **Type Safety**: Comprehensive type hints throughout the codebase
|
|
19
|
+
|
|
20
|
+
## Code Style Guidelines
|
|
21
|
+
|
|
22
|
+
- Use type hints for all function parameters and return values
|
|
23
|
+
- Follow PEP 8 style guide
|
|
24
|
+
- Document all public methods with comprehensive docstrings
|
|
25
|
+
- Maintain test coverage above 80%
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
28
|
+
|
|
29
|
+
- Run tests with: `pytest`
|
|
30
|
+
- Check coverage with: `pytest --cov=appstore_connect`
|
|
31
|
+
- Run type checking with: `mypy src/appstore_connect`
|
|
32
|
+
- Format code with: `black src/appstore_connect tests`
|
|
33
|
+
|
|
34
|
+
## Common Tasks
|
|
35
|
+
|
|
36
|
+
### Adding New API Endpoints
|
|
37
|
+
1. Add method to `AppStoreConnectAPI` class in `client.py`
|
|
38
|
+
2. Include proper error handling and rate limiting decorators
|
|
39
|
+
3. Add corresponding tests in `test_client.py`
|
|
40
|
+
4. Update documentation in `docs/API_REFERENCE.md`
|
|
41
|
+
|
|
42
|
+
### Updating Documentation
|
|
43
|
+
- API reference: `docs/API_REFERENCE.md`
|
|
44
|
+
- User guide: `docs/GETTING_STARTED.md`
|
|
45
|
+
- Troubleshooting: `docs/TROUBLESHOOTING.md`
|
|
46
|
+
- Changelog: `CHANGELOG.md`
|
|
47
|
+
|
|
48
|
+
## Important Notes
|
|
49
|
+
|
|
50
|
+
- Private keys should never be committed to the repository
|
|
51
|
+
- All API credentials should be loaded from environment variables or files
|
|
52
|
+
- Integration tests require valid API credentials (see `TESTING.md`)
|
|
53
|
+
- Examples should use placeholder values for sensitive data
|
|
54
|
+
|
|
55
|
+
## Release Process
|
|
56
|
+
|
|
57
|
+
1. Update version in `setup.py` and `__init__.py`
|
|
58
|
+
2. Update `CHANGELOG.md` with release notes
|
|
59
|
+
3. Create git tag: `git tag v0.1.0`
|
|
60
|
+
4. Push tag: `git push origin v0.1.0`
|
|
61
|
+
5. GitHub Actions will automatically publish to PyPI
|
|
62
|
+
|
|
63
|
+
## Helpful Commands
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Install development dependencies
|
|
67
|
+
pip install -e .[dev]
|
|
68
|
+
|
|
69
|
+
# Run all tests
|
|
70
|
+
pytest
|
|
71
|
+
|
|
72
|
+
# Run tests with verbose output
|
|
73
|
+
pytest -v --tb=long
|
|
74
|
+
|
|
75
|
+
# Run specific test file
|
|
76
|
+
pytest tests/test_client.py
|
|
77
|
+
|
|
78
|
+
# Check code coverage
|
|
79
|
+
pytest --cov=appstore_connect --cov-report=html --cov-report=term
|
|
80
|
+
|
|
81
|
+
# Format code
|
|
82
|
+
black src/appstore_connect tests examples
|
|
83
|
+
|
|
84
|
+
# Check formatting without making changes
|
|
85
|
+
black --check src/appstore_connect tests examples
|
|
86
|
+
|
|
87
|
+
# Run linting checks
|
|
88
|
+
flake8 src/appstore_connect tests examples
|
|
89
|
+
black --check src/appstore_connect tests examples
|
|
90
|
+
|
|
91
|
+
# Type checking
|
|
92
|
+
mypy src/appstore_connect
|
|
93
|
+
|
|
94
|
+
# Build package
|
|
95
|
+
python -m build
|
|
96
|
+
|
|
97
|
+
# Clean build artifacts
|
|
98
|
+
rm -rf build/ dist/ *.egg-info/ .coverage htmlcov/ .pytest_cache/ .mypy_cache/
|
|
99
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
100
|
+
find . -type f -name "*.pyc" -delete
|
|
101
|
+
|
|
102
|
+
# Run all checks (lint + type-check + tests)
|
|
103
|
+
flake8 src/appstore_connect tests examples && \
|
|
104
|
+
black --check src/appstore_connect tests examples && \
|
|
105
|
+
mypy src/appstore_connect && \
|
|
106
|
+
pytest
|
|
107
|
+
|
|
108
|
+
# Publish to PyPI (requires API token)
|
|
109
|
+
python -m build
|
|
110
|
+
python -m twine upload dist/*
|
|
111
|
+
|
|
112
|
+
# Publish to Test PyPI
|
|
113
|
+
python -m build
|
|
114
|
+
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
|
115
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chris Bick
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CLAUDE.md
|
|
5
|
+
include TESTING.md
|
|
6
|
+
include requirements.txt
|
|
7
|
+
include requirements-dev.txt
|
|
8
|
+
include pytest.ini
|
|
9
|
+
include tox.ini
|
|
10
|
+
include setup.py
|
|
11
|
+
include pyproject.toml
|
|
12
|
+
include Makefile
|
|
13
|
+
recursive-include appstore_connect *.py
|
|
14
|
+
recursive-include tests *.py
|
|
15
|
+
recursive-include examples *.py
|
|
16
|
+
recursive-include docs *.md
|
|
17
|
+
recursive-include utils *.py
|
|
18
|
+
recursive-exclude * __pycache__
|
|
19
|
+
recursive-exclude * *.py[co]
|
|
20
|
+
recursive-exclude * .DS_Store
|
|
21
|
+
global-exclude *.pyc
|
|
22
|
+
global-exclude *.pyo
|
|
23
|
+
global-exclude *.swp
|
|
24
|
+
global-exclude *~
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apple-appstore-connect-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A comprehensive Python client for the Apple App Store Connect API
|
|
5
|
+
Home-page: https://github.com/chrisbick/appstore-connect-client
|
|
6
|
+
Author: Chris Bick
|
|
7
|
+
Author-email: Chris Bick <chris@bickster.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/chrisbick/appstore-connect-client
|
|
10
|
+
Project-URL: Documentation, https://appstore-connect-client.readthedocs.io/
|
|
11
|
+
Project-URL: Repository, https://github.com/chrisbick/appstore-connect-client
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/chrisbick/appstore-connect-client/issues
|
|
13
|
+
Keywords: apple,app store connect,api,sales,metadata,ios,apps
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: requests>=2.31.0
|
|
29
|
+
Requires-Dist: pandas>=2.0.0
|
|
30
|
+
Requires-Dist: PyJWT>=2.8.0
|
|
31
|
+
Requires-Dist: cryptography>=41.0.0
|
|
32
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
33
|
+
Requires-Dist: ratelimit>=2.2.1
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-mock>=3.11.0; extra == "dev"
|
|
38
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
41
|
+
Dynamic: author
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
|
|
46
|
+
# appstore-connect-client
|
|
47
|
+
|
|
48
|
+
[](https://badge.fury.io/py/appstore-connect-client)
|
|
49
|
+
[](https://pypi.org/project/appstore-connect-client/)
|
|
50
|
+
[](LICENSE)
|
|
51
|
+
[](https://github.com/chrisbick/appstore-connect-client)
|
|
52
|
+
|
|
53
|
+
A comprehensive Python client for the Apple App Store Connect API, providing simple and intuitive interfaces for sales reporting, app metadata management, and advanced analytics.
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- 📊 **Sales & Financial Reporting** - Daily, weekly, monthly sales and revenue data
|
|
58
|
+
- 🎯 **App Metadata Management** - Update app listings, descriptions, and keywords
|
|
59
|
+
- 📈 **Advanced Analytics** - Period comparisons, performance ranking, trend analysis
|
|
60
|
+
- 💳 **Subscription Analytics** - Active subscriptions, events, and lifecycle metrics
|
|
61
|
+
- 🌍 **Localization Support** - Multi-language content management
|
|
62
|
+
- 🚀 **Batch Operations** - Update multiple apps simultaneously
|
|
63
|
+
- 🔐 **Secure Authentication** - JWT ES256 token-based auth
|
|
64
|
+
- ⚡ **Smart Rate Limiting** - Automatic handling of API limits (50 requests/hour)
|
|
65
|
+
- 🐼 **Pandas Integration** - DataFrames for easy data manipulation
|
|
66
|
+
- ✅ **Type Hints** - Full type support for better IDE experience
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install appstore-connect-client
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For development:
|
|
75
|
+
```bash
|
|
76
|
+
pip install appstore-connect-client[dev]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from appstore_connect import AppStoreConnectAPI
|
|
83
|
+
from datetime import date, timedelta
|
|
84
|
+
|
|
85
|
+
# Initialize the client
|
|
86
|
+
client = AppStoreConnectAPI(
|
|
87
|
+
key_id="your_key_id",
|
|
88
|
+
issuer_id="your_issuer_id",
|
|
89
|
+
private_key_path="/path/to/AuthKey_XXXXXX.p8",
|
|
90
|
+
vendor_number="your_vendor_number"
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Get yesterday's sales data
|
|
94
|
+
yesterday = date.today() - timedelta(days=1)
|
|
95
|
+
sales_df = client.get_sales_report(yesterday)
|
|
96
|
+
print(f"Revenue: ${sales_df['proceeds'].sum():,.2f}")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Authentication
|
|
100
|
+
|
|
101
|
+
### Prerequisites
|
|
102
|
+
|
|
103
|
+
1. Apple Developer Account with App Store Connect access
|
|
104
|
+
2. App Store Connect API Key ([generate here](https://appstoreconnect.apple.com/access/api))
|
|
105
|
+
3. Private key file (.p8) downloaded from App Store Connect
|
|
106
|
+
4. Vendor number from your App Store Connect account
|
|
107
|
+
|
|
108
|
+
### Setting up credentials
|
|
109
|
+
|
|
110
|
+
You can provide credentials in three ways:
|
|
111
|
+
|
|
112
|
+
#### 1. Direct parameters (recommended)
|
|
113
|
+
```python
|
|
114
|
+
client = AppStoreConnectAPI(
|
|
115
|
+
key_id="your_key_id",
|
|
116
|
+
issuer_id="your_issuer_id",
|
|
117
|
+
private_key_path="/path/to/private_key.p8",
|
|
118
|
+
vendor_number="your_vendor_number"
|
|
119
|
+
)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### 2. Environment variables
|
|
123
|
+
```bash
|
|
124
|
+
export APP_STORE_KEY_ID="your_key_id"
|
|
125
|
+
export APP_STORE_ISSUER_ID="your_issuer_id"
|
|
126
|
+
export APP_STORE_PRIVATE_KEY_PATH="/path/to/private_key.p8"
|
|
127
|
+
export APP_STORE_VENDOR_NUMBER="your_vendor_number"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
import os
|
|
132
|
+
client = AppStoreConnectAPI(
|
|
133
|
+
key_id=os.getenv('APP_STORE_KEY_ID'),
|
|
134
|
+
issuer_id=os.getenv('APP_STORE_ISSUER_ID'),
|
|
135
|
+
private_key_path=os.getenv('APP_STORE_PRIVATE_KEY_PATH'),
|
|
136
|
+
vendor_number=os.getenv('APP_STORE_VENDOR_NUMBER')
|
|
137
|
+
)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### 3. Using .env file
|
|
141
|
+
Create a `.env` file based on `.env.example` and the client will load it automatically in development.
|
|
142
|
+
|
|
143
|
+
## Usage Examples
|
|
144
|
+
|
|
145
|
+
### Sales Reporting
|
|
146
|
+
```python
|
|
147
|
+
# Get comprehensive 30-day analytics
|
|
148
|
+
from appstore_connect import create_report_processor
|
|
149
|
+
|
|
150
|
+
processor = create_report_processor(
|
|
151
|
+
key_id=os.getenv('APP_STORE_KEY_ID'),
|
|
152
|
+
issuer_id=os.getenv('APP_STORE_ISSUER_ID'),
|
|
153
|
+
private_key_path=os.getenv('APP_STORE_PRIVATE_KEY_PATH'),
|
|
154
|
+
vendor_number=os.getenv('APP_STORE_VENDOR_NUMBER')
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
summary = processor.get_sales_summary(days=30)
|
|
158
|
+
print(f"Total Revenue: ${summary['summary']['total_revenue']:,.2f}")
|
|
159
|
+
print(f"Total Units: {summary['summary']['total_units']:,}")
|
|
160
|
+
|
|
161
|
+
# Compare performance periods
|
|
162
|
+
comparison = processor.compare_periods(current_days=30, comparison_days=30)
|
|
163
|
+
revenue_change = comparison['changes']['total_revenue']['change_percent']
|
|
164
|
+
print(f"Revenue Change: {revenue_change:+.1f}%")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### App Metadata Management
|
|
168
|
+
```python
|
|
169
|
+
from appstore_connect import create_metadata_manager
|
|
170
|
+
|
|
171
|
+
manager = create_metadata_manager(
|
|
172
|
+
key_id=os.getenv('APP_STORE_KEY_ID'),
|
|
173
|
+
issuer_id=os.getenv('APP_STORE_ISSUER_ID'),
|
|
174
|
+
private_key_path=os.getenv('APP_STORE_PRIVATE_KEY_PATH'),
|
|
175
|
+
vendor_number=os.getenv('APP_STORE_VENDOR_NUMBER')
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# Update app listing
|
|
179
|
+
results = manager.update_app_listing(
|
|
180
|
+
app_id='123456789',
|
|
181
|
+
updates={
|
|
182
|
+
'name': 'My Awesome App',
|
|
183
|
+
'subtitle': 'The Best App Ever',
|
|
184
|
+
'description': 'This app will change your life...',
|
|
185
|
+
'keywords': 'productivity,utility,business'
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
# Batch update multiple apps
|
|
190
|
+
batch_updates = {
|
|
191
|
+
'123456789': {'subtitle': 'Productivity Booster'},
|
|
192
|
+
'987654321': {'subtitle': 'Entertainment Hub'}
|
|
193
|
+
}
|
|
194
|
+
results = manager.batch_update_apps(batch_updates)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### DataFrame Operations
|
|
198
|
+
```python
|
|
199
|
+
# Get sales data and calculate weekly totals
|
|
200
|
+
import pandas as pd
|
|
201
|
+
|
|
202
|
+
# Fetch multiple days efficiently
|
|
203
|
+
reports = client.fetch_multiple_days(days=90) # Automatically optimizes API calls
|
|
204
|
+
|
|
205
|
+
# Calculate weekly revenue
|
|
206
|
+
reports['week'] = pd.to_datetime(reports['begin_date']).dt.isocalendar().week
|
|
207
|
+
weekly_revenue = reports.groupby('week')['proceeds'].sum()
|
|
208
|
+
|
|
209
|
+
# Get top performing apps
|
|
210
|
+
top_apps = reports.groupby('app_name')['units'].sum().nlargest(10)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## API Reference
|
|
214
|
+
|
|
215
|
+
See [API Documentation](docs/API_REFERENCE.md) for complete reference.
|
|
216
|
+
|
|
217
|
+
### Core Components
|
|
218
|
+
|
|
219
|
+
- **AppStoreConnectAPI** - Main client for direct API access
|
|
220
|
+
- **ReportProcessor** - High-level analytics with advanced reporting
|
|
221
|
+
- **MetadataManager** - Portfolio management with batch operations
|
|
222
|
+
|
|
223
|
+
## Error Handling
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
from appstore_connect.exceptions import (
|
|
227
|
+
AuthenticationError,
|
|
228
|
+
RateLimitError,
|
|
229
|
+
ValidationError,
|
|
230
|
+
PermissionError
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
try:
|
|
234
|
+
sales_df = client.get_sales_report(date.today())
|
|
235
|
+
except AuthenticationError:
|
|
236
|
+
print("Check your API credentials")
|
|
237
|
+
except RateLimitError:
|
|
238
|
+
print("Rate limit exceeded - wait before retrying")
|
|
239
|
+
except PermissionError:
|
|
240
|
+
print("Insufficient API key permissions")
|
|
241
|
+
except ValidationError as e:
|
|
242
|
+
print(f"Invalid input: {e}")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Best Practices
|
|
246
|
+
|
|
247
|
+
1. **Reuse client instances** - Create once and reuse for multiple requests
|
|
248
|
+
2. **Use smart fetching** - Let the client optimize API calls for date ranges
|
|
249
|
+
3. **Handle rate limits** - Built-in retry logic, but be mindful of usage
|
|
250
|
+
4. **Leverage DataFrames** - Use pandas operations for data analysis
|
|
251
|
+
5. **Secure credentials** - Never commit credentials to version control
|
|
252
|
+
|
|
253
|
+
## Testing
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# Run all tests
|
|
257
|
+
pytest
|
|
258
|
+
|
|
259
|
+
# Run with coverage
|
|
260
|
+
pytest --cov=appstore_connect --cov-report=term-missing
|
|
261
|
+
|
|
262
|
+
# Run specific test file
|
|
263
|
+
pytest tests/test_client.py
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Contributing
|
|
267
|
+
|
|
268
|
+
1. Fork the repository
|
|
269
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
270
|
+
3. Install development dependencies: `pip install -e .[dev]`
|
|
271
|
+
4. Make your changes and add tests
|
|
272
|
+
5. Run tests: `pytest`
|
|
273
|
+
6. Check formatting: `black --check src/appstore_connect tests`
|
|
274
|
+
7. Format code: `black src/appstore_connect tests`
|
|
275
|
+
8. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
276
|
+
9. Push to the branch (`git push origin feature/amazing-feature`)
|
|
277
|
+
10. Open a Pull Request
|
|
278
|
+
|
|
279
|
+
See [CLAUDE.md](CLAUDE.md) for detailed development commands.
|
|
280
|
+
|
|
281
|
+
## Documentation
|
|
282
|
+
|
|
283
|
+
- 📚 [Getting Started](docs/GETTING_STARTED.md) - Setup and basic usage
|
|
284
|
+
- 🔧 [API Reference](docs/API_REFERENCE.md) - Complete API documentation
|
|
285
|
+
- 🚑 [Troubleshooting](docs/TROUBLESHOOTING.md) - Common issues and solutions
|
|
286
|
+
- 💡 [Examples](examples/) - Comprehensive usage examples
|
|
287
|
+
|
|
288
|
+
## License
|
|
289
|
+
|
|
290
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
291
|
+
|
|
292
|
+
## Support
|
|
293
|
+
|
|
294
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/chrisbick/appstore-connect-client/issues)
|
|
295
|
+
- 📖 **Documentation**: [Read the Docs](https://appstore-connect-client.readthedocs.io/)
|
|
296
|
+
- 💬 **Discussions**: [GitHub Discussions](https://github.com/chrisbick/appstore-connect-client/discussions)
|
|
297
|
+
|
|
298
|
+
## Changelog
|
|
299
|
+
|
|
300
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history and changes.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**Made with ❤️ for iOS developers and app analytics teams**
|