Skip to content

Latest commit

 

History

History
80 lines (60 loc) · 3.15 KB

helpers.md

File metadata and controls

80 lines (60 loc) · 3.15 KB

List Of StarThinker Command Line Helpers

Developing solutions is easier with helpers that automate common development tasks. Here are a few you can run from the command line.

Installing Command Line Helpers

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:
    1. Copy the new command PATH from the warning.
    2. Activate the new command path now, run: export PATH="[PASTE THE PATH HERE]":$PATH;
    3. Activate for all future logins, run: echo 'export PATH="[PASTE THE PATH HERE]":$PATH;' >> ~/.bash_profile;

List Of Helpers For Users

  • Execute Google Oauth

    • 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
  • CM Report Inspector

    • Pull CM Report shema, files, and fields.
    • Useful for building the dbm task JSON.
    • Minimal CM API example.
    • st_cm -h
  • DV360 Report Inspector

    • Pull DV360 Report shema, files, and fields.
    • Useful for building the dbm task JSON.
    • Minimal DV360 API example.
    • st_dv360 -h
  • Call Any Google API Endpoint

    • Quickly see the results of any Google API Endpoint, great for debugging format and access.
    • st_google_api -h
  • Verify JSON is Valid

    • StarThinker JSON allows newlines for queries etc.
    • This utility checks and correctly prints error locations.
    • st_validate -h
  • Pull BigQuery Table Schema

    • Quickly pull table schema and for a recipe.
    • st_bigquery -h
  • Send An Email Template

    • Quickly send a nicely formatted email, including tables, to anyone.
    • Useful for automating reporting emails, see sample.json template.
    • st_newsletter -h
  • Run Automated Tests

Running Helpers For Developers

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