|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 3, |
6 | | - "metadata": {}, |
7 | | - "outputs": [], |
8 | | - "source": [ |
9 | | - "import analytics.api as ga\n", |
10 | | - "import analytics.sheets_api as sheets\n", |
11 | | - "import analytics.sheets_elements as elements\n", |
12 | | - "import analytics.entities as e\n", |
13 | | - "import pandas as pd\n", |
14 | | - "import gspread\n", |
15 | | - "from constants import *" |
16 | | - ] |
17 | | - }, |
18 | | - { |
19 | | - "cell_type": "code", |
20 | | - "execution_count": 4, |
| 5 | + "execution_count": 2, |
21 | 6 | "metadata": {}, |
22 | 7 | "outputs": [ |
23 | 8 | { |
|
34 | 19 | }, |
35 | 20 | { |
36 | 21 | "cell_type": "code", |
37 | | - "execution_count": null, |
| 22 | + "execution_count": 3, |
| 23 | + "metadata": {}, |
| 24 | + "outputs": [], |
| 25 | + "source": [ |
| 26 | + "import analytics.api as ga\n", |
| 27 | + "import analytics.sheets_api as sheets\n", |
| 28 | + "import analytics.sheets_elements as elements\n", |
| 29 | + "import analytics.entities as e\n", |
| 30 | + "import pandas as pd\n", |
| 31 | + "import gspread\n", |
| 32 | + "from constants import *\n", |
| 33 | + "import utils" |
| 34 | + ] |
| 35 | + }, |
| 36 | + { |
| 37 | + "cell_type": "code", |
| 38 | + "execution_count": 4, |
38 | 39 | "metadata": {}, |
39 | 40 | "outputs": [ |
40 | 41 | { |
41 | 42 | "name": "stdout", |
42 | 43 | "output_type": "stream", |
43 | 44 | "text": [ |
44 | | - "Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=274560362763-p5netdrssq6r02lcfan6s157m6d65rqe.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8082%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets&state=3TOrvrS8EuGJvNWqEnjqNIlknGfZW7&access_type=offline\n" |
| 45 | + "Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=274560362763-p5netdrssq6r02lcfan6s157m6d65rqe.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8082%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fspreadsheets&state=P3M0s2lsdDE4jDwfNdfekOCqsMsZpJ&access_type=offline\n" |
45 | 46 | ] |
46 | 47 | } |
47 | 48 | ], |
|
82 | 83 | }, |
83 | 84 | { |
84 | 85 | "cell_type": "code", |
85 | | - "execution_count": 6, |
| 86 | + "execution_count": 5, |
86 | 87 | "metadata": {}, |
87 | 88 | "outputs": [], |
88 | 89 | "source": [ |
89 | 90 | "df_monthly_pageviews = elements.get_page_views_over_time_df(anvil_catalog_params_all_time)\n", |
90 | | - "df_pageviews = elements.get_page_views_change(anvil_catalog_params, START_DATE_CURRENT, END_DATE_CURRENT, START_DATE_PRIOR, END_DATE_PRIOR)\n", |
| 91 | + "df_pageviews = utils.add_dataset_titles(\n", |
| 92 | + " elements.get_page_views_change(anvil_catalog_params, START_DATE_CURRENT, END_DATE_CURRENT, START_DATE_PRIOR, END_DATE_PRIOR)\n", |
| 93 | + ")\n", |
91 | 94 | "df_outbound = elements.get_outbound_links_change(anvil_catalog_params, START_DATE_CURRENT, END_DATE_CURRENT, START_DATE_PRIOR, END_DATE_PRIOR)" |
92 | 95 | ] |
93 | 96 | }, |
94 | 97 | { |
95 | 98 | "cell_type": "code", |
96 | | - "execution_count": 7, |
| 99 | + "execution_count": 6, |
97 | 100 | "metadata": {}, |
98 | 101 | "outputs": [ |
99 | 102 | { |
100 | 103 | "data": { |
101 | 104 | "text/plain": [ |
102 | | - "{'spreadsheetId': '1ueSQdU9pTa1qPptkNc4vk4xoHuJgP6gNcQ7exRxN9y0',\n", |
103 | | - " 'replies': [{'addChart': {'chart': {'chartId': 113619751,\n", |
| 105 | + "{'spreadsheetId': '1yg5dDlhe7PX02nin9FWbDLMimY1UhwI4yszpcfCiRSQ',\n", |
| 106 | + " 'replies': [{'addChart': {'chart': {'chartId': 1605255347,\n", |
104 | 107 | " 'spec': {'title': 'Pageviews and Users Over Time',\n", |
105 | 108 | " 'basicChart': {'chartType': 'LINE',\n", |
106 | 109 | " 'axis': [{'position': 'BOTTOM_AXIS', 'viewWindowOptions': {}},\n", |
107 | 110 | " {'position': 'LEFT_AXIS', 'viewWindowOptions': {}}],\n", |
108 | | - " 'domains': [{'domain': {'sourceRange': {'sources': [{'sheetId': 388329788,\n", |
| 111 | + " 'domains': [{'domain': {'sourceRange': {'sources': [{'sheetId': 1535415780,\n", |
109 | 112 | " 'startRowIndex': 0,\n", |
110 | | - " 'endRowIndex': 13,\n", |
| 113 | + " 'endRowIndex': 24,\n", |
111 | 114 | " 'startColumnIndex': 0,\n", |
112 | 115 | " 'endColumnIndex': 1}]}}}],\n", |
113 | | - " 'series': [{'series': {'sourceRange': {'sources': [{'sheetId': 388329788,\n", |
| 116 | + " 'series': [{'series': {'sourceRange': {'sources': [{'sheetId': 1535415780,\n", |
114 | 117 | " 'startRowIndex': 0,\n", |
115 | | - " 'endRowIndex': 13,\n", |
| 118 | + " 'endRowIndex': 24,\n", |
116 | 119 | " 'startColumnIndex': 1,\n", |
117 | 120 | " 'endColumnIndex': 2}]}},\n", |
118 | 121 | " 'targetAxis': 'LEFT_AXIS'},\n", |
119 | | - " {'series': {'sourceRange': {'sources': [{'sheetId': 388329788,\n", |
| 122 | + " {'series': {'sourceRange': {'sources': [{'sheetId': 1535415780,\n", |
120 | 123 | " 'startRowIndex': 0,\n", |
121 | | - " 'endRowIndex': 13,\n", |
| 124 | + " 'endRowIndex': 24,\n", |
122 | 125 | " 'startColumnIndex': 2,\n", |
123 | 126 | " 'endColumnIndex': 3}]}},\n", |
124 | 127 | " 'targetAxis': 'LEFT_AXIS'}],\n", |
125 | 128 | " 'headerCount': 1},\n", |
126 | 129 | " 'hiddenDimensionStrategy': 'SKIP_HIDDEN_ROWS_AND_COLUMNS',\n", |
127 | 130 | " 'titleTextFormat': {'fontFamily': 'Roboto'},\n", |
128 | 131 | " 'fontName': 'Roboto'},\n", |
129 | | - " 'position': {'overlayPosition': {'anchorCell': {'sheetId': 388329788,\n", |
| 132 | + " 'position': {'overlayPosition': {'anchorCell': {'sheetId': 1535415780,\n", |
130 | 133 | " 'columnIndex': 5},\n", |
131 | 134 | " 'offsetXPixels': 75,\n", |
132 | 135 | " 'offsetYPixels': 25,\n", |
133 | 136 | " 'widthPixels': 600,\n", |
134 | 137 | " 'heightPixels': 371}}}}}]}" |
135 | 138 | ] |
136 | 139 | }, |
137 | | - "execution_count": 7, |
| 140 | + "execution_count": 6, |
138 | 141 | "metadata": {}, |
139 | 142 | "output_type": "execute_result" |
140 | 143 | } |
|
0 commit comments