jampp-reporting-api-client 0.3.0__tar.gz → 0.3.2__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.
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/CHANGELOG.rst +14 -0
- jampp_reporting_api_client-0.3.2/MANIFEST.in +4 -0
- jampp_reporting_api_client-0.3.2/PKG-INFO +140 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/README.rst +1 -1
- jampp_reporting_api_client-0.3.2/jampp_reporting_api_client.egg-info/PKG-INFO +140 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/jampp_reporting_api_client.egg-info/SOURCES.txt +4 -1
- jampp_reporting_api_client-0.3.2/jampp_reporting_api_client.egg-info/requires.txt +15 -0
- jampp_reporting_api_client-0.3.2/reporting_api_client/VERSION +1 -0
- jampp_reporting_api_client-0.3.2/requirements-dev.in +7 -0
- jampp_reporting_api_client-0.3.2/requirements.in +4 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/setup.py +4 -2
- jampp_reporting_api_client-0.3.2/tests/test_client.py +56 -0
- jampp_reporting_api_client-0.3.0/MANIFEST.in +0 -2
- jampp_reporting_api_client-0.3.0/PKG-INFO +0 -109
- jampp_reporting_api_client-0.3.0/jampp_reporting_api_client.egg-info/PKG-INFO +0 -109
- jampp_reporting_api_client-0.3.0/jampp_reporting_api_client.egg-info/requires.txt +0 -63
- jampp_reporting_api_client-0.3.0/reporting_api_client/VERSION +0 -1
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/jampp_reporting_api_client.egg-info/dependency_links.txt +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/jampp_reporting_api_client.egg-info/not-zip-safe +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/jampp_reporting_api_client.egg-info/top_level.txt +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/reporting_api_client/__init__.py +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/reporting_api_client/client.py +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/reporting_api_client/oauth/__init__.py +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/reporting_api_client/oauth/transport.py +0 -0
- {jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/setup.cfg +0 -0
|
@@ -15,6 +15,20 @@ When major components get significant changes worthy of mention, they
|
|
|
15
15
|
can be described in a Major section.
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
v0.3.2 - 2026-06-01
|
|
19
|
+
===================
|
|
20
|
+
|
|
21
|
+
Changed
|
|
22
|
+
-------
|
|
23
|
+
|
|
24
|
+
- Relax gql requirements to improve compatibility with older stacks
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
v0.3.1 - 2026-04-29
|
|
28
|
+
===================
|
|
29
|
+
|
|
30
|
+
Yanked
|
|
31
|
+
|
|
18
32
|
v0.3.0 - 2022-09-12
|
|
19
33
|
===================
|
|
20
34
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jampp_reporting_api_client
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Client for Reporting API.
|
|
5
|
+
Home-page: https://github.com/jampp/reporting-api-client
|
|
6
|
+
Author: Jampp
|
|
7
|
+
Author-email: data-infra@jampp.com
|
|
8
|
+
Description-Content-Type: text/x-rst
|
|
9
|
+
Requires-Dist: gql>=3.0.0
|
|
10
|
+
Requires-Dist: requests<3
|
|
11
|
+
Requires-Dist: requests_toolbelt<2,>=1.0.0
|
|
12
|
+
Requires-Dist: requests_oauthlib
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: mypy; extra == "dev"
|
|
15
|
+
Requires-Dist: pip-tools; extra == "dev"
|
|
16
|
+
Requires-Dist: pre-commit>2.9.2; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest; extra == "dev"
|
|
18
|
+
Requires-Dist: types-requests; extra == "dev"
|
|
19
|
+
Requires-Dist: twine; extra == "dev"
|
|
20
|
+
Provides-Extra: pandas
|
|
21
|
+
Requires-Dist: pandas; extra == "pandas"
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: provides-extra
|
|
28
|
+
Dynamic: requires-dist
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
====================
|
|
32
|
+
Reporting API Client
|
|
33
|
+
====================
|
|
34
|
+
|
|
35
|
+
This is a Python Client for `Jampp's Reporting API`_. For more information, check the `docs`_.
|
|
36
|
+
|
|
37
|
+
Features
|
|
38
|
+
========
|
|
39
|
+
|
|
40
|
+
* Execute Pivots in an user friendly manner.
|
|
41
|
+
* Execute raw GraphQL queries against the Reporting API.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Basic Usage
|
|
45
|
+
===========
|
|
46
|
+
|
|
47
|
+
.. code-block:: python
|
|
48
|
+
|
|
49
|
+
import os
|
|
50
|
+
|
|
51
|
+
from reporting_api_client import ReportingAPIClient
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
client = ReportingAPIClient(os.environ["CLIENT_ID"], os.environ["CLIENT_SECRET"])
|
|
55
|
+
query = """{
|
|
56
|
+
pivot(from: "2022-07-01", to: "2022-07-02", granularity: DAILY) {
|
|
57
|
+
results {
|
|
58
|
+
clicks
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}"""
|
|
62
|
+
|
|
63
|
+
result = client.query(query)
|
|
64
|
+
print(result)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
Executing the above code should output a result similar to the following:
|
|
68
|
+
|
|
69
|
+
.. code-block:: console
|
|
70
|
+
|
|
71
|
+
$ python example.py
|
|
72
|
+
{'pivot': {'results': [{'clicks': 123456}]}}
|
|
73
|
+
|
|
74
|
+
.. _`Jampp's Reporting API`: https://developers.jampp.com/docs/reporting-api/
|
|
75
|
+
.. _docs: https://developers.jampp.com/docs/reporting-api-client/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
.. _changelog:
|
|
79
|
+
|
|
80
|
+
==========
|
|
81
|
+
Change Log
|
|
82
|
+
==========
|
|
83
|
+
|
|
84
|
+
All notable changes to this project will be documented here.
|
|
85
|
+
|
|
86
|
+
Sort subsections like so: Added, Bugfixes, Improvements, Technical tasks.
|
|
87
|
+
Group anything an end user shouldn't care deeply about into technical
|
|
88
|
+
tasks, even if they're technically bugs. Only include as "bugfixes"
|
|
89
|
+
bugs with user-visible outcomes.
|
|
90
|
+
|
|
91
|
+
When major components get significant changes worthy of mention, they
|
|
92
|
+
can be described in a Major section.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
v0.3.2 - 2026-06-01
|
|
96
|
+
===================
|
|
97
|
+
|
|
98
|
+
Changed
|
|
99
|
+
-------
|
|
100
|
+
|
|
101
|
+
- Relax gql requirements to improve compatibility with older stacks
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
v0.3.1 - 2026-04-29
|
|
105
|
+
===================
|
|
106
|
+
|
|
107
|
+
Yanked
|
|
108
|
+
|
|
109
|
+
v0.3.0 - 2022-09-12
|
|
110
|
+
===================
|
|
111
|
+
|
|
112
|
+
Added
|
|
113
|
+
-----
|
|
114
|
+
|
|
115
|
+
- Add workflows for CI and publishing to PyPI.
|
|
116
|
+
- Host documentation publically.
|
|
117
|
+
|
|
118
|
+
Changed
|
|
119
|
+
-------
|
|
120
|
+
|
|
121
|
+
- Remove Jampp's refferences.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
v0.2.0 - 2022-08-29
|
|
125
|
+
===================
|
|
126
|
+
|
|
127
|
+
Added
|
|
128
|
+
-----
|
|
129
|
+
|
|
130
|
+
- Remove need of introspection on client.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
v0.1.0 - 2022-07-19
|
|
134
|
+
===================
|
|
135
|
+
|
|
136
|
+
Added
|
|
137
|
+
-----
|
|
138
|
+
|
|
139
|
+
- Add base ``ReportingAPIClient`` implementation using OAuth for authentication
|
|
140
|
+
- Rename to ``reporting_api_client``.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jampp_reporting_api_client
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Client for Reporting API.
|
|
5
|
+
Home-page: https://github.com/jampp/reporting-api-client
|
|
6
|
+
Author: Jampp
|
|
7
|
+
Author-email: data-infra@jampp.com
|
|
8
|
+
Description-Content-Type: text/x-rst
|
|
9
|
+
Requires-Dist: gql>=3.0.0
|
|
10
|
+
Requires-Dist: requests<3
|
|
11
|
+
Requires-Dist: requests_toolbelt<2,>=1.0.0
|
|
12
|
+
Requires-Dist: requests_oauthlib
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: mypy; extra == "dev"
|
|
15
|
+
Requires-Dist: pip-tools; extra == "dev"
|
|
16
|
+
Requires-Dist: pre-commit>2.9.2; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest; extra == "dev"
|
|
18
|
+
Requires-Dist: types-requests; extra == "dev"
|
|
19
|
+
Requires-Dist: twine; extra == "dev"
|
|
20
|
+
Provides-Extra: pandas
|
|
21
|
+
Requires-Dist: pandas; extra == "pandas"
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: provides-extra
|
|
28
|
+
Dynamic: requires-dist
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
====================
|
|
32
|
+
Reporting API Client
|
|
33
|
+
====================
|
|
34
|
+
|
|
35
|
+
This is a Python Client for `Jampp's Reporting API`_. For more information, check the `docs`_.
|
|
36
|
+
|
|
37
|
+
Features
|
|
38
|
+
========
|
|
39
|
+
|
|
40
|
+
* Execute Pivots in an user friendly manner.
|
|
41
|
+
* Execute raw GraphQL queries against the Reporting API.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
Basic Usage
|
|
45
|
+
===========
|
|
46
|
+
|
|
47
|
+
.. code-block:: python
|
|
48
|
+
|
|
49
|
+
import os
|
|
50
|
+
|
|
51
|
+
from reporting_api_client import ReportingAPIClient
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
client = ReportingAPIClient(os.environ["CLIENT_ID"], os.environ["CLIENT_SECRET"])
|
|
55
|
+
query = """{
|
|
56
|
+
pivot(from: "2022-07-01", to: "2022-07-02", granularity: DAILY) {
|
|
57
|
+
results {
|
|
58
|
+
clicks
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}"""
|
|
62
|
+
|
|
63
|
+
result = client.query(query)
|
|
64
|
+
print(result)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
Executing the above code should output a result similar to the following:
|
|
68
|
+
|
|
69
|
+
.. code-block:: console
|
|
70
|
+
|
|
71
|
+
$ python example.py
|
|
72
|
+
{'pivot': {'results': [{'clicks': 123456}]}}
|
|
73
|
+
|
|
74
|
+
.. _`Jampp's Reporting API`: https://developers.jampp.com/docs/reporting-api/
|
|
75
|
+
.. _docs: https://developers.jampp.com/docs/reporting-api-client/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
.. _changelog:
|
|
79
|
+
|
|
80
|
+
==========
|
|
81
|
+
Change Log
|
|
82
|
+
==========
|
|
83
|
+
|
|
84
|
+
All notable changes to this project will be documented here.
|
|
85
|
+
|
|
86
|
+
Sort subsections like so: Added, Bugfixes, Improvements, Technical tasks.
|
|
87
|
+
Group anything an end user shouldn't care deeply about into technical
|
|
88
|
+
tasks, even if they're technically bugs. Only include as "bugfixes"
|
|
89
|
+
bugs with user-visible outcomes.
|
|
90
|
+
|
|
91
|
+
When major components get significant changes worthy of mention, they
|
|
92
|
+
can be described in a Major section.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
v0.3.2 - 2026-06-01
|
|
96
|
+
===================
|
|
97
|
+
|
|
98
|
+
Changed
|
|
99
|
+
-------
|
|
100
|
+
|
|
101
|
+
- Relax gql requirements to improve compatibility with older stacks
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
v0.3.1 - 2026-04-29
|
|
105
|
+
===================
|
|
106
|
+
|
|
107
|
+
Yanked
|
|
108
|
+
|
|
109
|
+
v0.3.0 - 2022-09-12
|
|
110
|
+
===================
|
|
111
|
+
|
|
112
|
+
Added
|
|
113
|
+
-----
|
|
114
|
+
|
|
115
|
+
- Add workflows for CI and publishing to PyPI.
|
|
116
|
+
- Host documentation publically.
|
|
117
|
+
|
|
118
|
+
Changed
|
|
119
|
+
-------
|
|
120
|
+
|
|
121
|
+
- Remove Jampp's refferences.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
v0.2.0 - 2022-08-29
|
|
125
|
+
===================
|
|
126
|
+
|
|
127
|
+
Added
|
|
128
|
+
-----
|
|
129
|
+
|
|
130
|
+
- Remove need of introspection on client.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
v0.1.0 - 2022-07-19
|
|
134
|
+
===================
|
|
135
|
+
|
|
136
|
+
Added
|
|
137
|
+
-----
|
|
138
|
+
|
|
139
|
+
- Add base ``ReportingAPIClient`` implementation using OAuth for authentication
|
|
140
|
+
- Rename to ``reporting_api_client``.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
CHANGELOG.rst
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.rst
|
|
4
|
+
requirements-dev.in
|
|
5
|
+
requirements.in
|
|
4
6
|
setup.cfg
|
|
5
7
|
setup.py
|
|
6
8
|
jampp_reporting_api_client.egg-info/PKG-INFO
|
|
@@ -13,4 +15,5 @@ reporting_api_client/VERSION
|
|
|
13
15
|
reporting_api_client/__init__.py
|
|
14
16
|
reporting_api_client/client.py
|
|
15
17
|
reporting_api_client/oauth/__init__.py
|
|
16
|
-
reporting_api_client/oauth/transport.py
|
|
18
|
+
reporting_api_client/oauth/transport.py
|
|
19
|
+
tests/test_client.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.2
|
|
@@ -17,7 +17,9 @@ def parse_requirements(filename):
|
|
|
17
17
|
]
|
|
18
18
|
# Remove pip flags
|
|
19
19
|
requirements = [
|
|
20
|
-
line for line in requirements
|
|
20
|
+
line for line in requirements
|
|
21
|
+
if not line.strip().startswith("--")
|
|
22
|
+
and not line.strip().startswith("-r")
|
|
21
23
|
]
|
|
22
24
|
# Remove inline comments
|
|
23
25
|
requirements = [
|
|
@@ -54,7 +56,7 @@ setup(
|
|
|
54
56
|
author_email="data-infra@jampp.com",
|
|
55
57
|
install_requires=[parse_requirements("requirements.in")],
|
|
56
58
|
extras_require={
|
|
57
|
-
"dev": parse_requirements("requirements-dev.
|
|
59
|
+
"dev": parse_requirements("requirements-dev.in"),
|
|
58
60
|
"pandas": ["pandas"],
|
|
59
61
|
},
|
|
60
62
|
long_description=readme + "\n\n" + history,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from unittest import TestCase
|
|
3
|
+
from unittest.mock import patch, MagicMock
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from reporting_api_client.client import dict2object, ReportingAPIClient
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestClient(TestCase):
|
|
10
|
+
@patch("reporting_api_client.client.OAuth2Transport")
|
|
11
|
+
def setUp(self, transport_mock):
|
|
12
|
+
self.client = ReportingAPIClient(
|
|
13
|
+
"client_id",
|
|
14
|
+
"client_secret",
|
|
15
|
+
api_url="api_url",
|
|
16
|
+
auth_token_url="auth_token_url",
|
|
17
|
+
)
|
|
18
|
+
self.transport_mock = transport_mock
|
|
19
|
+
|
|
20
|
+
def test_dict2object(self):
|
|
21
|
+
self.assertEqual(dict2object({"a": "b"}), '{ a: "b" }')
|
|
22
|
+
self.assertEqual(dict2object({"a": 1}), "{ a: 1 }")
|
|
23
|
+
self.assertEqual(dict2object({"a": 1.1}), "{ a: 1.1 }")
|
|
24
|
+
self.assertEqual(dict2object({"a": {"b": "c"}}), '{ a: { b: "c" } }')
|
|
25
|
+
|
|
26
|
+
def test_init(self):
|
|
27
|
+
self.transport_mock.assert_called_with(
|
|
28
|
+
"api_url", "client_id", "client_secret", "auth_token_url"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
def test_pivot(self):
|
|
32
|
+
to_frame_mock = MagicMock()
|
|
33
|
+
self.client.to_frame = to_frame_mock
|
|
34
|
+
self.client.pivot(
|
|
35
|
+
from_=datetime.datetime(2022, 1, 1),
|
|
36
|
+
to_=datetime.datetime(2022, 1, 2),
|
|
37
|
+
metrics=["clicks", "installs"],
|
|
38
|
+
granularity="DAILY",
|
|
39
|
+
filter_={"campaignId": {"isIn": [1, 2, 3]}},
|
|
40
|
+
context={"sqlTimeZone": "America/Buenos_Aires"},
|
|
41
|
+
dimensions=["date", "app"],
|
|
42
|
+
cohort_type="TOUCH",
|
|
43
|
+
cohort_window=datetime.timedelta(hours=10),
|
|
44
|
+
cleanup={"clicks": {"greaterThan": 1}},
|
|
45
|
+
)
|
|
46
|
+
query = to_frame_mock.call_args[0][0]
|
|
47
|
+
self.assertRegex(query, r"from: \"2022-01-01T00:00:00\"")
|
|
48
|
+
self.assertRegex(query, r"to: \"2022-01-02T00:00:00\"")
|
|
49
|
+
self.assertRegex(query, r"granularity: DAILY")
|
|
50
|
+
self.assertRegex(query, r"filter: \{ campaignId: \{ isIn: \[1, 2, 3\] \} \}")
|
|
51
|
+
self.assertRegex(
|
|
52
|
+
query, r"context: \{ sqlTimeZone: \"America\/Buenos_Aires\" \}"
|
|
53
|
+
)
|
|
54
|
+
self.assertRegex(query, r"cohortType: TOUCH")
|
|
55
|
+
self.assertRegex(query, r"cohortWindow: { period: HOURS, amount: 10 }")
|
|
56
|
+
self.assertRegex(query, r"results \{ date, app, clicks, installs \}")
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: jampp_reporting_api_client
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Client for Reporting API.
|
|
5
|
-
Home-page: https://github.com/jampp/reporting-api-client
|
|
6
|
-
Author: Jampp
|
|
7
|
-
Author-email: data-infra@jampp.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Description: ====================
|
|
10
|
-
Reporting API Client
|
|
11
|
-
====================
|
|
12
|
-
|
|
13
|
-
This is a Python Client for `Jampp's Reporting API`_. For more information, check the `docs`.
|
|
14
|
-
|
|
15
|
-
Features
|
|
16
|
-
========
|
|
17
|
-
|
|
18
|
-
* Execute Pivots in an user friendly manner.
|
|
19
|
-
* Execute raw GraphQL queries against the Reporting API.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Basic Usage
|
|
23
|
-
===========
|
|
24
|
-
|
|
25
|
-
.. code-block:: python
|
|
26
|
-
|
|
27
|
-
import os
|
|
28
|
-
|
|
29
|
-
from reporting_api_client import ReportingAPIClient
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
client = ReportingAPIClient(os.environ["CLIENT_ID"], os.environ["CLIENT_SECRET"])
|
|
33
|
-
query = """{
|
|
34
|
-
pivot(from: "2022-07-01", to: "2022-07-02", granularity: DAILY) {
|
|
35
|
-
results {
|
|
36
|
-
clicks
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}"""
|
|
40
|
-
|
|
41
|
-
result = client.query(query)
|
|
42
|
-
print(result)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Executing the above code should output a result similar to the following:
|
|
46
|
-
|
|
47
|
-
.. code-block:: console
|
|
48
|
-
|
|
49
|
-
$ python example.py
|
|
50
|
-
{'pivot': {'results': [{'clicks': 123456}]}}
|
|
51
|
-
|
|
52
|
-
.. _`Jampp's Reporting API`: https://developers.jampp.com/docs/reporting-api/
|
|
53
|
-
.. _docs: https://developers.jampp.com/docs/reporting-api-client/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.. _changelog:
|
|
57
|
-
|
|
58
|
-
==========
|
|
59
|
-
Change Log
|
|
60
|
-
==========
|
|
61
|
-
|
|
62
|
-
All notable changes to this project will be documented here.
|
|
63
|
-
|
|
64
|
-
Sort subsections like so: Added, Bugfixes, Improvements, Technical tasks.
|
|
65
|
-
Group anything an end user shouldn't care deeply about into technical
|
|
66
|
-
tasks, even if they're technically bugs. Only include as "bugfixes"
|
|
67
|
-
bugs with user-visible outcomes.
|
|
68
|
-
|
|
69
|
-
When major components get significant changes worthy of mention, they
|
|
70
|
-
can be described in a Major section.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
v0.3.0 - 2022-09-12
|
|
74
|
-
===================
|
|
75
|
-
|
|
76
|
-
Added
|
|
77
|
-
-----
|
|
78
|
-
|
|
79
|
-
- Add workflows for CI and publishing to PyPI.
|
|
80
|
-
- Host documentation publically.
|
|
81
|
-
|
|
82
|
-
Changed
|
|
83
|
-
-------
|
|
84
|
-
|
|
85
|
-
- Remove Jampp's refferences.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
v0.2.0 - 2022-08-29
|
|
89
|
-
===================
|
|
90
|
-
|
|
91
|
-
Added
|
|
92
|
-
-----
|
|
93
|
-
|
|
94
|
-
- Remove need of introspection on client.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
v0.1.0 - 2022-07-19
|
|
98
|
-
===================
|
|
99
|
-
|
|
100
|
-
Added
|
|
101
|
-
-----
|
|
102
|
-
|
|
103
|
-
- Add base ``ReportingAPIClient`` implementation using OAuth for authentication
|
|
104
|
-
- Rename to ``reporting_api_client``.
|
|
105
|
-
|
|
106
|
-
Platform: UNKNOWN
|
|
107
|
-
Description-Content-Type: text/x-rst
|
|
108
|
-
Provides-Extra: dev
|
|
109
|
-
Provides-Extra: pandas
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: jampp-reporting-api-client
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Client for Reporting API.
|
|
5
|
-
Home-page: https://github.com/jampp/reporting-api-client
|
|
6
|
-
Author: Jampp
|
|
7
|
-
Author-email: data-infra@jampp.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Description: ====================
|
|
10
|
-
Reporting API Client
|
|
11
|
-
====================
|
|
12
|
-
|
|
13
|
-
This is a Python Client for `Jampp's Reporting API`_. For more information, check the `docs`.
|
|
14
|
-
|
|
15
|
-
Features
|
|
16
|
-
========
|
|
17
|
-
|
|
18
|
-
* Execute Pivots in an user friendly manner.
|
|
19
|
-
* Execute raw GraphQL queries against the Reporting API.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Basic Usage
|
|
23
|
-
===========
|
|
24
|
-
|
|
25
|
-
.. code-block:: python
|
|
26
|
-
|
|
27
|
-
import os
|
|
28
|
-
|
|
29
|
-
from reporting_api_client import ReportingAPIClient
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
client = ReportingAPIClient(os.environ["CLIENT_ID"], os.environ["CLIENT_SECRET"])
|
|
33
|
-
query = """{
|
|
34
|
-
pivot(from: "2022-07-01", to: "2022-07-02", granularity: DAILY) {
|
|
35
|
-
results {
|
|
36
|
-
clicks
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}"""
|
|
40
|
-
|
|
41
|
-
result = client.query(query)
|
|
42
|
-
print(result)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Executing the above code should output a result similar to the following:
|
|
46
|
-
|
|
47
|
-
.. code-block:: console
|
|
48
|
-
|
|
49
|
-
$ python example.py
|
|
50
|
-
{'pivot': {'results': [{'clicks': 123456}]}}
|
|
51
|
-
|
|
52
|
-
.. _`Jampp's Reporting API`: https://developers.jampp.com/docs/reporting-api/
|
|
53
|
-
.. _docs: https://developers.jampp.com/docs/reporting-api-client/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.. _changelog:
|
|
57
|
-
|
|
58
|
-
==========
|
|
59
|
-
Change Log
|
|
60
|
-
==========
|
|
61
|
-
|
|
62
|
-
All notable changes to this project will be documented here.
|
|
63
|
-
|
|
64
|
-
Sort subsections like so: Added, Bugfixes, Improvements, Technical tasks.
|
|
65
|
-
Group anything an end user shouldn't care deeply about into technical
|
|
66
|
-
tasks, even if they're technically bugs. Only include as "bugfixes"
|
|
67
|
-
bugs with user-visible outcomes.
|
|
68
|
-
|
|
69
|
-
When major components get significant changes worthy of mention, they
|
|
70
|
-
can be described in a Major section.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
v0.3.0 - 2022-09-12
|
|
74
|
-
===================
|
|
75
|
-
|
|
76
|
-
Added
|
|
77
|
-
-----
|
|
78
|
-
|
|
79
|
-
- Add workflows for CI and publishing to PyPI.
|
|
80
|
-
- Host documentation publically.
|
|
81
|
-
|
|
82
|
-
Changed
|
|
83
|
-
-------
|
|
84
|
-
|
|
85
|
-
- Remove Jampp's refferences.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
v0.2.0 - 2022-08-29
|
|
89
|
-
===================
|
|
90
|
-
|
|
91
|
-
Added
|
|
92
|
-
-----
|
|
93
|
-
|
|
94
|
-
- Remove need of introspection on client.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
v0.1.0 - 2022-07-19
|
|
98
|
-
===================
|
|
99
|
-
|
|
100
|
-
Added
|
|
101
|
-
-----
|
|
102
|
-
|
|
103
|
-
- Add base ``ReportingAPIClient`` implementation using OAuth for authentication
|
|
104
|
-
- Rename to ``reporting_api_client``.
|
|
105
|
-
|
|
106
|
-
Platform: UNKNOWN
|
|
107
|
-
Description-Content-Type: text/x-rst
|
|
108
|
-
Provides-Extra: dev
|
|
109
|
-
Provides-Extra: pandas
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
gql[requests]>=3.0.0
|
|
2
|
-
requests_oauthlib
|
|
3
|
-
|
|
4
|
-
[dev]
|
|
5
|
-
attrs==21.4.0
|
|
6
|
-
backoff==2.1.2
|
|
7
|
-
bleach==5.0.1
|
|
8
|
-
build==0.8.0
|
|
9
|
-
certifi==2022.6.15
|
|
10
|
-
cfgv==3.3.1
|
|
11
|
-
charset-normalizer==2.1.0
|
|
12
|
-
click==8.1.3
|
|
13
|
-
commonmark==0.9.1
|
|
14
|
-
distlib==0.3.5
|
|
15
|
-
docutils==0.19
|
|
16
|
-
filelock==3.7.1
|
|
17
|
-
gql[requests]==3.4.0
|
|
18
|
-
graphql-core==3.2.1
|
|
19
|
-
identify==2.5.1
|
|
20
|
-
idna==3.3
|
|
21
|
-
importlib-metadata==4.12.0
|
|
22
|
-
iniconfig==1.1.1
|
|
23
|
-
keyring==23.7.0
|
|
24
|
-
multidict==6.0.2
|
|
25
|
-
mypy==0.971
|
|
26
|
-
mypy-extensions==0.4.3
|
|
27
|
-
nodeenv==1.7.0
|
|
28
|
-
oauthlib==3.2.0
|
|
29
|
-
packaging==21.3
|
|
30
|
-
pep517==0.12.0
|
|
31
|
-
pip-tools==6.8.0
|
|
32
|
-
pkginfo==1.8.3
|
|
33
|
-
platformdirs==2.5.2
|
|
34
|
-
pluggy==1.0.0
|
|
35
|
-
pre-commit==2.20.0
|
|
36
|
-
py==1.11.0
|
|
37
|
-
pygments==2.12.0
|
|
38
|
-
pyparsing==3.0.9
|
|
39
|
-
pytest==7.1.2
|
|
40
|
-
pyyaml==6.0
|
|
41
|
-
readme-renderer==35.0
|
|
42
|
-
requests==2.28.1
|
|
43
|
-
requests-oauthlib==1.3.1
|
|
44
|
-
requests-toolbelt==0.9.1
|
|
45
|
-
rfc3986==2.0.0
|
|
46
|
-
rich==12.5.1
|
|
47
|
-
six==1.16.0
|
|
48
|
-
toml==0.10.2
|
|
49
|
-
tomli==2.0.1
|
|
50
|
-
twine==4.0.1
|
|
51
|
-
typed-ast==1.5.4
|
|
52
|
-
types-requests==2.28.9
|
|
53
|
-
types-urllib3==1.26.23
|
|
54
|
-
typing-extensions==4.3.0
|
|
55
|
-
urllib3==1.26.10
|
|
56
|
-
virtualenv==20.15.1
|
|
57
|
-
webencodings==0.5.1
|
|
58
|
-
wheel==0.37.1
|
|
59
|
-
yarl==1.7.2
|
|
60
|
-
zipp==3.8.1
|
|
61
|
-
|
|
62
|
-
[pandas]
|
|
63
|
-
pandas
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.3.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jampp_reporting_api_client-0.3.0 → jampp_reporting_api_client-0.3.2}/reporting_api_client/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|