Skip to main content

Useful abstractions and CLI to make teaching more scriptable.

Project description

Teacher Helper CI/CD

Overview

This is a library of stuff that I have used to automate my work as a teacher. With version 2.0, I've worked to increase the quality of the codebase by adding unit tests, comitting to API stability (see contributing), creating this documentation site, and creating a CI/CD pipeline. My hope is that these efforts make this codebase useful to others, and that others might even consider contributing!

Installation

You can install this package via pip:

pip install teacherhelper

Then, perform the setup described in setup instructions.

Usage

Once installed, the th command provides the following CLI utility:

usage: th [-h] [--student STUDENT] [--parent PARENT] [--new]

optional arguments:
  -h, --help            show this help message and exit
  --student STUDENT, -s STUDENT
                        Lookup a student and print the result
  --parent PARENT, -p PARENT
                        Lookup a parent and print the result
  --new                 Regenerate the database by parsing student.csv and parent.csv in the $HELPER_DATA directory.

Example Usage

name = 'tommey'  # Timmy needs a typing lesson, but this library is great for
                 # data bunging!

# **************************************************
# ==== Student Information System inside Python ====
# **************************************************

from teacherhelper.sis import Sis

# some assembly required! See https://teacherhelper.jackdevries.com/setup/
sis = Sis.read_cache()

# fuzzy string matching is used to lookup the student object from the name
result: Student | None = sis.find_student(name, threshold=80)
if result:
    print(result)
else:
    print(f'{name} not found')

parent = 'Lisa Tommyparent'
parent = sis.find_parent(name)
if parent:
    print(f'{parent.name=} :: {parent.phone_number=}')


# ***********************************
# ==== Traverse Google Classroom ====
# ***********************************

from teacherhelper.google.classroom_wrapper import GoogleClassroomApiWrapper

# See https://teacherhelper.jackdevries.com/google/classroom_wrapper/
wrapper = google_classroom.GoogleClassroomApiWrapper(
    match_classrooms=['Ms. Smith', 'Ms. Fischer'],
    match_assignments=['4/25 Homework']
)

for classroom, assignment, submission in wrapper.traverse_submissions():
    assert classroom['name'] in ('Ms. Smith', 'Ms. Fischer')
    assert re.match('4/25 Homework', assignment['title']) is not None
    print(submission)


# ****************************
# ==== Send Emails Easily ====
# ****************************

# see https://teacherhelper.jackdevries.com/EMAIL/
from teacherhelper import Email, Sis


student = Sis.read_cache().find_student('Tommy Smith')


with Email(username="me@example.com", password="supersecret") as eml:
    eml.send(
        to=student.primary_conteact.email,
        subject="Tommy Needs Spelling Help",

        # the emailer supports markdown input, and will inject the resulting
        # html into a default template, or a template that you can create!
        message=f"""Hello Ms. {student.primary_contact.name},

I noticed that {student.first_name} spelled his name like "tommey" on an
assignment recently. Here are some spelling tools I would recommend:

## List of Spelling Tools

| Name                      | Website                          |
| ------------------------- | -------------------------------- |
| Khan Academy              | https://www.khanacademy.org/     |
| Grammarly                 | https://www.grammarly.com/       |
| Webster Dictionary Online | https://www.merriam-webster.com/ |
""",
        cc=result.email
    )

Documentation Site

Visit the documentation site at teacherhelper.jackdevries.com

About the Docs Site

The docs site will always remain in sync with the latest release. Every release is tagged on GitHub, so use version control to access documentation for previous versions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teacherhelper-2.0.6.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teacherhelper-2.0.6-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

Details for the file teacherhelper-2.0.6.tar.gz.

File metadata

  • Download URL: teacherhelper-2.0.6.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for teacherhelper-2.0.6.tar.gz
Algorithm Hash digest
SHA256 e237b9221fc3210848b5777d0e3e44308b153b75148c618d2a00d12f42579bbb
MD5 42ddd782a4a863913d70a1f4100a8cc6
BLAKE2b-256 5b7d94e03f255e0372cf0fe752bd7d24583b7fdbc0ca84a42cae3a48e51337d0

See more details on using hashes here.

File details

Details for the file teacherhelper-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: teacherhelper-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 45.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for teacherhelper-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 55d060dde581d8206b1a992f01847fcb6b7927d82571b2f4bb3dc642a23d6e49
MD5 35aab6a1c3eb6e5253d196a58a2ca234
BLAKE2b-256 c22b222fcb60a75cba880d2793c6f244d96627733c172810fecc4842a8a19040

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page