Developing solutions is easier with helpers that automate common development tasks. Here are a few you can run from the command line.
From the command line on any unix/linux machine install StarThinker. All following examples begin with this step.
pip3 install git+https://github.com/google/starthinker
- If you get a permission error add:
--user
to the above command. - If you get a PATH WARNING:
- Copy the new command PATH from the warning.
- Activate the new command path now, run:
export PATH="[PASTE THE PATH HERE]":$PATH;
- Activate for all future logins, run:
echo 'export PATH="[PASTE THE PATH HERE]":$PATH;' >> ~/.bash_profile;
-
- Helps create user credentials form client credendtials.
- User credentials generated by this script are used by several of the helpers in the -u parameter.
- Minimal example of oAuth.
st_auth -h
-
- Pull CM Report shema, files, and fields.
- Useful for building the dbm task JSON.
- Minimal CM API example.
st_cm -h
-
- Pull DV360 Report shema, files, and fields.
- Useful for building the dbm task JSON.
- Minimal DV360 API example.
st_dv360 -h
-
- Quickly see the results of any Google API Endpoint, great for debugging format and access.
st_google_api -h
-
- StarThinker JSON allows newlines for queries etc.
- This utility checks and correctly prints error locations.
st_validate -h
-
- Quickly pull table schema and for a recipe.
st_bigquery -h
-
- Quickly send a nicely formatted email, including tables, to anyone.
- Useful for automating reporting emails, see sample.json template.
st_newsletter -h
-
- Execute one or all automated tests within StarThinker.
- Developer deployment only.
For those of you with a developer deployment of the repository, you can customize and for example run a helper using:
source starthinker_assets/development.sh
python starthinker/tool/dv.py --list -u $STARTHINKER_USER -c $STARTHINKER_CLIENT
The most common development environment parameters for helpers are:
- -u $STARTHINKER_USER - user credentials for accessing API endpoints.
- -c $STARTHINKER_CLIENT - client creddentials for authenticating, not needed if user credentials already exist.
- -s $STARTHINKER_SERVICE - service credentials for writing data.
- -p $STARTHINKER_PROJECT - cloud project to bill the data transfer to.
© 2020 Google LLC - Apache License, Version 2.0