Uses tabcmd to batch print PDFs of the Student Profile Report for an entire school.
- Python3.7
- Pipenv
- Google Drive API (see setup directions here)
- Clone this repo
$ git clone https://github.com/kippnorcal/school_profile_batch_print.git
- Install Docker
- Mac: https://docs.docker.com/docker-for-mac/install/
- Linux: https://docs.docker.com/install/linux/docker-ce/debian/
- Windows: https://docs.docker.com/docker-for-windows/install/
-
Get service account key file Save the file as service_account_credentials.json.
-
Build Docker Image
$ docker build -t school_profile .
- 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=""
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"
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