A simple tool for parsing google csv files.
% pip install google-csv-helper
% tree csv
csv
âââ admob
â  âââ hk
â  âââ latest-day.csv
âââ adsense
âââ cn
â  âââ latest-day.csv
âââ hk
âââ latest-day.csv
6 directories, 3 files
% file csv/admob/hk/latest-day.csv
csv/admob/hk/latest-day.csv: Unicode text, UTF-16, little-endian text
% iconv -f UTF-16 -t UTF-8 csv/admob/hk/latest-day.csv | head -n1
æĨæ é äŧ°æļį (USD) č§å¯å°įææåæŦĄæå
åēåš (USD) čĢæą åĒåį (%) (%) æ¯å°æåįčĢæą éĄ¯į¤ēį (%) (%) æå
éģéąį (%) (%) éģææŦĄæ¸ åēåščĻæą åčįĢļåšįåēåš (%) åčįĢļåšįåēåš ååēåēåš (%) ååēåēåšæŦĄæ¸
% file csv/adsense/hk/latest-day.csv
csv/adsense/hk/latest-day.csv: CSV text
% head -n1 csv/adsense/hk/latest-day.csv
æĨæ,é äŧ°æļį (USD),įčĻŊé,įļ˛é åæŦĄæå
æļį (USD),æå
æŦĄæ¸,æå
åæŦĄæå
æļį (USD),Active View å¯čĻį,éģæ,éģéąį,åŽæŦĄéģæåēåš (USD)
% head -n1 csv/adsense/cn/latest-day.csv
æĨæ,äŧ°įŽæļå
Ĩ (USD),įŊéĄĩæĩč§é,įŊéĄĩ RPM (USD),åąį¤ēæŦĄæ°,æ¯åæŦĄåąį¤ēæļå
Ĩ (USD),Active View å¯č§į,įšåģæŦĄæ°,įšåģį,CPC (USD)
Use Google AdSense/Admob api to get the report content and convert it into csv format
% google-csv-helper --google-token-file .google-account01 --google-show-report-list
% google-csv-helper --google-token-file .google-account02 --google-show-report-list
% google-csv-helper --google-token-file .google-account01 --google-adsense-latest-csv > csv/account1/adsense/latest-day.csv
% google-csv-helper --google-token-file .google-account02 --google-admob-latest-csv > csv/account2/admob/latest-day.csv
% google-csv-helper --google-token-file .google-account02 --google-adsense-latest-csv > csv/account2/adsense/latest-day.csv
% tree csv
csv
âââ account01
â  âââ adsense
â  âââ latest-day.csv
âââ account02
âââ adsense
â  âââ latest-day.csv
âââ admob
âââ latest-day.csv
6 directories, 3 files
Create Dashboard reports from csv files
% google-csv-helper --output markdown csv
## Current:
### Date Range: 2023-06-01 ~ 2023-06-04
#### compare: 2023-05-01 ~ 2023-05-31
| Item | Cumulative Revenue | Average Daily Revenue | Average CPC | Min Daily Revenue | Max Daily Revenue
| -- | --: | --: | --: | --: | --:
| Admob Global | 1,234.56 | 123.45 (-12.34%) | 0.001 (-1.23%) | 234.56 [06/02 Fri] | 456.78 [06/01 Thu]
| Adsense Global | 1,234.56 | 123.45 (-12.34%) | 0.1234 (-2.34%) | 123.45 [06/02 Fri] | 345.67 [06/01 Thu]
| Adsense China | 1,234.56 | 123.45 (-12.34%) | 0.2345 (2.34%) | 123.45 [06/02 Fri] | 345.67 `[06/01 Thu]
| Total | 1,234.56 | 456.78 | | |
% google-csv-helper --output markdown --output-chart-columns 'Estimated earnings (USD)' csv
Date Range: 2023-06-01 ~ 2023-06-04
compare: 2023-05-01 ~ 2023-05-31
Item
Cumulative Revenue
Average Daily Revenue
Average CPC
Min Daily Revenue
Max Daily Revenue
Admob Global
1,234.56
123.45 (-12.34%)
0.001 (-1.23%)
234.56 [06/02 Fri]
456.78 [06/01 Thu]
Adsense Global
1,234.56
123.45 (-12.34%)
0.1234 (-2.34%)
123.45 [06/02 Fri]
345.67 [06/01 Thu]
Adsense China
1,234.56
123.45 (-12.34%)
0.2345 (2.34%)
123.45 [06/02 Fri]
345.67 `[06/01 Thu]
Total
1,234.56
456.78
Sum of (Admob Global, Adsense Global, Adsense China) - Cumulative Average of 'Estimated earnings (USD)' Chart:
867.61 â¤
846.52 ⤠âââ
825.44 âŧ⎠ââ¯
804.36 â¤â âââ¯
783.27 â¤â ââ¯
762.19 â¤â âââ¯
741.11 â¤â â⎠â⎠ââ¯
720.02 â¤âââ¯â°ââ¯â°âŽ â
698.94 â¤â°â¯ â°â⎠â
677.86 ⤠â°âŽ ââ¯
656.77 ⤠â°âââ⎠â
635.69 ⤠â°ââââ¯
% google-csv-helper --output-chart-columns 'Estimated earnings (USD)' --output-chart-detailed-columns csv
Date Range: 2023-06-01 ~ 2023-06-04
compare: 2023-05-01 ~ 2023-05-31
Item
Cumulative Revenue
Average Daily Revenue
Average CPC
Min Daily Revenue
Max Daily Revenue
Admob Global
1,234.56
123.45 (-12.34%)
0.001 (-1.23%)
234.56 [06/02 Fri]
456.78 [06/01 Thu]
Adsense Global
1,234.56
123.45 (-12.34%)
0.1234 (-2.34%)
123.45 [06/02 Fri]
345.67 [06/01 Thu]
Adsense China
1,234.56
123.45 (-12.34%)
0.2345 (2.34%)
123.45 [06/02 Fri]
345.67 `[06/01 Thu]
Total
1,234.56
456.78
Sum of (Admob Global, Adsense Global, Adsense China) - Cumulative Average of 'Estimated earnings (USD)' Chart:
867.61 â¤
846.52 ⤠âââ
825.44 âŧ⎠ââ¯
804.36 â¤â âââ¯
783.27 â¤â ââ¯
762.19 â¤â âââ¯
741.11 â¤â â⎠â⎠ââ¯
720.02 â¤âââ¯â°ââ¯â°âŽ â
698.94 â¤â°â¯ â°â⎠â
677.86 ⤠â°âŽ ââ¯
656.77 ⤠â°âââ⎠â
635.69 ⤠â°ââââ¯
Admob Global - Cumulative Average of 'Estimated earnings (USD)' Chart:
297.11 âŧâŽ
294.28 â¤â ââŽ
291.46 â¤â ââ¯â°ââŽ
288.64 â¤â â â°âŽ
285.81 â¤â â â°âŽââŽ
282.99 â¤â â â°â¯â°âŽ
280.17 â¤â â â°âŽ
277.35 â¤â â⯠â°âŽ
274.52 â¤â â â°âŽ âââŽ
271.70 â¤â°âŽ â â°â⯠â°â⎠âââ
268.88 ⤠â°ââ⯠â°âââ¯
266.06 â¤
Adsense Global - Cumulative Average of 'Estimated earnings (USD)' Chart:
495.71 â¤
473.65 ⤠âââ
451.59 ⤠ââ¯
429.53 âŧ⎠ââ¯
407.46 â¤â âââ¯
385.40 â¤â ââ¯
363.34 â¤âââ⎠ââ¯
341.28 â¤â°â¯ â°âŽ ââ¯
319.22 ⤠â°ââ⎠â
297.16 ⤠â°âŽ ââ¯
275.10 ⤠â°â⎠ââ¯
253.04 ⤠â°âââââââ¯
Adsense China - Cumulative Average of 'Estimated earnings (USD)' Chart:
211.76 â¤
209.91 ⤠ââââŽ
208.06 ⤠â â°âŽ
206.20 ⤠â â°âŽ âââŽ
204.35 ⤠â â°â⯠â°âŽ ââââŽ
202.50 ⤠â⯠â°ââ⯠â°ââŽ
200.65 âŧ⎠â⯠â°âââââŽ
198.80 â¤â â â°
196.95 â¤â â
195.10 â¤â ââ¯
193.25 â¤â â
191.40 â¤â°ââ¯