Skip to main content

Tool for educators running "live coding" sessions to make their source files and terminal sessions viewable as read-only webpages, so that students can refer back to off-screen commands as reference.

Project description

livecode-streamer

Tool for educators running "live coding" sessions to make their source files and terminal sessions viewable as read-only webpages, so that students can refer back to off-screen commands as reference.

This project was originally developed within the context of holding Carpentries workshops to teach UNIX shells, git, Python, and R, though it should be generalizable to other programming environments and teaching contexts.

For a captioned video overview of the tool, see our lightning talk from CarpentryCon 2022.

Usage

Run the livecode-streamer command in a background terminal window during your lesson:

livecode-streamer [options] WATCH_DIR REMOTE_URI

WATCH_DIR is a local directory containing the source files you are working on, and REMOTE_URI is a remote webserver to reflect those documents to. Whenever you save your source files, the script will upload HTML versions of them to the remote server. Students can view these files in their browser, and refresh the page as needed to recieve new content.

To stream a shell session, you must use a terminal emulator that supports automatic logging to HTML. This repository contains plugins to do so with Terminator (Linux/MacOS) and Hyper (Windows/MacOS/Linux) (see the subdirectories in this repo's external-plugins/ folder). On starting a new terminal session, just use one of these plugins to log your session to the WATCH_DIR.

Hosting and remote URIs

The most ideal way to host the output of this tool is on a personal web hosting account that allows access over SSH. Most universities provide this service to their faculty and staff, a la UW's shared web hosting. The instructions for setting this account up, unfortunately, vary from institution to institution. Once you have access, though, the value to put in REMOTE_URI would be the remote destination you would normally put in the second half of an scp command (eg: username@servername:remote_path).

If suitable institutionally provided web hosting isn't available, there are a few other options:

  • Amazon AWS or Microsoft Azure object storage: this script can directly upload contents to an AWS S3 bucket or Azure Blob Storage contianer, both of which can be configured to serve static webpages. The downside of these services is that they are not free
  • GitHub Pages: You can create a repo on GitHub and have this script automatically push updates to it. This repo can then be served as a website through GitHub's "Pages" feature. This option is free, though GitHub has a soft limit of 10 page updates per hour.

In all cases, access credentials are securely stored in your operating system's keychain.

Installataion and dependencies

Install with pip install livecode-streamer[jupyter], which includes all dependencies needed for basic syntax highlighting, rendering jupyter notebooks, and uploading via scp/rsync.

To install with dependencies for all plugins: pip install livecode-streamer[jupyter,git,azure,aws,localhost]

Core requirements:

For Jupyter notebooks:

For shell sessions, one of the following terminal emulators:

For generic webspace hosting:

  • rsync (optional)
  • ssh/scp

For hosting on Github Pages:

For hosting on Azure blob storage:

For hosting on AWS S3 buckets:

For hosting locally over an ngrok tunnel:

Contributing

Contributions of bugs, new plugins, or feature suggestions are all welcome. For more information, see CONTRIBUTING.md.

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

livecode-streamer-0.1.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

livecode_streamer-0.1.4-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file livecode-streamer-0.1.4.tar.gz.

File metadata

  • Download URL: livecode-streamer-0.1.4.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.4.0-81-generic

File hashes

Hashes for livecode-streamer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f9ca438aa28e14e40a59a3f8c7f13a7261f12c8bb55c2e2c8350c6a429a0f3ee
MD5 b89c7399aaa9ab641eb6eefbcb5b608f
BLAKE2b-256 cc15ca7f42187a3873d7f7095d94a9f4bf1736424e826258020a03f39269457c

See more details on using hashes here.

File details

Details for the file livecode_streamer-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: livecode_streamer-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.4.0-81-generic

File hashes

Hashes for livecode_streamer-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b75b0a95533bba81f28dd405303cd651399cefe8c1557b80f0cb9637e88ed5c3
MD5 1d8fd42fb27242de01489ab085c3c424
BLAKE2b-256 e79e31380bd601f17a12128c5e4782f44c154891c2fe8a613d34f6820fd5a255

See more details on using hashes here.

Supported by

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