Skip to content
This repository was archived by the owner on Jan 31, 2021. It is now read-only.

Commit 32c99b8

Browse files
author
Shoma Okamoto
authored
Merge pull request #5 from shmokmt/feature/support-3.6
Support Python3.6.1
2 parents e7bc535 + 2c1373e commit 32c99b8

File tree

6 files changed

+33
-31
lines changed

6 files changed

+33
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ celerybeat.pid
106106

107107
# Environments
108108
.app_store_env
109+
.app_store_private_env
109110
.env
110111
.venv
111112
env/

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Python package for App Store Connect API.
44

55
![python_version](https://img.shields.io/pypi/pyversions/app-store-connect-client) ![LICENSE](https://img.shields.io/pypi/l/app-store-connect-client)
66

7-
It supports Python3.7+.
7+
It supports Python3.6.1+.
88

99
The complete documentation is [here](https://github.com/shmokmt/app-store-connect-client/wiki).
1010

@@ -65,7 +65,11 @@ print(json.dumps(results, indent=4))
6565
* Support 2FA Authentication
6666
* Docstring
6767
* Support Review API
68-
* Use async / await
68+
69+
## Credit
70+
71+
* [JanHalozan/iTunesConnectAnalytics](https://github.com/JanHalozan/iTunesConnectAnalytics)
72+
6973

7074
## Related Projects
7175

app_store_connect_client/analytics.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ def _login(self, username, password):
5353
if self.is_2fa_auth:
5454
print("Enter the 2FA code:")
5555
two_factor_auth_code = input()
56-
self._session.post(
56+
r = self._session.post(
5757
self._options["login_url"] + "/verify/trusteddevice/securitycode",
5858
headers=headers,
59-
data={"securityCode": {"code": two_factor_auth_code}},
59+
json={"securityCode": {"code": two_factor_auth_code}},
60+
)
61+
if r.status_code != 200:
62+
raise Exception("two factor auth code is invalid.")
63+
self._session.get(
64+
self._options["login_url"] + "/2sv/trust", headers=headers
6065
)
61-
r = self._session.post(
62-
self._options["login_url"] + "/2sv/trust", headers=headers
63-
)
6466
cookies = r.headers["set-cookie"]
6567
if cookies is None or len(cookies) == 0:
6668
raise Exception(

app_store_connect_client/dataclass.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
from dataclasses import dataclass
1+
from typing import NamedTuple
22

33

4-
@dataclass(frozen=True)
5-
class Frequency:
4+
class Frequency(NamedTuple):
65
days: str
76
weekly: str
87
monthly: str
98

109

11-
@dataclass(frozen=True)
12-
class Measures:
10+
class Measures(NamedTuple):
1311
installs: str
1412
uninstalls: str
1513
sessions: str
@@ -26,8 +24,7 @@ class Measures:
2624
page_view_unique: str
2725

2826

29-
@dataclass(frozen=True)
30-
class Dimension:
27+
class Dimension(NamedTuple):
3128
app_version: str
3229
campaigns: str
3330
device: str
@@ -39,8 +36,7 @@ class Dimension:
3936
source_type: str
4037

4138

42-
@dataclass(frozen=True)
43-
class DimensionFilterKey:
39+
class DimensionFilterKey(NamedTuple):
4440
app_purchase_week: str
4541
app_purchase_day: str
4642
app_purchase_month: str
@@ -53,16 +49,14 @@ class DimensionFilterKey:
5349
websites: str
5450

5551

56-
@dataclass(frozen=True)
57-
class Platform:
52+
class Platform(NamedTuple):
5853
iphone: str
5954
ipad: str
6055
ipod: str
6156
apple_tv: str
6257

6358

64-
@dataclass(frozen=True)
65-
class QueryType:
59+
class QueryType(NamedTuple):
6660
sources: str
6761
metrics: str
6862

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[tool.poetry]
22
name = "app-store-connect-client"
3-
version = "0.1.1"
3+
version = "0.0.0"
44
description = "Python package for App Store connect Analytics."
55
authors = ["shmokmt <shoma.okamoto@fuller.co.jp>"]
66
homepage = "https://github.com/shmokmt"
77
repository = "https://github.com/shmokmt/app-store-connect-client"
88
documentation = "https://github.com/shmokmt/app-store-connect-client/wiki"
99
license = "MIT"
1010
classifiers = [
11+
"Programming Language :: Python :: 3.6",
1112
"Programming Language :: Python :: 3.7",
1213
"License :: OSI Approved :: MIT License",
1314
"Topic :: Utilities",

0 commit comments

Comments
 (0)