/school_profile_batch_print

Batch prints PDFs of the Tableau Student Profile Report

Primary LanguagePython

Student Profile Batch Printer

Uses tabcmd to batch print PDFs of the Student Profile Report for an entire school.

Dependencies:

Getting Started

Setup environment

  1. Clone this repo
$ git clone https://github.com/kippnorcal/school_profile_batch_print.git
  1. Install Docker
  1. Get service account key file Save the file as service_account_credentials.json.

  2. Build Docker Image

$ docker build -t school_profile .
  1. Create .env file with project secrets Create a .env file in the root of the project that has the following variables:
# Tableau Server variables
TABLEAU_SERVER=
TABLEAU_SITE=
TABLEAU_USER=
TABLEAU_PWD=

# Google Developer Service Account
ACCOUNT_EMAIL=

# Database variables
DB_SERVER=
DB=
DB_USER=
DB_PWD=
DB_QUERY=

# Mailgun variables
MG_API_KEY=
MG_API_URL=
MG_DOMAIN=

# Email Variables
ENABLE_MAILER=1                                                                   
SENDER_EMAIL=
SENDER_PWD= 
RECIPIENT_EMAIL=

GDRIVE_FOLDER=""

Running the Job

Run in detached mode (runs as background process) with the output folder mapped to the host directory.

Run for entire school (production use):

$ docker run -d -v ${PWD}/output:/app/output school_profile --school "School Name"

Run for a subset of records at a school (testing purposes)

$ docker run -d -v ${PWD}/output:/app/output school_profile --school "School Name" --grade "10"

School Names

In order to run the job, you need to pass a school name in the exact format the SQL query expects. Here is a list of possible school names:

  • Bayview ES
  • Bayview MS
  • Bridge K-8
  • Bridge Rising
  • Bridge Upper
  • Esperanza
  • Excelencia K-8
  • Excelencia Lower
  • Excelencia Upper
  • Heartwood
  • Heritage
  • King
  • Navigate
  • Prize
  • SF Bay
  • SFCP
  • SJC
  • Summit
  • Valiant K-8
  • Valiant Lower
  • Valiant Upper