Skip to main content

mitol-django-google-sheets-deferrals

This is the Open Learning Django Google Sheets library for handling deferral requests over Google Sheets

Setup

Before you begin setting up this library make sure you set up mitol-django-google-sheets first. Follow the instructions here.

Once you have mitol-django-google-sheets installed, then:

pip install mitol-django-google-sheets-deferrals

In settings.py

INSTALLED_APPS = [
    ...
    "mitol.google_sheets_deferrals.apps.GoogleSheetsDeferralsApp",
]
MITOL_GOOGLE_SHEETS_DEFERRALS_PLUGINS = [
    "ecommerce.plugins.DeferralPlugin"
]

In ecommerce/plugins.py

from mitol.google_sheets_deferrals.hooks import hookimpl

class DeferralPlugin:
    @hookimpl
    def deferrals_process_request(deferral_request: DeferralRequestRow) -> DeferralResult:
        # TODO: look up the user/enrollment
        # TODO: unenroll user from and enroll to

Create your google sheets folder

The structure of the folder should look as the following:

  1. Spreadsheet that contains sheets with 'Deferral Form Responses' and the 'Deferrals' sheets, that is being processed.
  2. Request Form

Ask a developer for a template folder to copy this structure.

Add settings to your app

Set MITOL_GOOGLE_SHEETS_DEFERRALS_REQUEST_WORKSHEET_ID in your .env file. It is required.

Some settings have default values, which you might need to update, if your sheet is different.

Description of settings (in addition to the ones described in mitol-django-google-sheets):

  • MITOL_GOOGLE_SHEETS_DEFERRALS_REQUEST_WORKSHEET_ID

    The IDs of the refund and deferral sheets in the change of enrollment spreadsheet. These can be found by opening the spreadsheet, selecting the "Refunds" or "Deferrals" worksheets, and copying down the gid value in the URL.

    Example: https://docs.google.com/spreadsheets/d/<MITOL_GOOGLE_SHEETS_ENROLLMENT_CHANGE_SHEET_ID>/edit#gid=<MITOL_GOOGLE_SHEETS_DEFERRALS_REQUEST_WORKSHEET_ID>

  • MITOL_GOOGLE_SHEETS_DEFERRALS_PROCESSOR_COL

    The zero-based index of the deferral change sheet column that contains the user that processed the row

  • MITOL_GOOGLE_SHEETS_DEFERRALS_COMPLETED_DATE_COL

    The zero-based index of the deferral change sheet column that contains the row completion date

  • MITOL_GOOGLE_SHEETS_DEFERRALS_ERROR_COL

    The zero-based index of the deferral change sheet column that contains row processing error messages

  • MITOL_GOOGLE_SHEETS_DEFERRALS_SKIP_ROW_COL

    The zero-based index of the deferral change sheet column that indicates whether the row should be skipped

  • MITOL_GOOGLE_SHEETS_DEFERRALS_FIRST_ROW

    The first row (as it appears in the spreadsheet) of data that our scripts should consider processing in the deferral request spreadsheet

Usage

To processing your google sheet with deferral requests simply add:

deferral_request_handler = DeferralRequestHandler()
results = deferral_request_handler.process_sheet()

Here are two main ways that we are currently getting our Google Sheets Deferrals processed:

  1. Run a management command. For example: ./manage.py process_deferral_requests -i "<spreadsheet id>"
  2. Set up a scheduled celery task. For example:
from mitol.google_sheets_deferrals.api import DeferralRequestHandler
from main.celery import app

@app.task
def process_deferral_requests():
    """
    Task to process deferral requests from Google sheets
    """
    deferral_request_handler = DeferralRequestHandler()
    if not deferral_request_handler.is_configured():
        log.warning("MITOL_GOOGLE_SHEETS_* are not set")
        return
    deferral_request_handler.process_sheet()

Develper setup

For local development setup and testing please follow the instructions Developer Setup here.

Metadata

Release files for mitol-django-google-sheets-deferrals 2026.10.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mitol-django-google-sheets-deferrals 2026.10.30
File Size Uploaded Provenance Actions
mitol_django_google_sheets_deferrals-2026.10.30.tar.gz 8.6 kB With provenance Details for mitol_django_google_sheets_deferrals-2026.10.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mitol-django-google-sheets-deferrals 2026.10.30
File Interpreter ABI Platform Actions
mitol_django_google_sheets_deferrals-2026.10.30-py3-none-any.whl Python 3 none any Details for mitol_django_google_sheets_deferrals-2026.10.30-py3-none-any.whl

Total release size: 23.2 kB

Release files / mitol_django_google_sheets_deferrals-2026.10.30.tar.gz

Download URL mitol_django_google_sheets_deferrals-2026.10.30.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1fc84ea040a428f5f1943f4f91d53603fa6e4a27684780e7988dd130749142df
BLAKE2b-256 checksum
How to use checksums
b3150c9e5f629839295d6a82e7f9d6b241f4ac1ebb3be9ba3bc4d146a8174bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / mitol_django_google_sheets_deferrals-2026.10.30-py3-none-any.whl

Download URL mitol_django_google_sheets_deferrals-2026.10.30-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75d32feaa3f14a11fca2c1a28fb655b0b73fec76643f6db4988ca8ae52d55c69
BLAKE2b-256 checksum
How to use checksums
341c5303c57a67decea05036a509a3b7ddc1f5c1d92a637b41f819d2bd63a70a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for mitol-django-google-sheets-deferrals 2026.10.30

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mitol_django_google_sheets_deferrals-2026.10.30.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page