Python package for lab student survey
Project description
Lab Student Survey
Python package for lab student survey. A single command fetches the spreadsheet generated from Google Forms and uploads the analysis results to Google Drive.
Usage
- Create
student-lab-survey
(or any name) project in Google Cloud Platform. - Enable
Google Drive API
in Google Cloud Platform. - Create a
Service Account
in Google Cloud Platform. - Download the
Service Account
credentials as JSON in Google Cloud Platform and save it asservice-secrets.json
in the working directory or set it asGDRIVE_SERVICE_ACCOUNT
environment variable (via GitHub Secrets). - Create
student-lab-survey
(or any name) folder in Google Drive. - Add the
Service Account
email to thestudent-lab-survey
folder withEditor
permissions. - Create a
Google Form
for the lab student survey. The second question should be the name of the supervisor. - Create a
Google Sheet
in thestudent-lab-survey
folder from theGoogle Form
. - Create
metadata.csv
andmetadata_group_name.csv
in the working directory orstudent-lab-survey
folder in Google Drive to specify the question groups. The former will be automatically generated in the working directory if it does not exist. The latter is optional.
Environment Variables
- Set the
Google Sheet
ID asLAB_STUDENT_SURVEY_FILE_ID
environment variable (via GitHub Secrets). - Set the
student-lab-survey
folder ID asLAB_STUDENT_SURVEY_FOLDER_ID
environment variable (via GitHub Secrets). (Optional.) If not set, the parent folder ID of theGoogle Sheet
will be used. - (Set the
Service Account
credentials asGDRIVE_SERVICE_ACCOUNT
environment variable (via GitHub Secrets).)
Running commands
lss
Github Actions
name: Run lab-student-survey
on:
schedule:
- cron: "0 * * * *" # every hour
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install and run lab-student-survey
run: pipx run lab-student-survey
env:
LAB_STUDENT_SURVEY_FILE_URL: ${{ secrets.LAB_STUDENT_SURVEY_FILE_URL }}
LAB_STUDENT_SURVEY_FOLDER_URL: ${{ secrets.LAB_STUDENT_SURVEY_FOLDER_URL }}
GDRIVE_SERVICE_SECRETS: ${{ secrets.GDRIVE_SERVICE_SECRETS }}
Installation
Install this via pip or pipx (or your favourite package manager):
pipx install lab-student-survey
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lab_student_survey-0.3.0.tar.gz
(13.2 kB
view hashes)
Built Distribution
Close
Hashes for lab_student_survey-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d39bbfb4053192d7ee183ff75a2279aa38419a6e5dc10de6a95857bdce86ab4a |
|
MD5 | 5b6209e3efbd6e855413e21a04cbd6d3 |
|
BLAKE2b-256 | 0b14f2b445b8d8fc1f3a6a595c3ca00489a277f3fbc8c487f261859c790c0caa |