Skip to main content

stapel-courses

CI coverage pypi downloads python license llms.txt

Courses for a Stapel education product: Course -> Module -> Lesson (ordered, typed content blocks: text, video and attachments by opaque media id, embeds), enrollment with a lifecycle (pending, active, completed, expired, cancelled), a source (free, purchase, entitlement, staff grant) and an optional expiry, and an access gate per course chosen from a strategy registry (free, enrolled, purchased through stapel-orders, entitlement through stapel-billing). The outline names a lock reason for every lesson (sign in, enroll, buy, plan, drip date, previous lesson). Lesson progress is an idempotent upsert with a per-enrollment progress cache; drip by days since enrollment or by fixed date and a sequential-unlock switch pace a course. Quizzes on a lesson or module (single and multiple choice, true/false, short text) are graded on the server with attempt limits, a pass mark and a stored shuffle seed; answers never leave before submission. Completing every required lesson and quiz completes the course and issues a certificate with a public verification endpoint. A course is sold as orders purchasable type 'course' (resolver Function courses.purchasables); the order facts activate and cancel the enrollment. Courses never imports orders or billing.

Part of the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.

Install

pip install stapel-courses

At a glance

Fact Value
Version 0.1.0
Python >=3.11 (3.11, 3.12, 3.13, 3.14)
HTTP operations 41
Config axes 8
Usage surface 12
Extension points 10
Error codes 72
Documented flows 5
Fleet dependencies stapel-auth (optional) · stapel-billing (optional) · stapel-cdn (optional) · stapel-core · stapel-notifications (optional) · stapel-orders (optional) · stapel-profiles (optional)

Documentation

Errors: English · Español · Русский · OpenAPI · capabilities.json · llms.txt (for agents)

What this is

Courses for a Stapel education product: courses made of modules and lessons, enrollment with a lifecycle and an access gate per course, lesson progress, quizzes graded on the server, and certificates with a public verification page. The module never imports a sibling: a course is sold through stapel-orders as purchasable type course (its resolver is the courses.purchasables Function and the order facts open and close the enrollment), and a plan includes a course through stapel-billing's billing.check_entitlement Function, asked by name.

Quick start

INSTALLED_APPS = [
    # ...
    "stapel_courses",
]

STAPEL_COURSES = {
    "DEFAULT_ACCESS": "enrolled",      # free | enrolled | purchased | entitlement
}

# urls.py
path("courses/api/", include("stapel_courses.urls"))   # -> /courses/api/v1/...

# settings.py — enrollment expiry (Celery optional; or manage.py courses_housekeeping)
from stapel_courses.beat import get_courses_beat_schedule
CELERY_BEAT_SCHEDULE = {**get_courses_beat_schedule()}

Sell courses next to stapel-orders (no import either way):

from stapel_courses.preset import SETTINGS_DEFAULTS as COURSES

STAPEL_ORDERS = {
    "PURCHASABLE_TYPES": {**COURSES["STAPEL_ORDERS"]["PURCHASABLE_TYPES"]},  # "course"
}
STAPEL_COURSES = {"PURCHASE_ACTIVATION": "paid"}   # paid | confirmed | placed

A demo course: python manage.py courses_seed_demo.

Concepts

  • Course → Module → Lesson — ordered; a lesson is a list of typed content blocks (text, video and attachment by opaque media id, embed by https URL; a host registers more in BLOCK_TYPES). A lesson may be a free preview, optional, or need a reviewer's "passed".
  • Access — each course names a strategy: free (everyone reads), enrolled (enroll for free, then read), purchased (buy it through orders), entitlement (a billing plan includes it). The outline names a lock reason for every lesson; staff and the author always see everything.
  • Enrollment — pending → active → completed, expired (by the beat after access_days), cancelled; source free, purchase, entitlement or staff. One row per course and learner.
  • Pacing — drip by days since enrollment or by fixed dates, and a sequential switch (a lesson opens after the earlier required lessons and quizzes are done).
  • Progress — an idempotent upsert per lesson (forward-only status, last video position) and a progress cache on the enrollment.
  • Quizzes — single/multiple choice, true/false, short text (exact or normalised match); attempt limits, pass mark, a stored shuffle seed; graded on the server; right answers are never sent before submission and afterwards only as the quiz's reveal mode allows.
  • Completion and certificates — every required lesson completed and every required quiz passed completes the course; a certificate with a unique number is issued once; GET certificates/{number}/ verifies it and shows only the fields PUBLIC_VERIFY_FIELDS names.
  • GDPR — export of enrollments, progress, attempts and certificates; erasure deletes the learning data and anonymises and revokes certificates.

License

MIT — see LICENSE.


This page is assembled by stapel-readme from docs/readme.md plus the contract artifacts in docs/. Edit the prose in docs/readme.md; the badges, facts and links above and below it are generated — do not hand-edit README.md.

Metadata

Release files for stapel-courses 0.1.0

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

Source distribution (sdist)

Source distribution for stapel-courses 0.1.0
File Size Uploaded Provenance Actions
stapel_courses-0.1.0.tar.gz 130.5 kB With provenance Details for stapel_courses-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stapel-courses 0.1.0
File Interpreter ABI Platform Actions
stapel_courses-0.1.0-py3-none-any.whl Python 3 none any Details for stapel_courses-0.1.0-py3-none-any.whl

Total release size: 244.5 kB

Release files / stapel_courses-0.1.0.tar.gz

Download URL stapel_courses-0.1.0.tar.gz
Size 130.5 kB
Tags Source
SHA-256 checksum
How to use checksums
24a2633b1690c84d0d9186b61e55266ff432f7623fcfdf760c9095538c16039a
BLAKE2b-256 checksum
How to use checksums
7f2a8f924a4d0a3200522e919d62f5e5ac5d2b18db5c5442f92821e650ca45e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / stapel_courses-0.1.0-py3-none-any.whl

Download URL stapel_courses-0.1.0-py3-none-any.whl
Size 114.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1388058512468b689a1cd359d59d48e4e9c7c1b0d4076b4293f446866ee3c6c4
BLAKE2b-256 checksum
How to use checksums
ef365f4489db88779e7149e28bf122eb467f1a5a770a831020c7d8009cc594db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for stapel-courses 0.1.0

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 stapel_courses-0.1.0.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 Nov 27, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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