Turn a Live Q&A Transcript Into a Lesson and Recap With Python
If you run a community, a course, or even a team office hour, you probably record live Q&A sessions. Then the recording sits there. Nobody rewatches an hour of video. The fix is to repurpose each call into smaller pieces: a lesson built from the best answer, a short recap, and a list of questions you didn't get to. Here's a small Python script that does the boring part for you. The input Most…
If you run an online community, course, or team office hours, you likely record live question and answer sessions. However, those recordings often go unused as nobody rewatches an hour of video. The solution is to repurpose each call into smaller, more digestible pieces: a lesson built from the best answer, a short recap, and a list of unanswered questions for the next meeting. A small Python script can automate this process for you.
Most meeting and recording tools can export a transcript in plain text format. We'll assume a text file where questions start with "Q:" and answers start with "A:". If your tool's format is different, a simple find-and-replace should suffice. In the transcript, example questions include "How do I automate lead follow-up?" and "Should I use Zapier or write code?". Notice that the last question, "What about CRMs?", has no answer, which could represent next month's agenda.
The script starts by importing necessary modules, including regular expressions and the Path class for file handling. The parse_transcript function splits the input text at each "Q:" line, creating pairs of questions and answers. It then uses regular expressions to extract the question and answer from each block. If there's no answer, the answer is set to an empty string.
The build_outputs function sorts these pairs into two lists: answered and unanswered. It identifies the longest answer as the best answer, which is likely to be a detailed explanation, making it a good candidate for a lesson. You can modify this rule to use chat reactions, a manual selection, or an LLM scoring each answer.
The script then writes three files: lesson.md, recap.txt, and agenda.txt. The lesson.md file can be pasted into your course section, recap.txt provides five bullets for a discussion post, and agenda.txt lists the unanswered questions for the next meeting. In the future, you could automate pulling transcripts directly from your recording tool's export folder, running the script on a schedule, and sending the recap to a webhook that posts it to your community or Slack.
Adding a summarization step could also enhance the recaps, providing a one-line answer to each bullet instead of just repeating the question. The goal isn't the complexity of the code, but the ability to transform one live hour into a week of valuable content without manually rewriting it.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.