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

Commit

Permalink
Merge pull request #5 from shmokmt/feature/support-3.6
Browse files Browse the repository at this point in the history
Support Python3.6.1
  • Loading branch information
Shoma Okamoto authored Apr 30, 2020
2 parents e7bc535 + 2c1373e commit 32c99b8
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ celerybeat.pid

# Environments
.app_store_env
.app_store_private_env
.env
.venv
env/
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Python package for App Store Connect API.

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

It supports Python3.7+.
It supports Python3.6.1+.

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

Expand Down Expand Up @@ -65,7 +65,11 @@ print(json.dumps(results, indent=4))
* Support 2FA Authentication
* Docstring
* Support Review API
* Use async / await

## Credit

* [JanHalozan/iTunesConnectAnalytics](https://github.com/JanHalozan/iTunesConnectAnalytics)


## Related Projects

Expand Down
12 changes: 7 additions & 5 deletions app_store_connect_client/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ def _login(self, username, password):
if self.is_2fa_auth:
print("Enter the 2FA code:")
two_factor_auth_code = input()
self._session.post(
r = self._session.post(
self._options["login_url"] + "/verify/trusteddevice/securitycode",
headers=headers,
data={"securityCode": {"code": two_factor_auth_code}},
json={"securityCode": {"code": two_factor_auth_code}},
)
if r.status_code != 200:
raise Exception("two factor auth code is invalid.")
self._session.get(
self._options["login_url"] + "/2sv/trust", headers=headers
)
r = self._session.post(
self._options["login_url"] + "/2sv/trust", headers=headers
)
cookies = r.headers["set-cookie"]
if cookies is None or len(cookies) == 0:
raise Exception(
Expand Down
20 changes: 7 additions & 13 deletions app_store_connect_client/dataclass.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from dataclasses import dataclass
from typing import NamedTuple


@dataclass(frozen=True)
class Frequency:
class Frequency(NamedTuple):
days: str
weekly: str
monthly: str


@dataclass(frozen=True)
class Measures:
class Measures(NamedTuple):
installs: str
uninstalls: str
sessions: str
Expand All @@ -26,8 +24,7 @@ class Measures:
page_view_unique: str


@dataclass(frozen=True)
class Dimension:
class Dimension(NamedTuple):
app_version: str
campaigns: str
device: str
Expand All @@ -39,8 +36,7 @@ class Dimension:
source_type: str


@dataclass(frozen=True)
class DimensionFilterKey:
class DimensionFilterKey(NamedTuple):
app_purchase_week: str
app_purchase_day: str
app_purchase_month: str
Expand All @@ -53,16 +49,14 @@ class DimensionFilterKey:
websites: str


@dataclass(frozen=True)
class Platform:
class Platform(NamedTuple):
iphone: str
ipad: str
ipod: str
apple_tv: str


@dataclass(frozen=True)
class QueryType:
class QueryType(NamedTuple):
sources: str
metrics: str

Expand Down
20 changes: 10 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[tool.poetry]
name = "app-store-connect-client"
version = "0.1.1"
version = "0.0.0"
description = "Python package for App Store connect Analytics."
authors = ["shmokmt <shoma.okamoto@fuller.co.jp>"]
homepage = "https://github.com/shmokmt"
repository = "https://github.com/shmokmt/app-store-connect-client"
documentation = "https://github.com/shmokmt/app-store-connect-client/wiki"
license = "MIT"
classifiers = [
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: MIT License",
"Topic :: Utilities",
Expand Down

0 comments on commit 32c99b8

Please sign in to comment.