gigamorph / gaapy

A Python client of Google Analytics API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GAAPy

A Python client of Google Analytics API.

Setup

Root directory

Set the environment variable GAAPY_HOME, either in the shell or in bin/report.sh

Example for bash:

export GAAPY_HOME=/root/of/this/code

Configuration file

Copy config/config.json.template to config/config.json and edit it.

cd config
cp config.json.template config.json

config.json.template

{
  "client_secrets_path" : "/some/safe/private/place/client_secrets.json",
  "token_path" : "/some/safe/private/place/analytics.dat"
}

client_secrets_path is the file defined at https://developers.google.com/api-client-library/python/guide/aaa_client_secrets -- create the client secrets file by copying from config/client_secrets.json.template.

token_path is generated by the program from client_secrets_path to store the access token.

Running

bin/report.sh is the entry point.

report.sh ${PARAMS_FILE} ${START_DATE} ${END_DATE}

See params/query-parameters.conf.template and params/query-parameters.conf.example.

For example,

./report.sh my.conf 2014-06-01 2014-06-03

About

A Python client of Google Analytics API


Languages

Language:Python 94.1%Language:Shell 5.9%