-
Ensure you have a proper Python environment. If you do not have the packages required in your default environment, consider creating a virtual one:
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Update your Python path
export PYTHONPATH=`git rev-parse --show-toplevel`:$PYTHONPATH
-
(Optional) Set the Python log level:
export PYTHONLOGLEVEL=infoThe default level is "warning", however most of the scripts produce useful information at "info". Valid values come from the Python logging module.
Data can be parsed directly from a Google Sheet:
GOOGLE_API_KEY=... python src/parse-times.py \
--sheet-id GSHEET_ID \
--result-tab X > data.csvwhere:
GOOGLE_API_KEYis your Google Developer API key; this can also be specified as an option toparse-times.py(--google-api-key).GSHEET_IDis the Google Sheet IDXis the tab containing the data
Note that --result-tab can be specified more than once to combine
data potentially spread across tabs.
Data can also be parsed from a local CSV download of a Google Sheet:
python src/parse-times.py --data-file /path/to/data.csv > data.csvIn this case --result-tab is not required; however specifying which
tab the CSV came from will make later plotting more readable.
python src/plot-times.py --output results.png < data.csvwhere data.csv is the output of the data parsing script.
Some things to keep in mind:
- Call durations often have a long tail. Consider cutting off the
graph at a reasonable duration to better view the distribution:
using
--cutoff 30withsrc/plot-times.py, for example. - The two steps -- parsing and then plotting -- have been presented
separately for clarity. They can also be piped together to
facilitate scripting:
python src/parse-times.py ... | python src/plot-times.py ...