Skip to main content

parody-web

A reusable Django app that serves a parody build artifact as a public book site, with section-level auth gating. It's the web surface of the parody ecosystem:

  • parody — core: builds the artifact (and the print/LaTeX side, for now)
  • parody-web — this: renders an artifact as a website
  • (future) parody-print — if/when the LaTeX side is split out of core

You pip install parody-web into a thin per-book Django project; the package is generic, so one codebase serves every book site. Each book differs only by config + content. First site: the partial Real-Time Computing book at rtcbook.org.

Access model

The site imports the full artifact and gates by section: the public sees only online_only sections (the openly-licensed subset); the private parts require login, and only the owner has an account. One deployment serves both the public partial book and — to the owner — the whole thing. (If you'd rather the full text never touch the database, import the partial parody build --online-only artifact instead — then there are no private sections.)

Why a Django app (not a static site)

Parody artifact html is Django-template-flavored — it embeds {% media %}, {% static %}, {% cite %} etc. This app renders it natively through the Django template engine (parody_web.templatetags.parody_web.render_book), so there's no second, lossy tag-resolution renderer to maintain.

Use it in a project

# settings.py
INSTALLED_APPS = [..., "parody_web"]
BOOK_SLUG = "real-time-computing"     # which imported book is the site root
# urls.py
urlpatterns = [path("", include("parody_web.urls")), ...]
pip install parody-web
python manage.py migrate
python manage.py createsuperuser                       # the owner (only account)
python manage.py import_artifact rtc.json --slug real-time-computing

Provides: Book/Chapter/Section models, the import_artifact command (upsert-by-slug, idempotent), index + section views, templates (override them in your project), and the rendering template tags. Reads settings.BOOK_SLUG, MEDIA_URL, LOGIN_URL.

A ready-to-copy thin project — settings, urls, Procfile, and AWS/SSM deploy glue — lives in example_site/; generate a new book site from it.

Data-entry tables

A lab manual authors an observation table as ::: {.editable-table}. On the site a signed-in reader types their readings into it, Save keeps them, and they are still there next visit. A reader who is not signed in sees the table with its inputs disabled and a line saying why.

Download JSON gives back that one table; All my tables (/tables.json) gives every table in the book the reader has put something in — a term's measurements in one file instead of a scavenger hunt through a dozen labs.

The file is the table as it appears on the page: a columns header row, and rows as one flat record per row keyed by those headers, including the column the row labels live in. Empty cells are "" rather than missing, so a half-filled table still loads as a table:

import json, pandas as pd
d = json.load(open("mechatronics-lab-manual-lab-test-observations.json"))
df = pd.DataFrame(d["rows"], columns=d["columns"])

Each file also carries which book, which section (title, number and URL) and when it was exported, and names its shape in format (parody-table/1, parody-tables/1) so a later change to that shape is a new number rather than a silent break.

Values are stored per cell, keyed to the reader and to Section.key rather than to a row that re-import would delete — a term's measurements outlive the book being rebuilt. Nothing is needed from the host but migrate.

Serving a book from your own project

A host project (a course site, say) can serve a parody book while keeping its own readers, gating, and per-user features. See Host integration for the four seams: imported per-exercise solutions/problems, the pluggable access policy (PARODY_WEB_ACCESS_POLICY), the per-user overlay include points, and the Section.key join key.

Develop

pip install -e .
python runtests.py            # standalone test suite (tests/settings.py)

Deploy

AWS via SSM + GitHub Actions, designed for reuse across book projects: each book site is a small repo (copied from example_site/) that pins this package and calls the shared reusable workflow (deploy-reusable.yml) — improve the renderer or the deploy once, every site picks it up. Runbook: example_site/deploy/AWS.md.

Status

0.x — interfaces may change. Renders the rtc artifact end to end with section-level auth gating; 9 tests. {% cite %} currently renders [key] (wire citeproc/a .bib for full citations). Not yet published to PyPI or deployed to rtcbook.org (owner steps).

Metadata

Release files for parody-web 0.98.2

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

Source distribution (sdist)

Source distribution for parody-web 0.98.2
File Size Uploaded Provenance
parody_web-0.98.2.tar.gz 1.3 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for parody-web 0.98.2
File Interpreter ABI Platform
parody_web-0.98.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.6 MB

Release files / parody_web-0.98.2.tar.gz

Download URL parody_web-0.98.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
0ae2e2e1478483f185626b00a776126d66790a06ec828c726c4e4205b20e9a51
BLAKE2b-256 checksum
How to use checksums
822b96c4791320896134e8a8d3eb8ef6ed7dcc411092cc574a36d94fe6420672
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / parody_web-0.98.2-py3-none-any.whl

Download URL parody_web-0.98.2-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
249bdceeea31a6f4e2908cc4b5db0716353c5cf1234b028fb73759dd6e94cf4a
BLAKE2b-256 checksum
How to use checksums
8bb50393e19a903f069965f662bbc82b96a33d7fbbd831c3bb9c865994fdf347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for parody-web 0.98.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.98.2 This release

2 release files No 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