diff --git a/.gitignore b/.gitignore index a2bd15eb..51cc7828 100644 --- a/.gitignore +++ b/.gitignore @@ -189,3 +189,6 @@ dmypy.json # Accidental pip install output files (from `pip install pkg =version` typos) /=* /logs/ + +# Generated recording and voiceover output (videos, audio, captures): host outside the repo +my_egeria/my_egeria/recording/output/ diff --git a/my_egeria/my_egeria/SplashScreen.py b/my_egeria/my_egeria/SplashScreen.py index 3c07606b..7e1b4c13 100644 --- a/my_egeria/my_egeria/SplashScreen.py +++ b/my_egeria/my_egeria/SplashScreen.py @@ -21,8 +21,12 @@ class SplashScreen(ModalScreen): """ SplashScreen for my_egeria """ - # Escape must dismiss (not pop) the screen, so that MyProfileApp.mainline still runs - BINDINGS = [("escape", "continue_to_app", "Continue")] + # Escape, Enter, or Space dismisses the splash screen to continue to the main app + BINDINGS = [ + ("escape", "continue_to_app", "Continue"), + ("enter", "continue_to_app", "Continue"), + ("space", "continue_to_app", "Continue"), + ] CSS_PATH = "my_profile.tcss" diff --git a/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md b/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md index a660c678..0c0b056f 100644 --- a/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md +++ b/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md @@ -1,164 +1,174 @@ # My Profile — Video Blog Script (DRAFT) +**Series Context:** *Coco Pharmaceuticals Data Governance Journey* — Practitioner Companion to Jules Keeper's Video Blogs **Working title:** "Meeting Egeria Through My Profile — Callie Quartile, Data Scientist at Coco Pharmaceuticals" **Target length:** ~4.5 to 5 minutes (≈650 spoken words) -**Format:** In-character video blog set at Coco Pharmaceuticals, following the established style of the Jules Keeper video series by Mandy Chessell (as seen on prd-associates.com and YouTube). Talking head / voice-over with live terminal screen capture of `my_profile.py` (`MyProfileApp`). -**Presenter persona:** Callie Quartile, Data Scientist at Coco Pharmaceuticals (with cameos/references to Jules Keeper, Tessa Tube, and Peter Profile). +**Format:** In-character video blog set at Coco Pharmaceuticals, following the established narrative and visual style of Mandy Chessell's Jules Keeper video series (as featured on [prd-associates.com](https://www.prd-associates.com) and YouTube). Combines direct-to-camera presenter segments with live terminal screen recordings of `my_profile.py` (`MyProfileApp`). +**Presenter persona:** Callie Quartile, Data Scientist (Clinical Trials & AI Pilot Teams) at Coco Pharmaceuticals, with contextual references to Jules Keeper (CDO), Dr. Tessa Tube (Lead Researcher), Peter Profile (Information Analyst), and Faith Broker (Privacy Officer). --- -## 0. Cold open (0:00 – 0:20) +## 0. Cold Open & Introduction (0:00 – 0:25) -**[VISUAL]** Callie Quartile to camera, warm and engaging, against a modern office background or Coco Pharmaceuticals title card: *"Better Data for Everyone — Powered by Egeria"*. +**[VISUAL]** Callie Quartile to camera in her lab/office at Coco Pharmaceuticals. Warm, engaging, and practical. +**[SLIDE OVERLAY]** Coco Pharmaceuticals title card: *"Better Data for Everyone — Powered by Egeria"*. **CALLIE:** -> Hi, I'm Callie Quartile. I'm a data scientist here at Coco Pharmaceuticals. When our Chief Data Officer, Jules Keeper, rolled out our *"better data for everyone"* initiative, my biggest question was: how do I navigate this vast ocean of metadata without getting bogged down in complexity? Where do I actually start? +> Hi, I'm Callie Quartile. I'm a data scientist here at Coco Pharmaceuticals, working across our Clinical Trials research and AI Pilot teams. +> If you've been following Jules Keeper's video blogs, you've heard our Chief Data Officer talk about his mission to establish business-led data governance without creating bureaucratic roadblocks. +> But as someone building cancer research models on patient cohorts, my immediate question was: how does Jules's *"better data for everyone"* initiative help me get my daily work done? Where do I actually start? > It turns out, I start with **me**. **[LOWER THIRD]** Callie Quartile — Data Scientist, Coco Pharmaceuticals -**[TITLE CARD]** Meeting Egeria Through My Profile +**[TITLE CARD]** *Meeting Egeria Through My Profile: The Practitioner's Cockpit* --- -## 1. The Context: One Persona, One Workspace (0:20 – 0:50) +## 1. The Context: Operationalizing Governance Roles (0:25 – 0:55) -**[VISUAL]** Slide animation / graphic: Callie in the center connected to teams, clinical trial projects, data products, glossaries, governance roles, and daily to-dos. +**[VISUAL]** Conceptual diagram / visual slide: Callie at the center, linked to clinical research teams, governance roles, glossaries, digital data products, and active to-dos. **CALLIE:** -> In a modern enterprise like Coco Pharmaceuticals, open metadata isn't just an abstract catalogue—it's the living fabric of how we work. Egeria knows my appointed roles, the clinical research teams I collaborate with, my active projects, and the governed data assets I rely on. -> But having that information scattered across separate systems slows everyone down. We needed a single, fast, keyboard-driven cockpit where any team member can see their world, keep it current, and take action. +> In his recent video on *Establishing Data Governance*, Jules pointed out that governance policies on paper remain passive until you attach responsibilities to **named roles** with real people appointed to them. +> Egeria already knows the appointed roles I hold, the clinical trial teams I collaborate with under Dr. Tessa Tube, the data definitions curated by Peter Profile, and the privacy classifications set by Faith Broker. +> But having that information fragmented across multiple tools slows us down. We needed one fast, interactive, keyboard-driven cockpit where any team member can see their governance ecosystem, keep it up to date, and take immediate action. > That workspace is **My Profile**. --- -## 2. Launch & Parallel Startup (0:50 – 1:20) +## 2. Launch & Parallel Background Startup (0:55 – 1:25) -**[VISUAL]** Terminal window. Clean dark theme. Type `uv run my_profile` (or `python -m my_egeria.my_profile`). -The splash screen appears instantly with: *"Welcome to My Profile for Egeria Users, calliequartile!"* and buttons for **Continue to App** and **Change User**. +**[VISUAL]** Terminal window in clean dark theme. Callie types `uv run my_profile` (or `python -m my_egeria.my_profile`). +The splash screen displays: *"Welcome to My Profile for Egeria Users, calliequartile!"* with action buttons **Continue to App** and **Change User**. **CALLIE:** -> My Profile is a terminal application built on Textual and pyegeria. When you launch it, there's no waiting around. While the splash screen greets you, it's already querying the Egeria platform asynchronously in the background. By the time you hit **Continue**, your full profile is loaded and ready in memory. -> If I'm collaborating at a colleague's desk or testing access permissions, **Change User** lets me switch identities on the fly with live credential validation. And if our server ever needs a restart, built-in connection retry screens keep things seamless. +> My Profile is a terminal application built with Textual and pyegeria. When you launch it, there's no waiting around. +> While this welcome screen greets you, the application is already querying the Egeria metadata highway asynchronously in the background. By the time you hit **Continue**, your full profile, role appointments, and collections are already loaded in memory. +> And if I'm pairing with Peter Profile or auditing permissions with Faith Broker, **Change User** lets us switch identities right from the start with live credential validation. -**[ON-SCREEN CALLOUT]** "Async background loading • Live credential validation • Instant startup" +**[ON-SCREEN CALLOUT]** "Async background profile loading • Live credential validation • Instant keyboard response" --- -## 3. The Main Dashboard Tour (1:20 – 2:05) +## 3. The Main Dashboard Tour (1:25 – 2:10) -**[VISUAL]** Main Dashboard renders. The header prominently displays: -`Egeria — User: calliequartile | Karma Points: 120 | 09:30:00` -Camera highlights the structured grid panels: -- Top Left: **User Associations** & **My Collections** -- Top Right: **Other Functions** menu list -- Middle: **Roles** (with team drill-down note) & **Teams** -- Activity Center: **Blogs**, **Journal**, and **To-Dos** -- Bottom: **User Identity** and **Projects** -- Footer: Shortcut key bindings (`Ctrl+T` Edit Table, `Ctrl+O` Comments, `Ctrl+N` Add Comment, `Ctrl+K` Bookmark Row, `Ctrl+B` Bookmarks, `Ctrl+F` Feedback, `q` Quit). +**[VISUAL]** Main Dashboard loads seamlessly. +Header bar highlights: `Egeria — User: calliequartile | Karma Points: 120 | 09:30:00` +Camera pans through the structured grid layout: +- **Top Left:** User Associations & My Collections +- **Top Right:** Other Functions Menu +- **Middle Section:** Roles (with Team drill-down tip) & Teams +- **Activity Stream:** Blogs, Personal Journal, and Active To-Dos +- **Bottom Section:** User Identity mappings & Research Projects +- **Footer:** Global hotkeys (`Ctrl+T` Edit, `Ctrl+O` Comments, `Ctrl+N` Add Comment, `Ctrl+K` Bookmark, `Ctrl+B` Bookmarks, `Ctrl+F` Feedback, `q` Quit). **CALLIE:** -> Here is my daily cockpit. Every single panel is populated live from Egeria. -> At the top, I have my **User Associations** and **Collections**, organizing the assets I care about. -> In the middle, I can see my appointed **Roles** and **Teams**. Notice this tip: pressing Enter on a Team Leader or Member role immediately opens **My Team**, showing everyone I'm working with and their responsibilities. -> Over here is my daily work stream: my **Blogs**, personal **Journal**, and **To-Dos**. -> And at the bottom, my **User Identity** mappings and active **Projects** across Coco Pharmaceuticals. +> Here is my daily home base. Every single panel is synchronized live with Egeria. +> At the top, my **User Associations** and **Collections** organize the clinical datasets and glossaries I care about. +> In the middle, you see my appointed **Roles** and **Teams**. Notice how governance comes alive here: pressing Enter on my Clinical Trials team role instantly opens **My Team**, showing colleagues like Tessa Tube and Tanya Tidie along with their active responsibilities. +> Down here is my daily activity stream: team **Blogs**, my personal **Journal**, and my **To-Dos**. +> And at the top right, Egeria tracks my **Karma Points**, recognizing active curation and collaboration across Coco Pharmaceuticals! -**[ON-SCREEN CALLOUT]** "Live metadata synchronization • Role & Team drill-down • Karma point tracking" +**[ON-SCREEN CALLOUT]** "Live metadata synchronization • Role & Team drill-down • Automated Karma recognition" --- -## 4. Real-Time Curation: To-Dos, Comments & Bookmarks (2:05 – 2:50) +## 4. Real-Time Curation: To-Dos, Comments & Bookmarks (2:10 – 2:55) **[VISUAL]** -1. Callie navigates to the **To-Dos** table, highlights a row, and presses `Ctrl+T`. The **Edit Selected Table** screen opens; she clicks **Add Row** and enters: *"Review clinical trial patient cohort data quality"*. The new to-do appears instantly on the dashboard. -2. Selects an asset row, presses `Ctrl+O` to view comments, then `Ctrl+N` to add a comment: *"Verified schema alignment with Dr. Tessa Tube"*. -3. Presses `Ctrl+K` to bookmark the row, then presses `Ctrl+B` to show the **My Bookmarks** management screen. +1. Callie navigates to the **To-Dos** panel, highlights a row, and presses `Ctrl+T`. The **Edit Selected Table** dialog opens; she adds: *"Verify hospital cohort schema with Peter Profile"*. The row updates live on the dashboard. +2. Highlights an asset, presses `Ctrl+O` to view comments, then `Ctrl+N` to add a comment: *"Confidence score 0.95 verified against clinical laboratory assay standards"*. +3. Presses `Ctrl+K` to bookmark the item, then `Ctrl+B` to display the **My Bookmarks** management screen. **CALLIE:** -> Metadata is only valuable if it's kept fresh and actionable. With simple keystrokes, I can curate my workspace without leaving the keyboard. -> Hitting **Ctrl+T** lets me edit any highlighted table—adding tasks from morning stand-ups or updating project milestones. -> **Ctrl+O** and **Ctrl+N** allow me to view and add threaded discussions directly onto elements. That means conversations stay anchored to the data asset or task itself, instead of getting lost in chat channels. -> And with **Ctrl+K** and **Ctrl+B**, I bookmark critical elements for instant one-touch retrieval. +> Data governance only works if metadata is maintained as part of our normal flow of work, not as an afterthought. +> Pressing **Ctrl+T** lets me edit any highlighted table in place—adding action items from morning stand-ups or updating project milestones. +> With **Ctrl+O** and **Ctrl+N**, threaded discussions attach directly to the metadata asset or task itself. Instead of losing critical context in email threads, Dr. Tube and I keep our clinical trial discussions permanently linked to the data. +> And with **Ctrl+K** and **Ctrl+B**, I can bookmark key assets and retrieve them instantly with a single keystroke. **[KEY SHORTCUT OVERLAYS]** `Ctrl+T` Edit Table • `Ctrl+O` Show Comments • `Ctrl+N` Add Comment • `Ctrl+K` Bookmark Row • `Ctrl+B` Bookmarks --- -## 5. The Hero Workflow: Shopping for Governed Data (2:50 – 3:50) +## 5. The Hero Workflow: Shopping for Governed Data Products (2:55 – 3:55) **[VISUAL]** -1. Callie selects **Other Functions** → **Catalogs/Shop for Data**. -2. The **Shop for Data** screen opens, showcasing: - - **Business Domain** & **Root Collections** - - **Glossaries** (terms and definitions) - - **Digital Product Catalog** (data products) - - **Data Dictionaries** (schemas and specifications) -3. Callie searches for *"Clinical Trial Metrics"*, selects the data product, and presses `Ctrl+L` (**Sample Data**). A sample data table appears with real distribution values. -4. Convinced, she presses `Ctrl+U` (**Subscribe**). The **Create Subscription Request** modal opens. She enters her purpose (*"Efficacy analysis for Coco treatment trial"*), selects subscription terms, and submits. -5. Back in **Other Functions** → **Subscriptions**, the new active subscription is displayed. +1. Callie opens **Other Functions** → **Catalogs / Shop for Data**. +2. The catalog marketplace renders: + - **Business Domains** & **Root Collections** + - **Glossaries** (Business concepts curated by Erin Overview & Peter Profile) + - **Data Dictionaries** (Physical schemas & clinical data specifications) + - **Digital Product Catalog** (Certified research data products) +3. Callie searches for *"Patient Cohort Treatment Efficacy"*, selects the data product, and presses `Ctrl+L` (**Sample Data**). A clean sample data preview opens displaying distribution metrics and confidentiality tags. +4. Confident in the data quality, she presses `Ctrl+U` (**Subscribe**). The **Create Subscription Request** modal opens. She enters her purpose (*"AI oncology treatment response modeling"*), agrees to governance terms, and submits. +5. She navigates to **Other Functions** → **Subscriptions**, where the new active governed subscription appears. **CALLIE:** -> Now for my absolute favorite feature: **Shop for Data**. -> As a data scientist, finding trusted, high-quality data used to take weeks of asking around. Here, Egeria unifies our Business Domains, Glossaries, Data Dictionaries, and Digital Product Catalogs into a single curated marketplace. -> I can search across terms, inspect schemas, and press **Ctrl+L** to **sample** the data right in the terminal before making any commitments. -> Once I know it's what I need, **Ctrl+U** lets me submit a formal **Subscription Request**. Egeria routes the request under governance policy so data owners understand who is using their data, for what purpose, and under what terms. -> In a matter of seconds, governed access is requested, approved, and tracked in **Subscriptions**. +> Now for the most powerful feature in my workflow: **Shop for Data**. +> Before Jules Keeper established our open metadata catalog, finding trusted clinical data meant weeks of meetings and manual approvals. Here, Egeria brings together Business Domains, Glossaries, Data Dictionaries, and Digital Product Catalogs into a unified data marketplace. +> I can explore standardized terminology, verify classifications, and hit **Ctrl+L** to **sample** the dataset right in my terminal to ensure it fits my AI model requirements. +> When it's right, **Ctrl+U** lets me submit a formal **Subscription Request**. Egeria ensures Faith Broker's privacy rules and compliance policies are satisfied, giving data owners full visibility into who is using their data and why. +> In less than sixty seconds, governed access is requested, validated, and tracked in **Subscriptions**. -**[ON-SCREEN CALLOUT]** "Unified Catalog Search • Instant Data Sampling (`Ctrl+L`) • Governed Subscriptions (`Ctrl+U`)" +**[ON-SCREEN CALLOUT]** "Unified Data Marketplace • Instant Data Sampling (`Ctrl+L`) • Governed Subscriptions (`Ctrl+U`)" --- -## 6. Collaboration, Networks & Technology Types (3:50 – 4:30) +## 6. Collaboration, Networks & Technology Curation (3:55 – 4:35) **[VISUAL]** -1. Callie selects **Other Functions** → **My Network**. A visual Mermaid graph renders her organizational network, peers, and collaborators. -2. Selects **Work with Communities** → **Communities Screen**, showing Coco Pharmaceuticals Clinical Research Community, its leaders, and resources. -3. Presses `Ctrl+F` to demonstrate the instant **Leave Feedback** dialog. -4. Selects **Technology Types**, showing automated curation templates and governance action processes. +1. Callie navigates to **Other Functions** → **My Network**. An interactive Mermaid graph visualizes her cross-functional network across Clinical Trials, AI Pilot, and Governance teams. +2. Selects **Work with Communities**, showcasing the *Coco Pharmaceuticals Clinical Research Community*. +3. Presses `Ctrl+F` to pop up the in-app **Leave Feedback** dialog. +4. Briefly shows **Technology Types**, displaying automated curation templates and governance action processes. **CALLIE:** -> Beyond data shopping, My Profile connects you to the wider community. -> **My Network** visualizes your collaboration web and reporting structures directly in the terminal. -> **Work with Communities** lets you engage with domain working groups across Coco Pharmaceuticals. -> Pressing **Ctrl+F** lets you leave feedback anywhere in the app, logging suggestions straight to Egeria. -> And for engineers and data stewards, the **Technology Types** screen reveals automated curation templates and processes that Egeria can trigger across your tech stack. +> My Profile also strengthens our human network across Coco Pharmaceuticals. +> **My Network** visualizes collaboration graphs and reporting relationships across departments. +> **Work with Communities** connects us to cross-functional working groups, like our Oncology Research and Sustainability circles. +> If I notice something that needs improvement, pressing **Ctrl+F** lets me log feedback directly into Egeria from anywhere in the app. +> And for our integration architects like Bob Nitter, the **Technology Types** screen displays the automated governance action templates Egeria executes behind the scenes. --- -## 7. Wrap-up & Call to Action (4:30 – 5:00) +## 7. Wrap-Up & Call to Action (4:35 – 5:00) **[VISUAL]** Callie back on camera, smiling and enthusiastic. **CALLIE:** -> That is **My Profile** in action: a fast, intuitive, and governed personal cockpit that turns enterprise metadata into everyday productivity. -> When Jules Keeper said *"better data for everyone"*, this is what it looks like on the ground: empowered individuals, transparent collaboration, and trustworthy data at our fingertips. -> `my_profile` is fully open source as part of the `egeria-python` ecosystem. Try it out in your terminal, connect it to the Coco Pharmaceuticals sample environment, and see how easy it is to make Egeria work for you. -> Thanks for watching, and happy data exploring! - -**[END CARD & LINKS]** -- **Egeria Project:** https://egeria-project.org -- **Egeria Python SDK & TUI:** https://github.com/odpi/egeria-python (`my_egeria` package) -- **PRD Associates & Video Series:** https://www.prd-associates.com -- **Run Locally:** `uv run my_profile` or `uv run serve_my_profile` -- *"Catch up on the Jules Keeper Coco Pharmaceuticals Video Series on YouTube"* +> That is **My Profile**: a fast, intuitive, and governed personal cockpit that turns enterprise metadata into everyday productivity. +> When Jules Keeper says *"better data for everyone"*, this is what it looks like in practice: researchers and data scientists spending less time searching for data and more time discovering breakthroughs. +> `my_profile` is fully open source as part of the `egeria-python` project. Try it out in your own terminal, connect it to the Coco Pharmaceuticals demo environment, and experience how open metadata can transform your working day. +> Thanks for watching, and see you next time! + +**[END CARD & RESOURCE LINKS]** +- **Egeria Project:** [https://egeria-project.org](https://egeria-project.org) +- **Coco Pharmaceuticals Personas:** [https://egeria-project.org/practices/coco-pharmaceuticals/personas/](https://egeria-project.org/practices/coco-pharmaceuticals/personas/) +- **PRD Associates & Jules Keeper Video Blogs:** [https://www.prd-associates.com](https://www.prd-associates.com) +- **Egeria Python SDK & TUI:** [https://github.com/odpi/egeria-python](https://github.com/odpi/egeria-python) (`my_egeria` package) +- **Launch Command:** `uv run my_profile` or web interface via `uv run serve_my_profile` +- *"Watch Video Blog 3: Establishing Data Governance by Jules Keeper on YouTube"* --- ## Production & Recording Notes -- **Persona & Tone:** Callie Quartile (Data Scientist). Warm, articulate, practical, and solution-focused. She speaks colleague-to-colleague, demonstrating real workflow gains rather than reading a software feature manual. -- **Visual Styling:** - - Standard 1920×1080 resolution. - - Large monospace terminal font (≥18pt, e.g., JetBrains Mono, Fira Code) running `my_profile.tcss` theme. - - Smooth pan-and-zoom to spotlight active widgets and dialogs during keypresses. -- **Timing & Keystrokes:** Pause 0.5s before striking hotkeys (`Ctrl+T`, `Ctrl+O`, `Ctrl+N`, `Ctrl+K`, `Ctrl+B`, `Ctrl+L`, `Ctrl+U`, `Ctrl+F`) with clear animated key badges on screen. -- **Demo Data Environment:** Run against standard Coco Pharmaceuticals demo metadata (users: `calliequartile`, `peterprofile`, `juleskeeper`, `tessatube`). Pre-seed sample to-dos, comments, clinical trial data products, and community memberships. -- **Browser Web-TUI Option:** Mention or show a 5-second b-roll clip of `serve_my_profile` running inside a web browser to highlight web-socket accessibility. -- **Sample Social / Video Description Copy:** - > Meet My Profile! 🚀 The interactive terminal cockpit for Egeria users. In this video, Callie Quartile (Data Scientist at Coco Pharmaceuticals) demonstrates how she navigates her daily tasks, manages teams and to-dos, explores glossaries, samples data products, and subscribes to governed datasets in seconds. +- **Presenter Persona & Tone:** Callie Quartile (Data Scientist). Warm, authentic, sharp, and collegial. She communicates as a research practitioner sharing practical daily wins with fellow data professionals. +- **Narrative Continuity:** Directly references Jules Keeper's CDO video blogs (specifically Video Blog 3 on *Establishing Data Governance*), illustrating how executive governance principles translate into practitioner tools. +- **Visual Recording Standards:** + - 1080p (1920×1080) 60fps recording. + - Large monospace font (≥18pt, e.g. JetBrains Mono) with the official `my_profile.tcss` dark theme. + - Spotlight zoom on active widgets during keypresses with animated shortcut overlays. +- **Demo Data Pre-Seeding:** + - Use standard Coco Pharmaceuticals demo environment (user: `calliequartile`, view server configured). + - Pre-seed active to-dos, comments linking Dr. Tessa Tube, and sample data products in the Digital Product Catalog (e.g. Clinical Trial Cohort metrics). +- **Web-TUI Accessibility Note:** Include a brief 5-second b-roll cutaway showing `serve_my_profile` accessible over standard web browsers via web sockets. +- **Social Media & Video Description Copy:** + > Meet My Profile! 🚀 The interactive terminal cockpit for Egeria users at Coco Pharmaceuticals. In this practitioner video blog, Data Scientist Callie Quartile demonstrates how she puts Jules Keeper's "better data for everyone" initiative into practice—managing research teams and to-dos, exploring data glossaries, sampling data products, and subscribing to governed datasets in seconds. > - > 📺 Part of the Coco Pharmaceuticals Egeria Video Series. - > 🔗 Learn more: https://egeria-project.org | https://www.prd-associates.com - > 💻 Open Source: github.com/odpi/egeria-python + > 📺 Companion to the Jules Keeper Coco Pharmaceuticals Video Series by Mandy Chessell. + > 🔗 Personas & Architecture: https://egeria-project.org/practices/coco-pharmaceuticals/personas/ + > 🌐 PRD Associates: https://www.prd-associates.com + > 💻 Open Source Repository: https://github.com/odpi/egeria-python > #Egeria #DataGovernance #OpenMetadata #Python #Textual #DataMesh #CocoPharmaceuticals diff --git a/my_egeria/my_egeria/recording/README.md b/my_egeria/my_egeria/recording/README.md new file mode 100644 index 00000000..c217483b --- /dev/null +++ b/my_egeria/my_egeria/recording/README.md @@ -0,0 +1,153 @@ +# My Profile — Automated Terminal Recording Suite + +**Series:** *Coco Pharmaceuticals Data Governance Journey* +**Presenter Persona:** Callie Quartile (Data Scientist) +**Companion Script:** [`../VIDEO_SCRIPT_DRAFT.md`](../VIDEO_SCRIPT_DRAFT.md) + +This directory contains production-ready automated recording scripts that capture high-definition terminal screencasts and vector SVG frames of `my_profile.py` for video blogs, tutorials, presentations, and documentation. + +--- + +## 📁 Directory Structure + +```text +recording/ +├── my_profile_full_walkthrough.tape # Full continuous end-to-end VHS recording (Scenes 2-6) +├── scenes/ +│ ├── scene2_launch_and_startup.tape # Scene 2: Splash screen, async loading, continue +│ ├── scene3_main_dashboard.tape # Scene 3: Dashboard grid, roles & team drill-down +│ ├── scene4_curation_todos_comments.tape # Scene 4: To-Dos (Ctrl+T), Comments (Ctrl+O/N), Bookmarks (Ctrl+K/B) +│ ├── scene5_shop_for_data.tape # Scene 5: Catalogs, sample data (Ctrl+L), subscribe (Ctrl+U) +│ └── scene6_network_communities_feedback.tape # Scene 6: My Network, communities, feedback (Ctrl+F), tech types +├── generate_voiceover.py # AI Text-to-Speech voiceover generator & video assembly pipeline +├── record_demo.py # Python Textual Pilot automated driver (generates vector SVG captures) +├── run_recordings.sh # Master runner script for VHS, Pilot captures, and narration +├── output/ # Generated recording artifacts (ignored by git) +│ ├── audio/ # Synthesized MP3 narration audio tracks per scene & full episode +│ ├── videos/ # Rendered raw 1080p MP4 videos +│ ├── videos_narrated/ # 1080p MP4 videos with synchronized voiceover narration +│ ├── gifs/ # Animated GIF screencasts +│ ├── slides/ # 1080p PNG slide title cards +│ └── captures/ # Timestamped SVG/PNG screenshots per scene +└── README.md # This documentation guide +``` + +--- + +## 🛠️ Prerequisites & Installation + +### Option A: VHS Recording (Recommended for MP4/GIF Video Capture) +Charm's [VHS](https://github.com/charmbracelet/vhs) runs headless terminal scripts with exact millisecond timings and renders 1080p, 60fps MP4 and GIF videos. + +- **macOS (Homebrew):** + ```bash + brew install vhs ffmpeg ttyd + ``` +- **Linux (Debian / Ubuntu):** + ```bash + sudo apt-get install ffmpeg ttyd + go install github.com/charmbracelet/vhs@latest + ``` + +### Option B: Textual Pilot Recorder (Python Native, No External Binary Needed) +Built on Textual's async `Pilot` framework, included out of the box with the project dependencies (`uv sync`). + +--- + +## 🚀 Running Recordings + +### 1. Master Runner Script (`run_recordings.sh`) + +```bash +# Make sure the script is executable +chmod +x my_egeria/my_egeria/recording/run_recordings.sh + +# Record the full continuous walkthrough (Scenes 2 to 6) +./my_egeria/my_egeria/recording/run_recordings.sh --walkthrough + +# Record all individual scene clips +./my_egeria/my_egeria/recording/run_recordings.sh --scenes + +# Record a specific scene clip (e.g. Scene 5: Shop for Data) +./my_egeria/my_egeria/recording/run_recordings.sh --scene 5 + +# Generate all vector SVG screenshots via Textual Pilot +./my_egeria/my_egeria/recording/run_recordings.sh --pilot + +# Generate AI Voiceover narration (Callie Quartile) and merge with recorded video clips +./my_egeria/my_egeria/recording/run_recordings.sh --narrate + +# Assemble the complete 5-minute master video blog episode (Scenes 0-7) +./my_egeria/my_egeria/recording/run_recordings.sh --assemble + +# Run everything (walkthrough + all individual scenes + SVG captures + narration + master episode) +./my_egeria/my_egeria/recording/run_recordings.sh --all +``` + +### 2. Running Voiceover Generator Directly (`generate_voiceover.py`) + +```bash +# Generate narration and merge videos using Edge Neural TTS (default: en-GB-SoniaNeural) +uv run python my_egeria/my_egeria/recording/generate_voiceover.py --assemble + +# Use native macOS speech synthesizer (offline fallback) +uv run python my_egeria/my_egeria/recording/generate_voiceover.py --tts say --voice "Flo (English (UK))" --assemble + +# Generate narration audio files only +uv run python my_egeria/my_egeria/recording/generate_voiceover.py --audio-only + +# Target a specific scene (e.g. Scene 5) +uv run python my_egeria/my_egeria/recording/generate_voiceover.py --scene 5 +``` + +### 3. Running Individual VHS Tapes Directly + +```bash +cd my_egeria/my_egeria/recording + +# Run full walkthrough tape +vhs my_profile_full_walkthrough.tape + +# Run a specific scene tape +vhs scenes/scene5_shop_for_data.tape +``` + +### 4. Running the Python Pilot Driver Directly + +```bash +# Record all scenes headlessly to SVG +uv run python my_egeria/my_egeria/recording/record_demo.py + +# Record a specific scene +uv run python my_egeria/my_egeria/recording/record_demo.py --scene 4 + +# Specify custom output directory +uv run python my_egeria/my_egeria/recording/record_demo.py --output-dir ./my_captures +``` + +--- + +## ⚙️ Environment Configuration + +You can customize the target persona and Egeria platform environment variables before executing recordings: + +```bash +# Set persona to Callie Quartile (default) +export EGERIA_USER_NAME="calliequartile" + +# Set custom view server or platform URL if recording against live or demo servers +export EGERIA_VIEW_SERVER="qs-view-server" +export EGERIA_PLATFORM_URL="https://127.0.0.1:9443" +``` + +--- + +## 🎬 Video Production Workflow + +1. **Audio Narration:** Record spoken voiceover according to [`VIDEO_SCRIPT_DRAFT.md`](../VIDEO_SCRIPT_DRAFT.md). +2. **Video Capture:** Execute `./run_recordings.sh --walkthrough` to generate `output/videos/my_profile_full_walkthrough.mp4` (or use individual scene `.mp4` files from `output/videos/`). +3. **Assembly & Editing:** In your video editor (e.g. DaVinci Resolve, Premiere Pro, Camtasia, CapCut, or via `ffmpeg`): + - Place the presenter intro / title card (Scene 0 & Scene 1). + - Sync the recorded `.mp4` terminal clips with Callie's narration for Scenes 2 through 6. + - Insert lower-thirds, hotkey overlays (`Ctrl+T`, `Ctrl+O`, `Ctrl+L`, `Ctrl+U`), and zoom spotlights onto active dialogs. + - Attach the closing call to action and link end cards (Scene 7). diff --git a/my_egeria/my_egeria/recording/generate_voiceover.py b/my_egeria/my_egeria/recording/generate_voiceover.py new file mode 100644 index 00000000..d970d976 --- /dev/null +++ b/my_egeria/my_egeria/recording/generate_voiceover.py @@ -0,0 +1,860 @@ +#!/usr/bin/env python3 +"""Automated Voiceover & Video Assembly Pipeline for My Profile Video Blog. + +Series: Coco Pharmaceuticals Data Governance Journey +Persona: Callie Quartile (Data Scientist) +Companion Script: VIDEO_SCRIPT_DRAFT.md + +Features: +- Extracts scene narration dialogue from VIDEO_SCRIPT_DRAFT.md +- Generates high-quality TTS audio tracks using edge-tts (Azure Neural) or macOS say +- Automatically matches audio and terminal video durations (with smart frame freezing/padding) +- Merges voiceover tracks with VHS terminal recordings into 1080p narrated MP4s +- Generates visual title cards and intro/outro slides for full episode assembly +- Assembles complete multi-scene video episodes with seamless transitions +""" + +import argparse +import asyncio +import json +import os +import re +import shutil +import subprocess +import sys +from dataclasses import dataclass +from pathlib import Path +from typing import Dict, List, Optional + +SCRIPT_DIR = Path(__file__).resolve().parent +REPO_ROOT = SCRIPT_DIR.parents[2] +DOCS_SCRIPT = SCRIPT_DIR.parent / "VIDEO_SCRIPT_DRAFT.md" +DEFAULT_OUTPUT_DIR = SCRIPT_DIR / "output" + +DEFAULT_EDGE_VOICE = "en-GB-SoniaNeural" +DEFAULT_SAY_VOICE = "Flo (English (UK))" + + +def slugify(text: str) -> str: + """Convert a title to a clean filename slug.""" + text = text.lower().replace("&", "and") + return re.sub(r"[^a-z0-9]+", "_", text).strip("_") + + +@dataclass +class SceneSpec: + number: int + title: str + dialogue: str + scene_type: str # "camera", "slide", or "terminal" + video_file: Optional[str] = None + slide_title: Optional[str] = None + slide_subtitle: Optional[str] = None + callouts: Optional[List[str]] = None + + +# Structured Scene Dialogue based on VIDEO_SCRIPT_DRAFT.md +SCENES: Dict[int, SceneSpec] = { + 0: SceneSpec( + number=0, + title="Cold Open & Introduction", + dialogue=( + "Hi, I'm Callie Quartile. I'm a data scientist here at Coco Pharmaceuticals, " + "working across our Clinical Trials research and AI Pilot teams. " + "If you've been following Jules Keeper's video blogs, you've heard our Chief Data Officer " + "talk about his mission to establish business-led data governance without creating bureaucratic roadblocks. " + "But as someone building cancer research models on patient cohorts, my immediate question was: " + "how does Jules's 'better data for everyone' initiative help me get my daily work done? Where do I actually start? " + "It turns out, I start with me." + ), + scene_type="camera", + slide_title="Coco Pharmaceuticals", + slide_subtitle="Better Data for Everyone — Powered by Egeria\nMeeting Egeria Through My Profile: The Practitioner's Cockpit", + callouts=["Callie Quartile — Data Scientist", "Clinical Trials & AI Pilot Teams"], + ), + 1: SceneSpec( + number=1, + title="The Context: Operationalizing Governance Roles", + dialogue=( + "In his recent video on Establishing Data Governance, Jules pointed out that governance policies on paper " + "remain passive until you attach responsibilities to named roles with real people appointed to them. " + "Egeria already knows the appointed roles I hold, the clinical trial teams I collaborate with under Dr. Tessa Tube, " + "the data definitions curated by Peter Profile, and the privacy classifications set by Faith Broker. " + "But having that information fragmented across multiple tools slows us down. " + "We needed one fast, interactive, keyboard-driven cockpit where any team member can see their governance ecosystem, " + "keep it up to date, and take immediate action. " + "That workspace is My Profile." + ), + scene_type="slide", + slide_title="Operationalizing Data Governance", + slide_subtitle="Attaching Governance Principles to Named Roles & Active Teams", + callouts=[ + "Jules Keeper — CDO (Governance Principles)", + "Faith Broker — Privacy Officer (Classifications)", + "Peter Profile — Information Analyst (Curated Catalogs)", + "Dr. Tessa Tube — Lead Researcher (Clinical Trials)", + ], + ), + 2: SceneSpec( + number=2, + title="Launch & Parallel Background Startup", + dialogue=( + "My Profile is a terminal application built with Textual and pyegeria. When you launch it, there's no waiting around. " + "While this welcome screen greets you, the application is already querying the Egeria metadata highway asynchronously in the background. " + "By the time you hit Continue, your full profile, role appointments, and collections are already loaded in memory. " + "And if I'm pairing with Peter Profile or auditing permissions with Faith Broker, Change User lets us switch identities " + "right from the start with live credential validation." + ), + scene_type="terminal", + video_file="scene2_launch_and_startup.mp4", + slide_title="Launch & Background Startup", + callouts=["Async background profile loading", "Live credential validation", "Instant keyboard response"], + ), + 3: SceneSpec( + number=3, + title="The Main Dashboard Tour", + dialogue=( + "Here is my daily home base. Every single panel is synchronized live with Egeria. " + "At the top, my User Associations and Collections organize the clinical datasets and glossaries I care about. " + "In the middle, you see my appointed Roles and Teams. Notice how governance comes alive here: " + "pressing Enter on my Clinical Trials team role instantly opens My Team, showing colleagues like Tessa Tube and Tanya Tidie " + "along with their active responsibilities. " + "Down here is my daily activity stream: team Blogs, my personal Journal, and my To-Dos. " + "And at the top right, Egeria tracks my Karma Points, recognizing active curation and collaboration across Coco Pharmaceuticals!" + ), + scene_type="terminal", + video_file="scene3_main_dashboard.mp4", + slide_title="Main Dashboard & Roles", + callouts=["Live metadata synchronization", "Role & Team drill-down", "Automated Karma recognition"], + ), + 4: SceneSpec( + number=4, + title="Real-Time Curation: To-Dos, Comments & Bookmarks", + dialogue=( + "Data governance only works if metadata is maintained as part of our normal flow of work, not as an afterthought. " + "Pressing Control plus T lets me edit any highlighted table in place, adding action items from morning stand-ups or updating project milestones. " + "With Control plus O and Control plus N, threaded discussions attach directly to the metadata asset or task itself. " + "Instead of losing critical context in email threads, Dr. Tube and I keep our clinical trial discussions permanently linked to the data. " + "And with Control plus K and Control plus B, I can bookmark key assets and retrieve them instantly with a single keystroke." + ), + scene_type="terminal", + video_file="scene4_curation_todos_comments.mp4", + slide_title="Real-Time Metadata Curation", + callouts=[ + "Ctrl+T Edit Table", + "Ctrl+O View Comments / Ctrl+N Add Comment", + "Ctrl+K Bookmark Row / Ctrl+B View Bookmarks", + ], + ), + 5: SceneSpec( + number=5, + title="The Hero Workflow: Shopping for Governed Data Products", + dialogue=( + "Now for the most powerful feature in my workflow: Shop for Data. " + "Before Jules Keeper established our open metadata catalog, finding trusted clinical data meant weeks of meetings and manual approvals. " + "Here, Egeria brings together Business Domains, Glossaries, Data Dictionaries, and Digital Product Catalogs into a unified data marketplace. " + "I can explore standardized terminology, verify classifications, and hit Control plus L to sample the dataset right in my terminal " + "to ensure it fits my AI model requirements. " + "When it's right, Control plus U lets me submit a formal Subscription Request. " + "Egeria ensures Faith Broker's privacy rules and compliance policies are satisfied, giving data owners full visibility into who is using their data and why. " + "In less than sixty seconds, governed access is requested, validated, and tracked in Subscriptions." + ), + scene_type="terminal", + video_file="scene5_shop_for_data.mp4", + slide_title="Governed Data Marketplace", + callouts=[ + "Unified Data Marketplace", + "Instant Data Sampling (Ctrl+L)", + "Governed Subscriptions (Ctrl+U)", + ], + ), + 6: SceneSpec( + number=6, + title="Collaboration, Networks & Technology Curation", + dialogue=( + "My Profile also strengthens our human network across Coco Pharmaceuticals. " + "My Network visualizes collaboration graphs and reporting relationships across departments. " + "Work with Communities connects us to cross-functional working groups, like our Oncology Research and Sustainability circles. " + "If I notice something that needs improvement, pressing Control plus F lets me log feedback directly into Egeria from anywhere in the app. " + "And for our integration architects like Bob Nitter, the Technology Types screen displays the automated governance action templates " + "Egeria executes behind the scenes." + ), + scene_type="terminal", + video_file="scene6_network_communities_feedback.mp4", + slide_title="Collaboration & Networks", + callouts=[ + "Interactive Network Graph", + "Community Workspaces", + "In-App Feedback (Ctrl+F)", + "Technology Curation Types", + ], + ), + 7: SceneSpec( + number=7, + title="Wrap-Up & Call to Action", + dialogue=( + "That is My Profile: a fast, intuitive, and governed personal cockpit that turns enterprise metadata into everyday productivity. " + "When Jules Keeper says 'better data for everyone', this is what it looks like in practice: " + "researchers and data scientists spending less time searching for data and more time discovering breakthroughs. " + "My Profile is fully open source as part of the egeria-python project. " + "Try it out in your own terminal, connect it to the Coco Pharmaceuticals demo environment, " + "and experience how open metadata can transform your working day. " + "Thanks for watching, and see you next time!" + ), + scene_type="camera", + slide_title="Better Data for Everyone", + slide_subtitle="Open Metadata & Governed Productivity with Egeria\nhttps://egeria-project.org\nhttps://github.com/odpi/egeria-python", + callouts=["Launch: uv run my_profile", "Web: uv run serve_my_profile"], + ), +} + + +class VoiceoverSynthesizer: + """Handles text-to-speech synthesis using edge-tts or macOS say.""" + + def __init__(self, backend: str = "auto", voice: Optional[str] = None, rate: str = "+0%"): + self.backend = self._resolve_backend(backend) + self.voice = voice or (DEFAULT_EDGE_VOICE if self.backend == "edge" else DEFAULT_SAY_VOICE) + self.rate = rate + + def _resolve_backend(self, backend: str) -> str: + if backend in ("edge", "edge-tts"): + return "edge" + if backend in ("say", "macos"): + return "say" + # Auto-detect + try: + import edge_tts # noqa: F401 + + return "edge" + except ImportError: + if shutil.which("say"): + return "say" + return "edge" + + async def synthesize(self, text: str, output_path: Path) -> Path: + output_path.parent.mkdir(parents=True, exist_ok=True) + if self.backend == "edge": + await self._synthesize_edge(text, output_path) + else: + self._synthesize_say(text, output_path) + return output_path + + async def _synthesize_edge(self, text: str, output_path: Path) -> None: + try: + import edge_tts + + communicate = edge_tts.Communicate(text=text, voice=self.voice, rate=self.rate) + await communicate.save(str(output_path)) + except ImportError: + # Fallback to CLI + cmd = [ + "edge-tts", + "--voice", + self.voice, + "--text", + text, + "--write-media", + str(output_path), + ] + if self.rate and self.rate != "+0%": + cmd.extend(["--rate", self.rate]) + subprocess.run(cmd, check=True, capture_output=True) + + def _synthesize_say(self, text: str, output_path: Path) -> None: + aiff_path = output_path.with_suffix(".aiff") + cmd_say = ["say", "-v", self.voice, "-o", str(aiff_path), text] + subprocess.run(cmd_say, check=True) + + # Convert AIFF to MP3 with ffmpeg + cmd_ffmpeg = [ + "ffmpeg", + "-y", + "-i", + str(aiff_path), + "-codec:a", + "libmp3lame", + "-qscale:a", + "2", + str(output_path), + ] + subprocess.run(cmd_ffmpeg, check=True, capture_output=True) + if aiff_path.exists(): + aiff_path.unlink() + + +def render_slide_image(scene: SceneSpec, output_png: Path) -> Path: + """Render a high-resolution 1080p slide PNG image using Pillow.""" + try: + from PIL import Image, ImageDraw, ImageFont + except ImportError: + # Fallback if Pillow is not available + return output_png + + width, height = 1920, 1080 + img = Image.new("RGB", (width, height), color=(17, 17, 27)) # #11111b + draw = ImageDraw.Draw(img) + + # Outer card + draw.rounded_rectangle([(80, 80), (1840, 1000)], radius=24, fill=(24, 24, 37), outline=(49, 50, 68), width=4) + + # Accent pill + draw.rounded_rectangle([(140, 140), (152, 250)], radius=6, fill=(137, 180, 250)) + + # Helper to load system fonts + def get_font(size: int, mono: bool = False, bold: bool = False): + font_candidates = [] + if mono: + font_candidates = [ + "/System/Library/Fonts/Menlo.ttc", + "/System/Library/Fonts/SFCompactMono.ttf", + "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf", + ] + elif bold: + font_candidates = [ + "/System/Library/Fonts/HelveticaNeue-Bold.otf", + "/System/Library/Fonts/Helvetica.ttc", + "/Library/Fonts/Arial Bold.ttf", + "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", + ] + else: + font_candidates = [ + "/System/Library/Fonts/Helvetica.ttc", + "/Library/Fonts/Arial.ttf", + "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", + ] + for fpath in font_candidates: + if os.path.exists(fpath): + try: + return ImageFont.truetype(fpath, size) + except Exception: + pass + return ImageFont.load_default() + + font_brand = get_font(52, bold=True) + font_series = get_font(26) + font_scene = get_font(40, bold=True) + font_body = get_font(28) + font_box_header = get_font(22, mono=True, bold=True) + font_box_content = get_font(22, mono=True) + font_footer = get_font(20) + + title = scene.slide_title or scene.title + subtitle = scene.slide_subtitle or "" + + # Brand Title + draw.text((180, 150), title, fill=(205, 214, 244), font=font_brand) + draw.text((180, 215), "Coco Pharmaceuticals Data Governance Journey • Video Blog", fill=(166, 173, 200), font=font_series) + + # Separator line + draw.line([(140, 280), (1780, 280)], fill=(49, 50, 68), width=3) + + # Scene Title & Subtitle + draw.text((140, 320), f"Scene {scene.number}: {scene.title}", fill=(137, 180, 250), font=font_scene) + + # Multiline Subtitle + curr_y = 390 + for line in subtitle.split("\n"): + if line.strip(): + draw.text((140, curr_y), line.strip(), fill=(186, 194, 222), font=font_body) + curr_y += 45 + + # Key Focus Box + if scene.callouts: + line_height = 42 + num_callouts = len(scene.callouts) + box_content_height = 40 + (num_callouts * line_height) + box_height = max(box_content_height + 50, 180) + box_y1 = min(max(curr_y + 40, 540), 900 - box_height) + box_y2 = box_y1 + box_height + draw.rounded_rectangle([(140, box_y1), (1780, box_y2)], radius=16, fill=(17, 17, 27), outline=(69, 71, 90), width=2) + draw.text((180, box_y1 + 25), "KEY HIGHLIGHTS & WORKFLOW FOCUS:", fill=(166, 227, 161), font=font_box_header) + callout_y = box_y1 + 75 + for item in scene.callouts: + draw.text((180, callout_y), f"• {item}", fill=(249, 226, 175), font=font_box_content) + callout_y += line_height + + # Footer + draw.text((140, 940), "Egeria Project • Open Metadata & Governed Productivity • My Profile Cockpit", fill=(108, 112, 134), font=font_footer) + + output_png.parent.mkdir(parents=True, exist_ok=True) + img.save(str(output_png), "PNG") + return output_png + + +class MediaProcessor: + """Handles audio/video alignment, padding, title card creation, and multi-scene assembly.""" + + def __init__(self, output_dir: Path): + self.output_dir = output_dir + self.audio_dir = output_dir / "audio" + self.videos_dir = output_dir / "videos" + self.narrated_dir = output_dir / "videos_narrated" + self.slides_dir = output_dir / "slides" + + for d in (self.audio_dir, self.videos_dir, self.narrated_dir, self.slides_dir): + d.mkdir(parents=True, exist_ok=True) + + def get_duration(self, file_path: Path) -> float: + """Get duration of audio or video file in seconds via ffprobe.""" + cmd = [ + "ffprobe", + "-v", + "error", + "-show_entries", + "format=duration", + "-of", + "json", + str(file_path), + ] + res = subprocess.run(cmd, capture_output=True, text=True, check=True) + data = json.loads(res.stdout) + return float(data["format"]["duration"]) + + def create_title_slide_video(self, scene: SceneSpec, audio_path: Path, output_mp4: Path) -> Path: + """Create a 1080p slide video clip with audio narration for camera/slide scenes.""" + audio_duration = self.get_duration(audio_path) + total_duration = audio_duration + 1.0 # Add 1.0s grace pad + + png_path = self.slides_dir / f"slide_scene_{scene.number}.png" + render_slide_image(scene, png_path) + + # Convert PNG + Audio to MP4 with consistent framerate, 48kHz stereo audio, no B-frames (QuickTime safety), and faststart + cmd = [ + "ffmpeg", + "-y", + "-loop", + "1", + "-framerate", + "25", + "-i", + str(png_path), + "-i", + str(audio_path), + "-c:v", + "libx264", + "-r", + "25", + "-g", + "50", + "-keyint_min", + "25", + "-bf", + "0", + "-pix_fmt", + "yuv420p", + "-c:a", + "aac", + "-b:a", + "192k", + "-ar", + "48000", + "-ac", + "2", + "-t", + f"{total_duration:.2f}", + "-shortest", + "-movflags", + "+faststart", + str(output_mp4), + ] + subprocess.run(cmd, check=True, capture_output=True) + return output_mp4 + + def merge_audio_video( + self, + video_path: Path, + audio_path: Path, + output_path: Path, + lead_in_seconds: float = 0.5, + lead_out_seconds: float = 1.0, + ) -> Path: + """Merge audio with a terminal video recording, dynamically matching duration with video freeze.""" + video_dur = self.get_duration(video_path) + audio_dur = self.get_duration(audio_path) + + target_audio_dur = audio_dur + lead_in_seconds + lead_out_seconds + + print(f" Merging: video={video_dur:.2f}s, audio={audio_dur:.2f}s -> target={target_audio_dur:.2f}s") + + # Audio filter: delay audio by lead_in, resample to 48kHz stereo, reset audio PTS + adelay_ms = int(lead_in_seconds * 1000) + audio_filter = f"[1:a]adelay={adelay_ms}|{adelay_ms},apad,aformat=sample_rates=48000:channel_layouts=stereo,asetpts=PTS-STARTPTS[a]" + + if target_audio_dur > video_dur: + # Need to freeze last frame of video for (target_audio_dur - video_dur) + diff = target_audio_dur - video_dur + video_filter = ( + f"[0:v]fps=25,scale=1920:1080:force_original_aspect_ratio=decrease," + f"pad=1920:1080:(ow-iw)/2:(oh-ih)/2,tpad=stop_mode=clone:stop_duration={diff:.2f}," + f"setpts=PTS-STARTPTS[v]" + ) + filter_complex = f"{video_filter};{audio_filter}" + cmd = [ + "ffmpeg", + "-y", + "-i", + str(video_path), + "-i", + str(audio_path), + "-filter_complex", + filter_complex, + "-map", + "[v]", + "-map", + "[a]", + "-c:v", + "libx264", + "-r", + "25", + "-g", + "50", + "-keyint_min", + "25", + "-bf", + "0", + "-pix_fmt", + "yuv420p", + "-c:a", + "aac", + "-b:a", + "192k", + "-ar", + "48000", + "-ac", + "2", + "-t", + f"{target_audio_dur:.2f}", + "-movflags", + "+faststart", + str(output_path), + ] + else: + # Video is longer than audio; audio will finish and padded silence will play until video end + total_dur = video_dur + video_filter = ( + f"[0:v]fps=25,scale=1920:1080:force_original_aspect_ratio=decrease," + f"pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setpts=PTS-STARTPTS[v]" + ) + filter_complex = f"{video_filter};{audio_filter}" + cmd = [ + "ffmpeg", + "-y", + "-i", + str(video_path), + "-i", + str(audio_path), + "-filter_complex", + filter_complex, + "-map", + "[v]", + "-map", + "[a]", + "-c:v", + "libx264", + "-r", + "25", + "-g", + "50", + "-keyint_min", + "25", + "-bf", + "0", + "-pix_fmt", + "yuv420p", + "-c:a", + "aac", + "-b:a", + "192k", + "-ar", + "48000", + "-ac", + "2", + "-t", + f"{total_dur:.2f}", + "-movflags", + "+faststart", + str(output_path), + ] + + subprocess.run(cmd, check=True, capture_output=True) + return output_path + + def concatenate_audio_files(self, audio_paths: List[Path], output_path: Path, gap_seconds: float = 0.8) -> Path: + """Concatenate multiple audio files with a brief silence gap between each.""" + filter_inputs = [] + filter_parts = [] + for i, ap in enumerate(audio_paths): + filter_inputs.extend(["-i", str(ap)]) + # Pad each audio except the last with silence + if i < len(audio_paths) - 1: + filter_parts.append(f"[{i}:a]apad=pad_dur={gap_seconds:.2f}[a{i}];") + else: + filter_parts.append(f"[{i}:a]anull[a{i}];") + + concat_str = "".join(f"[a{i}]" for i in range(len(audio_paths))) + filter_parts.append(f"{concat_str}concat=n={len(audio_paths)}:v=0:a=1[outa]") + + filter_complex = "".join(filter_parts) + cmd = [ + "ffmpeg", + "-y", + *filter_inputs, + "-filter_complex", + filter_complex, + "-map", + "[outa]", + "-c:a", + "libmp3lame", + "-ar", + "48000", + "-ac", + "2", + "-qscale:a", + "2", + str(output_path), + ] + subprocess.run(cmd, check=True, capture_output=True) + return output_path + + def concatenate_videos(self, video_paths: List[Path], output_path: Path) -> Path: + """Concatenate a sequence of MP4 video files into a single master video.""" + filter_inputs = [] + filter_streams = [] + for i, vp in enumerate(video_paths): + filter_inputs.extend(["-i", str(vp.resolve())]) + filter_streams.append(f"[{i}:v][{i}:a]") + + concat_spec = "".join(filter_streams) + f"concat=n={len(video_paths)}:v=1:a=1[outv][outa]" + + cmd = [ + "ffmpeg", + "-y", + *filter_inputs, + "-filter_complex", + concat_spec, + "-map", + "[outv]", + "-map", + "[outa]", + "-c:v", + "libx264", + "-r", + "25", + "-g", + "50", + "-keyint_min", + "25", + "-bf", + "0", + "-pix_fmt", + "yuv420p", + "-c:a", + "aac", + "-b:a", + "192k", + "-ar", + "48000", + "-ac", + "2", + "-movflags", + "+faststart", + str(output_path), + ] + subprocess.run(cmd, check=True, capture_output=True) + return output_path + + +async def generate_all_audio( + synthesizer: VoiceoverSynthesizer, + processor: MediaProcessor, + target_scenes: Optional[List[int]] = None, +) -> Dict[int, Path]: + """Generate audio MP3 files for all or selected scenes concurrently.""" + scenes_to_run = target_scenes if target_scenes is not None else list(SCENES.keys()) + audio_map: Dict[int, Path] = {} + + print(f"\n>>> Generating Voiceover Audio using [{synthesizer.backend.upper()}] voice: '{synthesizer.voice}'...", flush=True) + + async def synth_scene(num: int) -> tuple[int, Path]: + scene = SCENES[num] + audio_file = processor.audio_dir / f"scene{num}_{slugify(scene.title)}.mp3" + print(f" [Synthesizing Scene {num}] {scene.title} ...", flush=True) + await synthesizer.synthesize(scene.dialogue, audio_file) + print(f" ✓ Generated: {audio_file.name}", flush=True) + return num, audio_file + + results = await asyncio.gather(*(synth_scene(num) for num in scenes_to_run)) + for num, audio_file in results: + audio_map[num] = audio_file + + # Generate combined walkthrough audio (terminal scenes 2-6) via fast audio concatenation + if all(k in audio_map for k in (2, 3, 4, 5, 6)): + wt_audio = processor.audio_dir / "my_profile_full_walkthrough_narration.mp3" + print(" [Assembling Walkthrough Audio] Scenes 2 to 6 combined ...", flush=True) + processor.concatenate_audio_files([audio_map[i] for i in (2, 3, 4, 5, 6)], wt_audio, gap_seconds=1.0) + print(f" ✓ Generated: {wt_audio.name}", flush=True) + + # Generate full episode audio (Scenes 0 to 7) via fast audio concatenation + if all(k in audio_map for k in range(8)): + full_audio = processor.audio_dir / "coco_pharma_my_profile_full_episode_audio.mp3" + print(" [Assembling Full Episode Audio] Scenes 0 to 7 combined ...", flush=True) + processor.concatenate_audio_files([audio_map[i] for i in range(8)], full_audio, gap_seconds=1.2) + print(f" ✓ Generated: {full_audio.name}", flush=True) + + return audio_map + + +def build_narrated_videos( + processor: MediaProcessor, + audio_map: Dict[int, Path], + target_scenes: Optional[List[int]] = None, +) -> List[Path]: + """Assemble individual narrated scene videos and master walkthrough.""" + scenes_to_run = target_scenes if target_scenes is not None else list(SCENES.keys()) + narrated_clips: List[Path] = [] + + print("\n>>> Merging Video Captures & Audio Narration with FFmpeg...", flush=True) + + for num in sorted(scenes_to_run): + scene = SCENES[num] + audio_path = audio_map.get(num) + if not audio_path or not audio_path.exists(): + print(f" [SKIP Scene {num}] Audio file missing.", flush=True) + continue + + output_clip = processor.narrated_dir / f"scene{num}_{slugify(scene.title)}_narrated.mp4" + + if scene.scene_type in ("camera", "slide"): + print(f" [Building Slide Scene {num}] {scene.title} ...", flush=True) + processor.create_title_slide_video(scene, audio_path, output_clip) + narrated_clips.append(output_clip) + print(f" ✓ Rendered: {output_clip.name}", flush=True) + else: + # Terminal scene + video_input = processor.videos_dir / (scene.video_file or f"scene{num}.mp4") + if not video_input.exists(): + print(f" [WARNING] Video recording missing for Scene {num}: {video_input.name}", flush=True) + print(" Generating slide fallback for scene preview...", flush=True) + processor.create_title_slide_video(scene, audio_path, output_clip) + else: + print(f" [Merging Scene {num}] {scene.title} ...", flush=True) + processor.merge_audio_video(video_input, audio_path, output_clip) + narrated_clips.append(output_clip) + print(f" ✓ Rendered: {output_clip.name}", flush=True) + + # Process full continuous walkthrough if present + full_wt_video = processor.videos_dir / "my_profile_full_walkthrough.mp4" + full_wt_audio = processor.audio_dir / "my_profile_full_walkthrough_narration.mp3" + if full_wt_video.exists() and full_wt_audio.exists(): + wt_out = processor.narrated_dir / "my_profile_full_walkthrough_narrated.mp4" + print("\n [Merging Full Walkthrough Video] Scenes 2 to 6 continuous ...", flush=True) + processor.merge_audio_video(full_wt_video, full_wt_audio, wt_out, lead_in_seconds=0.0, lead_out_seconds=0.5) + print(f" ✓ Rendered: {wt_out.name}", flush=True) + + return narrated_clips + + +def assemble_full_episode(processor: MediaProcessor, narrated_clips: List[Path]) -> Optional[Path]: + """Concatenate scenes into a complete seamless 5-minute video blog.""" + print("\n>>> Assembling Master Complete Video Blog...") + + scene0 = processor.narrated_dir / f"scene0_{slugify(SCENES[0].title)}_narrated.mp4" + scene1 = processor.narrated_dir / f"scene1_{slugify(SCENES[1].title)}_narrated.mp4" + walkthrough = processor.narrated_dir / "my_profile_full_walkthrough_narrated.mp4" + scene7 = processor.narrated_dir / f"scene7_{slugify(SCENES[7].title)}_narrated.mp4" + + if scene0.exists() and scene1.exists() and walkthrough.exists() and scene7.exists(): + sequence = [scene0, scene1, walkthrough, scene7] + print(" Using seamless continuous terminal walkthrough (Scenes 2-6) without redundant terminal re-launches.") + else: + sequence = narrated_clips + + master_output = processor.narrated_dir / "coco_pharma_my_profile_complete_video_blog.mp4" + processor.concatenate_videos(sequence, master_output) + print(f" ✓ MASTER VIDEO CREATED: {master_output}") + print(f" Duration: {processor.get_duration(master_output):.1f} seconds") + return master_output + + +async def main_async() -> None: + parser = argparse.ArgumentParser(description="Generate voiceover audio and assemble narrated videos for My Profile.") + parser.add_argument( + "--tts", + choices=["auto", "edge", "say"], + default="auto", + help="TTS engine: 'edge' (Azure Neural) or 'say' (macOS native)", + ) + parser.add_argument( + "--voice", + default=None, + help=f"Voice name (default: {DEFAULT_EDGE_VOICE} for edge, {DEFAULT_SAY_VOICE} for say)", + ) + parser.add_argument("--rate", default="+0%", help="Speech rate adjustment (e.g. '+5%%', '-5%%')") + parser.add_argument( + "--scene", + default="all", + help="Target scene number (0-7), 'walkthrough' (2-6), or 'all' (default: all)", + ) + parser.add_argument("--audio-only", action="store_true", help="Generate audio tracks without merging video") + parser.add_argument("--merge-only", action="store_true", help="Merge existing audio without re-synthesizing") + parser.add_argument("--assemble", action="store_true", help="Assemble complete master multi-scene video episode") + parser.add_argument("--output-dir", type=Path, default=DEFAULT_OUTPUT_DIR, help="Output directory path") + + args = parser.parse_args() + + processor = MediaProcessor(args.output_dir) + synthesizer = VoiceoverSynthesizer(backend=args.tts, voice=args.voice, rate=args.rate) + + target_scenes: Optional[List[int]] = None + if args.scene.isdigit(): + target_scenes = [int(args.scene)] + elif args.scene.lower() == "walkthrough": + target_scenes = [2, 3, 4, 5, 6] + elif args.scene.lower() == "all": + target_scenes = list(SCENES.keys()) + + print("========================================================================") + print(" My Profile — Video Blog Voiceover & Video Assembly") + print(" Series: Coco Pharmaceuticals Data Governance Journey") + print(" Persona: Callie Quartile (Data Scientist)") + print(f" TTS: {synthesizer.backend.upper()} (Voice: {synthesizer.voice})") + print(f" Output: {args.output_dir}") + print("========================================================================") + + # 1. Generate Audio + audio_map: Dict[int, Path] = {} + if not args.merge_only: + audio_map = await generate_all_audio(synthesizer, processor, target_scenes) + else: + # Load existing audio + for num in (target_scenes or SCENES.keys()): + scene = SCENES[num] + f = processor.audio_dir / f"scene{num}_{scene.title.lower().replace(' ', '_').replace(':', '')}.mp3" + if f.exists(): + audio_map[num] = f + + if args.audio_only: + print("\n>>> Audio generation complete (--audio-only specified).") + return + + # 2. Build Narrated Videos + narrated_clips = build_narrated_videos(processor, audio_map, target_scenes) + + # 3. Assemble Full Episode if requested or if all scenes were built + if args.assemble or (target_scenes is not None and len(target_scenes) == len(SCENES)): + assemble_full_episode(processor, narrated_clips) + + print("\n========================================================================") + print(" Pipeline completed successfully!") + print(f" Narrated Videos: {processor.narrated_dir}") + print(f" Audio Tracks: {processor.audio_dir}") + print("========================================================================") + + +def main() -> None: + asyncio.run(main_async()) + + +if __name__ == "__main__": + main() diff --git a/my_egeria/my_egeria/recording/my_profile_full_walkthrough.tape b/my_egeria/my_egeria/recording/my_profile_full_walkthrough.tape new file mode 100644 index 00000000..eb79fa19 --- /dev/null +++ b/my_egeria/my_egeria/recording/my_profile_full_walkthrough.tape @@ -0,0 +1,220 @@ +# VHS Tape: My Profile - Full Walkthrough +# Reproduces the complete video script sequence (Scenes 2 to 6) for Callie Quartile +# Output: mp4 and gif recordings + +Output my_profile_full_walkthrough.mp4 +# Output my_profile_full_walkthrough.gif + +Set Shell "bash" +Set FontSize 18 +Set FontFamily "Menlo" +Set Width 1920 +Set Height 1080 +Set Padding 20 +Set Theme "Catppuccin Mocha" +Set WindowBar "Colorful" +Set WindowBarSize 40 +Set MarginFill "#1e1e2e" +Set BorderRadius 10 +Set TypingSpeed 50ms + +# Configure 24-bit TrueColor terminal environment +Type "unset NO_COLOR && export COLORTERM=truecolor TERM=xterm-256color FORCE_COLOR=1 && clear" +Enter +Sleep 500ms + +# ============================================================================== +# Scene 2: Launch & Parallel Background Startup (0s to 33.7s) +# ============================================================================== +# 0s-3s: Launch command +Type "uv run my_profile" +Sleep 500ms +Enter +Sleep 3.5s + +# 3.5s-14s: Welcome Splash Screen displays with async loading +Screenshot splash_screen.png +Sleep 10.5s + +# 14s-21s: Continue into Main Dashboard +Enter +Sleep 3s +Screenshot main_dashboard.png +Sleep 3.5s + +# 21s-33.7s: Highlight loaded profile, User Associations & Collections +Tab +Sleep 2.5s +Down 1 +Sleep 3s +Up 1 +Sleep 3s +Sleep 3.7s + +# ============================================================================== +# Scene 3: Main Dashboard Tour (33.7s to 77.5s) +# ============================================================================== +# 33.7s-45s: Explore User Associations & Collections +Tab +Sleep 2.5s +Down 1 +Sleep 3s +Up 1 +Sleep 4.5s + +# 45s-61.5s: Roles & Teams drill-down -> Open My Team screen +Tab +Sleep 1.5s +Enter +Sleep 2s +Screenshot my_team.png +Sleep 10s +Escape +Sleep 1.5s + +# 61.5s-69s: Activity Stream (Blogs, Journal, To-Dos) +Tab +Sleep 1.5s +Down 2 +Sleep 5.5s + +# 69s-77.5s: Karma Points recognition +Up 2 +Sleep 2s +Shift+Tab +Shift+Tab +Sleep 6.5s + +# ============================================================================== +# Scene 4: Real-Time Curation: To-Dos, Comments & Bookmarks (77.5s to 118.3s) +# ============================================================================== +# 77.5s-91s: Edit Table (Ctrl+T) on To-Dos +Tab 3 +Sleep 1s +Down 2 +Sleep 1.5s +Ctrl+T +Sleep 1.5s +Screenshot edit_todos.png +Tab +Sleep 500ms +Type "Verify hospital cohort schema with Peter Profile" +Sleep 3s +Escape +Sleep 1.5s + +# 91s-97s: View Comments (Ctrl+O) +Ctrl+O +Sleep 2.5s +Screenshot show_comments.png +Escape +Sleep 1.5s + +# 97s-107.5s: Add Comment (Ctrl+N) +Ctrl+N +Sleep 1.5s +Screenshot add_comment.png +Type "Confidence score 0.95 verified against clinical laboratory assay standards" +Sleep 3.5s +Escape +Sleep 2s + +# 107.5s-118.3s: Bookmark Row (Ctrl+K) & View Bookmarks (Ctrl+B) +Ctrl+K +Sleep 1.5s +Ctrl+B +Sleep 2s +Screenshot my_bookmarks.png +Sleep 5s +Escape +Sleep 1.3s + +# ============================================================================== +# Scene 5: Hero Workflow: Shopping for Governed Data Products (118.3s to 174.7s) +# ============================================================================== +# 118.3s-138s: Open Shop for Data & Browse Catalogs +Tab 2 +Down 6 +Sleep 1s +Enter +Sleep 3s +Screenshot shop_for_data.png +Tab +Sleep 2s +Down 2 +Sleep 3.5s +Down 1 +Sleep 6.5s + +# 138s-149.5s: Sample Data Modal (Ctrl+L) +Ctrl+L +Sleep 2s +Screenshot sample_data.png +Sleep 7.5s +Escape +Sleep 1.5s + +# 149.5s-164.5s: Create Subscription Request (Ctrl+U) +Ctrl+U +Sleep 2s +Screenshot create_subscription.png +Tab +Sleep 500ms +Type "AI oncology treatment response modeling" +Sleep 3.5s +Escape +Sleep 1.5s + +# 164.5s-174.7s: Return to Main Dashboard and View Subscriptions +Escape +Sleep 1.5s +Tab 2 +Down 5 +Sleep 1s +Enter +Sleep 2s +Screenshot subscriptions.png +Sleep 4s +Escape +Sleep 0.7s + +# ============================================================================== +# Scene 6: Collaboration, Networks & Technology Curation (174.7s to 212.0s) +# ============================================================================== +# 174.7s-185s: My Network Graph Visualization +Tab 2 +Down 1 +Sleep 1s +Enter +Sleep 2s +Screenshot my_network.png +Sleep 5s +Escape +Sleep 1s + +# 185s-193.5s: Work with Communities +Down 1 +Sleep 1s +Enter +Sleep 2s +Screenshot communities.png +Sleep 3.5s +Escape +Sleep 1s + +# 193.5s-202.5s: In-App Feedback Dialog (Ctrl+F) +Ctrl+F +Sleep 1.5s +Screenshot leave_feedback.png +Type "Great catalog navigation! Requesting automated lineage graph view." +Sleep 2.5s +Escape +Sleep 1.5s + +# 202.5s-212s: Technology Types Screen +Down 3 +Sleep 1s +Enter +Sleep 2s +Screenshot tech_types.png +Sleep 5.5s diff --git a/my_egeria/my_egeria/recording/record_demo.py b/my_egeria/my_egeria/recording/record_demo.py new file mode 100644 index 00000000..dee82da3 --- /dev/null +++ b/my_egeria/my_egeria/recording/record_demo.py @@ -0,0 +1,303 @@ +""" + PDX-License-Identifier: Apache-2.0 + Copyright Contributors to the ODPi Egeria project. + + Automated Textual Pilot Demo Recorder for My Profile (Callie Quartile Video Script). + Drives the application headlessly through all 6 video scenes and generates + timestamped, high-resolution SVG screenshots for video assets, slides, and documentation. + + Usage: + python my_egeria/my_egeria/recording/record_demo.py + python my_egeria/my_egeria/recording/record_demo.py --scene 5 + python my_egeria/my_egeria/recording/record_demo.py --output-dir ./custom_captures +""" + +import argparse +import asyncio +import os +import re +import sys +from pathlib import Path + +from textual.app import App +from textual.pilot import Pilot +from textual.widgets import DataTable, Input, OptionList + +# Ensure my_profile package path is available +RECORDING_DIR = Path(__file__).resolve().parent +MY_PROFILE_DIR = RECORDING_DIR.parent +REPO_ROOT = MY_PROFILE_DIR.parents[1] + +if str(MY_PROFILE_DIR) not in sys.path: + sys.path.insert(0, str(MY_PROFILE_DIR)) +if str(REPO_ROOT) not in sys.path: + sys.path.insert(0, str(REPO_ROOT)) + +from my_egeria.my_profile import MyProfileApp + +DEFAULT_SIZE = (150, 42) +DEFAULT_OUTPUT_DIR = RECORDING_DIR / "output" / "captures" + + +async def wait_for_table(pilot: Pilot, table: DataTable, timeout: float = 30.0) -> bool: + """Wait until a DataTable has finished loading and populated rows (or timed out).""" + for _ in range(int(timeout / 0.5)): + await pilot.pause(0.5) + if not table.loading: + return True + return False + + +def sanitize_svg(svg_content: str) -> str: + """Sanitize Textual/Rich SVG export to fix character spacing and typography. + + Removes font-variant-east-asian: full-width (which forces double spacing in modern SVG viewers), + ensures proper JetBrains Mono and standard monospace font metrics, and adjusts styling. + """ + # 1. Remove font-variant-east-asian: full-width + svg = re.sub(r"font-variant-east-asian:\s*full-width;?", "", svg_content) + + # 2. Embed JetBrains Mono webfont and fallbacks + jb_font = """ + @font-face { + font-family: "JetBrains Mono"; + src: local("JetBrainsMono-Regular"), local("JetBrains Mono"), + url("https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2") format("woff2"); + font-style: normal; + font-weight: 400; + } + @font-face { + font-family: "JetBrains Mono"; + src: local("JetBrainsMono-Bold"), local("JetBrains Mono-Bold"), + url("https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Bold.woff2") format("woff2"); + font-style: bold; + font-weight: 700; + } +""" + if "