diff --git a/README.md b/README.md index 0a588c67..0d02a9c7 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ For detailed information on using pyegeria, see: - [docs/user_programming.md](docs/user_programming.md): A comprehensive guide to the programming model, configuration, and client usage. - [docs/output-formats-and-report-specs.md](docs/output-formats-and-report-specs.md): Guidance on output formats and report specs (including nested/master–detail). - [md_processing/v2/README.md](md_processing/v2/README.md): Detailed documentation on the Dr. Egeria v2 (Async) markdown processing engine, including rules for attribute validation and reference resolution. +- [my_egeria/README.md](my_egeria/README.md): Documentation and user guides for the My Egeria and My Profile Textual TUI applications. ### Report specs: families and filtering diff --git a/docs/My-Egeria-Doc.md b/docs/My-Egeria-Doc.md index 90d5282b..7a0dc78b 100644 --- a/docs/My-Egeria-Doc.md +++ b/docs/My-Egeria-Doc.md @@ -3,9 +3,9 @@ # My Profile Application: Reference Guide -This guide explains how the **My Profile Application** (`my_egeria.py`) is put together: its screens, the handler mixins behind them, the Egeria calls each flow makes, and the codes screens use to talk to the app. To learn how to *use* the app (configuration, starting it, keys), see the [My Profile App User Manual](my_egeria_manual.md). +This guide explains how the **My Profile Application** (`my_profile.py`) is put together: its screens, the handler mixins behind them, the Egeria calls each flow makes, and the codes screens use to talk to the app. To learn how to *use* the app (configuration, starting it, keys), see the [My Profile App User Manual](my_egeria_manual.md). -All source files named here are in `my_egeria/my_egeria/DemoCode/My_Profile/`. +All source files named here are in `my_egeria/my_egeria/`. --- @@ -13,7 +13,7 @@ All source files named here are in `my_egeria/my_egeria/DemoCode/My_Profile/`. | File | Contents | | :--- | :--- | -| `my_egeria.py` | `MyProfileApp`: startup, profile loading, table population, menu dispatch, comments-from-main | +| `my_profile.py` | `MyProfileApp`: startup, profile loading, table population, menu dispatch, comments-from-main | | `MainScreen.py` | The dashboard: tables, Other Functions menu, row-selection tracking | | `SplashScreen.py` | Welcome card; its Change User button opens `ChangeUserScreen` | | `ChangeUserScreen.py` | Collects a new user and password and checks Egeria accepts them | diff --git a/docs/developer_guide_pyegeria_textual.md b/docs/developer_guide_pyegeria_textual.md index 54bcf3c7..3e7cf889 100644 --- a/docs/developer_guide_pyegeria_textual.md +++ b/docs/developer_guide_pyegeria_textual.md @@ -526,8 +526,9 @@ application, so it shows how the patterns from section 6 hold up at scale. ### 7.1 Running it ```bash -cd my_egeria/my_egeria/DemoCode/My_Profile -python my_egeria.py +my_profile # installed console script +# or, with python: +python -m my_egeria.my_profile ``` When developing, run it under the Textual dev tools so you can see its log output. Start the @@ -535,7 +536,7 @@ console in one terminal and the app in another: ```bash textual console # terminal 1: shows self.log(...) output -textual run --dev my_egeria.py # terminal 2 +textual run --dev my_egeria/my_egeria/my_profile.py # terminal 2 ``` > **Pitfall:** make sure the `textual` command is the one from your project's `.venv` @@ -555,11 +556,11 @@ Then comes the main screen: ### 7.2 How the code is organised All files are in -[`my_egeria/my_egeria/DemoCode/My_Profile/`](../my_egeria/my_egeria/DemoCode/My_Profile/): +[`my_egeria/my_egeria/`](../my_egeria/my_egeria/): | File(s) | Role | |---|---| -| `my_egeria.py` | The `App` subclass, `MyProfileApp`: startup, loading the profile, filling the main tables, and shared actions such as comments. | +| `my_profile.py` | The `App` subclass, `MyProfileApp`: startup, loading the profile, filling the main tables, and shared actions such as comments. | | `MainScreen.py` | The main dashboard screen: its layout, and keeping track of which table and row are selected. | | `*Screen.py`, `*Screens.py` | One class per screen or dialog: `SplashScreen`, `ShopForDataScreen`, `MyBookMarksScreen`, `AddCommentScreen`, the `Edit*`/`Add*` screens, and so on. | | `*_handler.py` | **Mixins**, each holding one feature area's logic: `shop_for_data_handler.py`, `tech_types_handler.py`, `team_roles_handler.py`, `elements_crud_handler.py`, `feedback_handler.py`, `bookmarks_handler.py`. | @@ -567,7 +568,7 @@ All files are in | `my_profile.tcss` | All the Textual CSS for the app. | | `RETURN_CODES.md` | The catalogue of numeric codes that screens pass back through `dismiss()`. | -Two design choices keep `my_egeria.py` manageable. +Two design choices keep `my_profile.py` manageable. **Feature logic lives in mixins.** The app class is assembled from them: @@ -808,7 +809,7 @@ to and linked from the profile. - **Return codes from screens.** Screens dismiss with small integers (200 = OK, 211 = subscribe, 212 = sample data, 4xx = failure), or with a list whose first entry is the code. - The callback branches on the code. [`RETURN_CODES.md`](../my_egeria/my_egeria/DemoCode/My_Profile/RETURN_CODES.md) + The callback branches on the code. [`RETURN_CODES.md`](../my_egeria/my_egeria/RETURN_CODES.md) records them all, which matters once dozens of screens share the convention. - **Priority bindings.** Ordinary app-level bindings are ignored while a `ModalScreen` is active. Declaring `Binding("ctrl+f", "feedback", "Feedback", priority=True)` makes @@ -1051,7 +1052,7 @@ python examples/developer_guide/capture_screenshots.py | [Output Formats and Report Specs](output-formats-and-report-specs.md) | §4 | | [My Profile App User Manual](my_egeria_manual.md) | §7 | | [Egeria User Guide: My Profile Application](My-Egeria-Doc.md) | §7 | -| [My Profile return codes](../my_egeria/my_egeria/DemoCode/My_Profile/RETURN_CODES.md) | §7.6 | +| [My Profile return codes](../my_egeria/my_egeria/RETURN_CODES.md) | §7.6 | | [My Profile tests](../tests/micro-tests/my_profile/README.md) | §10 | | [Dr. Egeria user manual](dr_egeria_manual.md) and [design notes](design/README.md) | §8 | | [Command line interface docs](../commands/doc/README.md) | §9 | diff --git a/docs/my_egeria_manual.md b/docs/my_egeria_manual.md index 178370d3..0c6e356a 100644 --- a/docs/my_egeria_manual.md +++ b/docs/my_egeria_manual.md @@ -7,7 +7,7 @@ The **My Profile App** is a terminal user interface (TUI), built with [Textual]( This manual describes how to *use* the app. For how it works internally (screens, handlers, Egeria calls and flow diagrams) see the [My Profile Reference Guide](My-Egeria-Doc.md). -The app's source is in `my_egeria/my_egeria/DemoCode/My_Profile/`. +The app's source is in `my_egeria/my_egeria/`. ## Table of Contents @@ -74,11 +74,10 @@ From the app folder, inside the project's virtual environment: ```bash my_profile # installed console script, runs from any directory -# or, from the app folder: -cd my_egeria/my_egeria/DemoCode/My_Profile -python my_egeria.py +# or with python: +python -m my_egeria.my_profile # or, with the Textual developer console (needs textual-dev, a dev dependency): -textual run --dev my_egeria.py +textual run --dev my_egeria/my_egeria/my_profile.py ``` Use Python 3.13: Textual currently fails on Python 3.14 (an assertion in `textual/rlock.py` at startup). diff --git a/examples/developer_guide/capture_screenshots.py b/examples/developer_guide/capture_screenshots.py index f3cb1b46..2d4d4136 100644 --- a/examples/developer_guide/capture_screenshots.py +++ b/examples/developer_guide/capture_screenshots.py @@ -21,7 +21,7 @@ HERE = Path(__file__).resolve().parent REPO_ROOT = HERE.parents[1] IMAGES = REPO_ROOT / "docs" / "images" / "developer-guide" -MY_PROFILE_DIR = REPO_ROOT / "my_egeria" / "my_egeria" / "DemoCode" / "My_Profile" +MY_PROFILE_DIR = REPO_ROOT / "my_egeria" / "my_egeria" SIZE = (150, 42) sys.path.append(str(MY_PROFILE_DIR)) @@ -62,7 +62,7 @@ async def capture_examples() -> None: async def capture_my_profile() -> None: - from my_egeria.DemoCode.My_Profile.my_egeria import MyProfileApp + from my_egeria.my_profile import MyProfileApp app = MyProfileApp() async with app.run_test(size=SIZE) as pilot: diff --git a/my_egeria/README.md b/my_egeria/README.md index d2a1e9a4..84cec2f7 100644 --- a/my_egeria/README.md +++ b/my_egeria/README.md @@ -17,13 +17,11 @@ uv sync ## Running the apps This package contains two Textual apps: -- **My Profile** (`DemoCode/My_Profile/`) — the actively developed app, and the one - the Egeria-Workspaces portal serves: +- **My Profile** (`my_egeria/my_profile.py`) — the production user profile and catalog TUI app, and the one the Egeria-Workspaces portal serves: ```bash - uv run my_profile # or: python -m my_egeria.DemoCode.My_Profile.my_egeria + uv run my_profile # or: python -m my_egeria.my_profile ``` -- **MyEgeria** — the original glossary/collection browser (not under active - development; several of its secondary screens are incomplete): +- **MyEgeria** (`my_egeria/main.py`) — the glossary and collection browser: ```bash uv run my-egeria # or: python -m my_egeria.main ``` diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/.envrc b/my_egeria/my_egeria/.envrc similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/.envrc rename to my_egeria/my_egeria/.envrc diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/AddCommentScreen.py b/my_egeria/my_egeria/AddCommentScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/AddCommentScreen.py rename to my_egeria/my_egeria/AddCommentScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/AddToElementsScreens.py b/my_egeria/my_egeria/AddToElementsScreens.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/AddToElementsScreens.py rename to my_egeria/my_egeria/AddToElementsScreens.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/ChangeUserScreen.py b/my_egeria/my_egeria/ChangeUserScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/ChangeUserScreen.py rename to my_egeria/my_egeria/ChangeUserScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/CommunitiesScreen.py b/my_egeria/my_egeria/CommunitiesScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/CommunitiesScreen.py rename to my_egeria/my_egeria/CommunitiesScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/CommunityScreen.py b/my_egeria/my_egeria/CommunityScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/CommunityScreen.py rename to my_egeria/my_egeria/CommunityScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/ConnectionErrorScreen.py b/my_egeria/my_egeria/ConnectionErrorScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/ConnectionErrorScreen.py rename to my_egeria/my_egeria/ConnectionErrorScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/CreateProfileScreen.py b/my_egeria/my_egeria/CreateProfileScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/CreateProfileScreen.py rename to my_egeria/my_egeria/CreateProfileScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/CreateSubscriptionRequestScreen.py b/my_egeria/my_egeria/CreateSubscriptionRequestScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/CreateSubscriptionRequestScreen.py rename to my_egeria/my_egeria/CreateSubscriptionRequestScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/VIDEO_SCRIPT_DRAFT.md b/my_egeria/my_egeria/DemoCode/My_Profile/VIDEO_SCRIPT_DRAFT.md deleted file mode 100644 index 6c1e4d98..00000000 --- a/my_egeria/my_egeria/DemoCode/My_Profile/VIDEO_SCRIPT_DRAFT.md +++ /dev/null @@ -1,116 +0,0 @@ -# My Profile — Video Blog Script (DRAFT) - -**Working title:** "Meeting Egeria Through My Profile — Callie Quartile, Data Scientist at Coco Pharmaceuticals — Video Blog" -**Target length:** ~4 minutes (≈550 spoken words) -**Format:** In-character video blog set at Coco Pharmaceuticals, in the same style as the Jules Keeper series. Talking head / voice-over, cutting to screen capture of `my_egeria.py` running in a terminal. -**Presenter persona:** Callie Quartile, data scientist at Coco Pharmaceuticals (swap in another Coco persona if you prefer; see the notes at the end). - ---- - -## 0. Cold open (0:00 – 0:15) - -**[VISUAL]** Presenter to camera, or a Coco Pharmaceuticals title card: *"Better data for everyone"*. - -**CALLIE:** -> Hi, I'm Callie Quartile. I'm a data scientist at Coco Pharmaceuticals. When Jules Keeper, our Chief Data Officer, launched *"better data for everyone"*, my first question was pretty simple: where do I actually start? It turns out I start with **me**. - ---- - -## 1. The problem (0:15 – 0:40) - -**[VISUAL]** Simple slide: a person in the middle, with icons around them for teams, roles, projects, data, and to-dos. Lines connect them. - -**CALLIE:** -> Egeria already knows a lot about me: which teams I'm on, the roles I hold, my projects, the data I use. But that knowledge is spread across the metadata. I wanted one place where I could see it, keep it up to date, and act on it. That place is **My Profile**. - ---- - -## 2. Launch and splash screen (0:40 – 1:00) - -**[VISUAL]** Terminal. Type `python my_egeria.py`. The splash screen appears with *"Welcome to My_Profile for Egeria Users, callie!"* and the **Continue to App** / **Change User** buttons. - -**CALLIE:** -> My Profile is a terminal app built on pyegeria. While this welcome screen is showing, it's already loading my profile from Egeria in the background, so by the time I press Continue it's ready. -> If I'm sharing a desk, or testing as a colleague, **Change User** lets me sign in as someone else. Egeria checks the credentials before letting me through. - -**[ON-SCREEN CALLOUT]** "Profile loads in parallel with the splash screen" - -**[OPTIONAL CUTAWAY]** If a user has no profile yet, the app offers the **Create Profile** form (courtesy title, job title, and so on). - ---- - -## 3. The main dashboard (1:00 – 1:45) - -**[VISUAL]** Main screen. Slowly pan or highlight each panel as it's mentioned. The header shows "Egeria — User: calliequartile, Karma Points: …" and the clock; every screen has the same header. - -**CALLIE:** -> This is my home screen. Everything here comes live from Egeria. -> Up here are my **associations** and my **collections**. Next are the **roles** I've been appointed to and the **teams** I belong to. -> This panel is my working life: my **blog**, my **journal**, and my **to-dos**. -> Down here is my **user identity**, which is how Egeria recognises me across the tools I use. - -**[ON-SCREEN CALLOUT]** Point out the keyboard shortcuts in the footer: `Ctrl+T` Edit, `Ctrl+O` Comments, `Ctrl+B` Bookmarks. - ---- - -## 4. Keeping it current (1:45 – 2:20) - -**[VISUAL]** Select the To-Dos table, press `Ctrl+T`, and add a to-do: *"Review clinical trial data quality report"*. Back on the main screen the new row appears. Then highlight a row and press `Ctrl+O` to show and add a comment. - -**CALLIE:** -> The profile is only useful if it's accurate. I pick any table and press **Ctrl+T** to edit it: add a row, update one, or remove something that's no longer true. Here I'm adding a to-do from this morning's stand-up. -> **Ctrl+O** opens the comments on whatever row I've selected, so a conversation stays attached to the thing it's about, not lost in email. - -**[OPTIONAL]** Quick shot of **Edit Profile** from the Other Functions list, updating the job title. - ---- - -## 5. Shopping for data (2:20 – 3:05) ← *the "hero" moment* - -**[VISUAL]** Other Functions → **Catalogs / Shop for Data**. Show the Glossary, Digital Product Catalog, Data Dictionary, Business Domain, and Root Collection panels. Select a data product, press `Ctrl+L` to **sample** it, then `Ctrl+U` to **subscribe**. Fill in the subscription request and submit. Then open **Subscriptions** to show it listed. - -**CALLIE:** -> This is the part I use most. **Shop for Data** brings together our glossary, the digital product catalog, data dictionaries, and business domains in one place. -> I can find the product I need and **sample** it before I commit. When it's right, I **subscribe**. That sends a proper subscription request through Egeria, so the data owner knows who's using their data and why. -> And under **Subscriptions** I can see everything I've signed up for. - -**[ON-SCREEN CALLOUT]** "Governed access, requested in seconds" - ---- - -## 6. Bookmarks and technology types (3:05 – 3:30) - -**[VISUAL]** Press `Ctrl+B` to show the bookmarks list and add one. Then Other Functions → **Technology Types**. Pick a technology type and show its templates and processes. - -**CALLIE:** -> **Ctrl+B** keeps my bookmarks, the elements I come back to again and again. -> And for the more technical among us, **Technology Types** shows what Egeria knows about each technology, including the templates and processes it can run for you. - ---- - -## 7. Close and call to action (3:30 – 4:00) - -**[VISUAL]** Back to presenter, or the main dashboard. End card with links. - -**CALLIE:** -> So that's My Profile: one place to see how I fit into Coco Pharmaceuticals, keep it accurate, and get the data I need, with governance built in rather than bolted on. -> Better data for everyone really does start with everyone. Next time, I'll show how my team uses this to share projects and to-dos. -> The app is open source, part of the Egeria Python project. Links are below. Give it a try against the Coco Pharmaceuticals demo environment. - -**[END CARD]** -- Egeria project: https://egeria-project.org -- egeria-python on GitHub (link to `my_egeria/DemoCode/My_Profile`) -- "Previous in series: Jules Keeper video blogs" (link to the playlist) - ---- - -## Production notes - -- **Presenter persona:** Callie Quartile was chosen because Shop for Data and Subscribe fit a data scientist's day. Other Coco personas that would work: Peter Profile (information specialist, and a natural fit for "My Profile"), Tessa Tube (lead researcher), or Jules Keeper as a cameo in the opening. Check the names and roles against the current Coco Pharmaceuticals docs. -- **Tone:** first person, warm, practical, a little wry. It's one colleague showing another, not a feature tour. Each feature should be tied to a job Callie actually needs to get done. -- **Screen capture:** use a large terminal font (≥18pt) and a dark theme matching `my_profile.tcss`. Record at 1920×1080 and zoom in on the panel being discussed. Pause about half a second before each keypress so viewers can follow. -- **Demo data:** record against the Coco Pharmaceuticals demo data, so the teams, roles, and data products shown match the rest of the series. Pre-create a few to-dos, blog and journal entries, and one subscribable data product. -- **Captions:** burn in the keyboard shortcuts (`Ctrl+T`, `Ctrl+O`, `Ctrl+B`, `Ctrl+L`, `Ctrl+U`) as they're used. -- **Before recording:** check every step against the current build, especially Change User, Create Profile, and Subscribe, since they've changed recently. -- **LinkedIn post (draft):** - > Meet My Profile 👋 A terminal app for Egeria users that shows your teams, roles, projects, and to-dos in one place, and lets you shop for governed data and subscribe to it in a few keystrokes. Watch Callie Quartile from Coco Pharmaceuticals take it for a spin: [YouTube link] #Egeria #OpenMetadata #DataGovernance #LFAIData diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/__init__.py b/my_egeria/my_egeria/DemoCode/My_Profile/__init__.py deleted file mode 100644 index 5b0687bd..00000000 --- a/my_egeria/my_egeria/DemoCode/My_Profile/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" - PDX-License-Identifier: Apache-2.0 - Copyright Contributors to the ODPi Egeria project. - - This file provides a set of report specification related functions for my_egeria. - -""" diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/EditElementsScreens.py b/my_egeria/my_egeria/EditElementsScreens.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/EditElementsScreens.py rename to my_egeria/my_egeria/EditElementsScreens.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/FeedbackScreens.py b/my_egeria/my_egeria/FeedbackScreens.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/FeedbackScreens.py rename to my_egeria/my_egeria/FeedbackScreens.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/GenericDataViewScreen.py b/my_egeria/my_egeria/GenericDataViewScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/GenericDataViewScreen.py rename to my_egeria/my_egeria/GenericDataViewScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/MainScreen.py b/my_egeria/my_egeria/MainScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/MainScreen.py rename to my_egeria/my_egeria/MainScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/MyBookMarksScreen.py b/my_egeria/my_egeria/MyBookMarksScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/MyBookMarksScreen.py rename to my_egeria/my_egeria/MyBookMarksScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/MyNetworkScreen.py b/my_egeria/my_egeria/MyNetworkScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/MyNetworkScreen.py rename to my_egeria/my_egeria/MyNetworkScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/MyTeamScreen.py b/my_egeria/my_egeria/MyTeamScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/MyTeamScreen.py rename to my_egeria/my_egeria/MyTeamScreen.py diff --git a/my_egeria/my_egeria/README.md b/my_egeria/my_egeria/README.md index 1288dffa..5502cffb 100644 --- a/my_egeria/my_egeria/README.md +++ b/my_egeria/my_egeria/README.md @@ -8,18 +8,22 @@ The `my-egeria` Textual TUI application's package root — see the parent | Folder/file | Role | |---|---| -| `main.py` | Entry point (`uv run my-egeria` / `python -m my_egeria.main`). | -| `my_egeria_app.py` | The main Textual `App` class. | -| `screens/` | Textual screens, one per feature area (`GovernanceOfficer`, `ProductManager`, `ProjectManager`, `collections`, `glossary`, `platform`). | +| `my_profile.py` | Production My Profile & Catalog TUI Application (`MyProfileApp` / `MyEgeriaApp`, entry point `uv run my_profile` / `python -m my_egeria.my_profile`). | +| `main.py` | Entry point for MyEgeria app (`uv run my-egeria` / `python -m my_egeria.main`). | +| `my_egeria_app.py` | The MyEgeria browser/navigation Textual `App` class. | +| `*Screen.py` / `*Screens.py` | Production Textual screens (Main, Splash, Profile Creation/Edit, Data Shopping, Bookmarks, Network, Teams, Communities, Feedback, Tech Types, Subscriptions). | +| `*_handler.py` | Domain mixins for bookmarks, communities, CRUD operations, feedback, networks, shopping, team roles, and tech types. | +| `profile_utils.py` | Profile formatting, Mermaid graph sanitization, data structures, and connection utilities. | +| `screens/` | Feature screens (`GovernanceOfficer`, `ProductManager`, `ProjectManager`, `collections`, `glossary`, `platform`). | | `widgets/` | Reusable Textual widgets shared across screens. | -| `services/`, `con_services/` | Backend service layer wrapping pyegeria SDK calls for the screens/widgets to use. | -| `utils/` | Shared helpers. | -| `styles/` | Textual CSS. | -| `tests/` | Tests for this app. | +| `services/`, `con_services/` | Backend service layer wrapping pyegeria SDK calls for screens/widgets. | +| `utils/` | Shared helpers and configuration. | +| `styles/` | Textual CSS styles. | +| `tests/` | Tests for the app components. | | `error_popup_app.py`, `startup_check.py` | Startup/error-handling helpers. | -| `serve.py` | Browser-mode serving via the `textual-serve` library — see the `serve_my_egeria`/`serve_my_profile` entry points in the root `pyproject.toml`. | -| `DemoCode/` | Standalone demo scripts and experimental/deprecated code, not part of the main app (own subfolders per demo topic — Data Products, Journals, My Profile, Report Specs, Technology Type, plus `Deprecated/` and `Experimental Code/`). | +| `serve.py` | Browser-mode serving via `textual-serve` — provides `serve_my_profile` and `serve_my_egeria`. | +| `RETURN_CODES.md` | Screen callback return code contract reference. | +| `catalog_api_calls.md` | API mapping reference for Egeria catalog calls. | +| `DemoCode/` | Standalone demo scripts and experimental/deprecated code (`Data_Products_Demo`, `Deprecated/`, `Experimental Code/`). | -`DemoCode/` is a scratch/demo area, not maintained to the same standard as -the rest of the app — treat anything there as illustrative, not -production code. +`DemoCode/` is a scratch/demo area for experimental prototypes — production code lives in `my_egeria/my_egeria/`. diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/RETURN_CODES.md b/my_egeria/my_egeria/RETURN_CODES.md similarity index 90% rename from my_egeria/my_egeria/DemoCode/My_Profile/RETURN_CODES.md rename to my_egeria/my_egeria/RETURN_CODES.md index 6f77a06c..0373756e 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/RETURN_CODES.md +++ b/my_egeria/my_egeria/RETURN_CODES.md @@ -1,6 +1,6 @@ # My Profile Application Return Codes Reference -This document provides a comprehensive catalog of all return codes and screen dismiss codes used across the `my_egeria.py` application and its supporting handlers and screens in `my_egeria/my_egeria/DemoCode/My_Profile/`. +This document provides a comprehensive catalog of all return codes and screen dismiss codes used across the `my_profile.py` application and its supporting handlers and screens in `my_egeria/my_egeria/`. In accordance with application conventions: - **200 Series**: Successful operations, normal navigation, user selections, and action triggers. @@ -12,7 +12,7 @@ In accordance with application conventions: | Return Code | Name / Type | Description | Source Components | |---|---|---|---| -| **`200`** | `SUCCESS_OK` / `DEFAULT_EXIT` | Standard success code. Used for successful operations, standard modal dismissal, backing out of dialogs, cancelling inputs without error, or quitting cleanly. | `my_egeria.py`, `MainScreen.py`, `StatusScreen.py`, `CreateProfileScreen.py`, `EditElementsScreens.py`, `AddToElementsScreens.py`, `TechnologyTypeScreens.py`, `tech_types_handler.py`, `shop_for_data_handler.py`, `team_roles_handler.py`, `SelectionOverviewScreen.py`, `GenericDataViewScreen.py`, `MyBookMarksScreen.py`, `MyTeamScreen.py`, `SearchForTermScreen.py`, `ShowCommentScreen.py`, `MyNetworkScreen.py`, `CommunitiesScreen.py`, `CommunityScreen.py` | +| **`200`** | `SUCCESS_OK` / `DEFAULT_EXIT` | Standard success code. Used for successful operations, standard modal dismissal, backing out of dialogs, cancelling inputs without error, or quitting cleanly. | `my_profile.py`, `MainScreen.py`, `StatusScreen.py`, `CreateProfileScreen.py`, `EditElementsScreens.py`, `AddToElementsScreens.py`, `TechnologyTypeScreens.py`, `tech_types_handler.py`, `shop_for_data_handler.py`, `team_roles_handler.py`, `SelectionOverviewScreen.py`, `GenericDataViewScreen.py`, `MyBookMarksScreen.py`, `MyTeamScreen.py`, `SearchForTermScreen.py`, `ShowCommentScreen.py`, `MyNetworkScreen.py`, `CommunitiesScreen.py`, `CommunityScreen.py` | | **`201`** | `ALT_NAVIGATION` / `NO_MATCH` | Alternative navigation or fallback action code. In search/team screens, indicates no matching terms/roles found and triggers transition to data shopping or alternate view. In tech type selection, represents secondary navigation action. | `SearchForTermScreen.py`, `team_roles_handler.py`, `TechnologyTypeScreens.py`, `MyTeamScreen.py`, `ShopForDataScreen.py` | | **`210`** | `QUIT_TO_MAIN` | Exit/Quit action code from data shopping / data viewing screens, and from a single community's screen, to dismiss the view and return directly to the main menu screen. | `ShopForDataScreen.py`, `GenericDataViewScreen.py`, `SelectionOverviewScreen.py`, `shop_for_data_handler.py`, `CommunityScreen.py`, `CommunitiesScreen.py` | | **`211`** | `SUBSCRIBE_ACTION` | Action code indicating the user has requested to create a digital subscription for the selected data source, catalog product, or data element. | `ShopForDataScreen.py`, `GenericDataViewScreen.py`, `SelectionOverviewScreen.py`, `shop_for_data_handler.py` | @@ -26,7 +26,7 @@ In accordance with application conventions: |---|---|---|---| | **`400`** | `GENERIC_ERROR` / `BAD_RESULT` | General error code or user cancellation with bad result. Used in StatusScreen when copying GUID fails or user indicates bad status, and in edit elements when invalid operations occur. | `StatusScreen.py`, `EditElementsScreens.py`, `ShowCommentsScreen.py` | | **`401`** | `PROFILE_ACTION_FAILED` | Profile creation or profile element editing cancelled, rejected, or failed. | `CreateProfileScreen.py`, `EditElementsScreens.py` | -| **`402`** | `EGERIA_UNAVAILABLE_QUIT` | The profile could not be loaded (Egeria unreachable, or the credentials rejected) and the user chose Quit on the connection error screen. That screen dismisses with 200 once Egeria accepts the current credentials (the app then reloads the profile), or 201 for Change User. | `my_egeria.py`, `ConnectionErrorScreen.py` | +| **`402`** | `EGERIA_UNAVAILABLE_QUIT` | The profile could not be loaded (Egeria unreachable, or the credentials rejected) and the user chose Quit on the connection error screen. That screen dismisses with 200 once Egeria accepts the current credentials (the app then reloads the profile), or 201 for Change User. | `my_profile.py`, `ConnectionErrorScreen.py` | | **`404`** | `TECH_TYPE_NO_PROCESS_FALLBACK_FAIL` | Failed to mount empty processes option list when fallback handler encountered an unexpected error. | `TechnologyTypeScreens.py` | | **`405`** | `TECH_TYPE_NO_PROCESS_CREATE_FAIL` | Failed to create empty processes option list during initial widget mount. | `TechnologyTypeScreens.py` | | **`406`** | `TECH_TYPE_PROCESS_CREATE_FAIL` | Error creating technology type governance action processes option list widget. | `TechnologyTypeScreens.py` | @@ -44,11 +44,11 @@ In accordance with application conventions: | **`418`** | `TECH_TYPE_TEMPLATE_CALLBACK_INVALID` / `SHOP_DATA_PAYLOAD_INVALID` | Invalid payload or missing required arguments received in technology type templates/processes callback; or invalid data payload returned from Shop for Data screen. | `tech_types_handler.py`, `shop_for_data_handler.py` | | **`419`** | `TECH_TYPE_PLACEHOLDER_NOT_DICT` | Technology type placeholder input data is not a dictionary structure as expected. | `tech_types_handler.py` | | **`420`** | `TECH_TYPE_CREATE_ELEMENT_FAIL` / `SHOP_DATA_RETRIEVAL_ERROR` | Exception raised during creation of metadata element from template via Automated Curation; or error retrieving details for glossary, catalog, or dictionary data elements. | `tech_types_handler.py`, `shop_for_data_handler.py` | -| **`421`** | `APP_INITIALIZATION_FAIL` / `DOMAIN_DATA_RETRIEVAL_ERROR` | Failure to initialize main profile app / retrieve current user profile details; or error retrieving business domain details in Shop for Data. | `my_egeria.py`, `shop_for_data_handler.py` | +| **`421`** | `APP_INITIALIZATION_FAIL` / `DOMAIN_DATA_RETRIEVAL_ERROR` | Failure to initialize main profile app / retrieve current user profile details; or error retrieving business domain details in Shop for Data. | `my_profile.py`, `shop_for_data_handler.py` | | **`422`** | `DATA_SPECIFICATION_RETRIEVAL_ERROR` | Error retrieving data specification details from Egeria in Shop for Data handler. | `shop_for_data_handler.py` | | **`423`** | `BUSINESS_DOMAIN_SPEC_ERROR` | Error executing BusinessCapabilities report specification in Shop for Data handler. | `shop_for_data_handler.py` | | **`429`** | `SAMPLE_DATA_RETRIEVAL_ERROR` | Failed to retrieve or parse sample data from Egeria Asset Catalog / Data Engine in Shop for Data handler. | `shop_for_data_handler.py` | -| **`430`** | `INCOMPATIBLE_ENVIRONMENT` | App started under a Python whose pydantic is older than pyegeria requires, so request bodies would reach Egeria with their parameters silently missing. The app exits at startup with a message naming the interpreter and how to run from the project venv instead. | `my_egeria.py`, `profile_utils.py` | +| **`430`** | `INCOMPATIBLE_ENVIRONMENT` | App started under a Python whose pydantic is older than pyegeria requires, so request bodies would reach Egeria with their parameters silently missing. The app exits at startup with a message naming the interpreter and how to run from the project venv instead. | `my_profile.py`, `profile_utils.py` | | **`440`** | `TEAM_ROLES_OR_GLOSSARY_ERROR` | Error communicating with Egeria or retrieving glossary term details. (A failed team members lookup is now shown as an error notification and does not exit the app.) | `team_roles_handler.py` | --- diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/SearchForTermScreen.py b/my_egeria/my_egeria/SearchForTermScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/SearchForTermScreen.py rename to my_egeria/my_egeria/SearchForTermScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/SelectionOverviewScreen.py b/my_egeria/my_egeria/SelectionOverviewScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/SelectionOverviewScreen.py rename to my_egeria/my_egeria/SelectionOverviewScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/ShopForDataScreen.py b/my_egeria/my_egeria/ShopForDataScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/ShopForDataScreen.py rename to my_egeria/my_egeria/ShopForDataScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/ShowCommentsScreen.py b/my_egeria/my_egeria/ShowCommentsScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/ShowCommentsScreen.py rename to my_egeria/my_egeria/ShowCommentsScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/SplashScreen.py b/my_egeria/my_egeria/SplashScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/SplashScreen.py rename to my_egeria/my_egeria/SplashScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/StatusScreen.py b/my_egeria/my_egeria/StatusScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/StatusScreen.py rename to my_egeria/my_egeria/StatusScreen.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/TechnologyTypeScreens.py b/my_egeria/my_egeria/TechnologyTypeScreens.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/TechnologyTypeScreens.py rename to my_egeria/my_egeria/TechnologyTypeScreens.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/UserIdentitiesScreen.py b/my_egeria/my_egeria/UserIdentitiesScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/UserIdentitiesScreen.py rename to my_egeria/my_egeria/UserIdentitiesScreen.py diff --git a/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md b/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md new file mode 100644 index 00000000..a660c678 --- /dev/null +++ b/my_egeria/my_egeria/VIDEO_SCRIPT_DRAFT.md @@ -0,0 +1,164 @@ +# My Profile — Video Blog Script (DRAFT) + +**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). + +--- + +## 0. Cold open (0:00 – 0:20) + +**[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"*. + +**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? +> It turns out, I start with **me**. + +**[LOWER THIRD]** Callie Quartile — Data Scientist, Coco Pharmaceuticals +**[TITLE CARD]** Meeting Egeria Through My Profile + +--- + +## 1. The Context: One Persona, One Workspace (0:20 – 0:50) + +**[VISUAL]** Slide animation / graphic: Callie in the center connected to teams, clinical trial projects, data products, glossaries, governance roles, and daily 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. +> That workspace is **My Profile**. + +--- + +## 2. Launch & Parallel Startup (0:50 – 1:20) + +**[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**. + +**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. + +**[ON-SCREEN CALLOUT]** "Async background loading • Live credential validation • Instant startup" + +--- + +## 3. The Main Dashboard Tour (1:20 – 2:05) + +**[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). + +**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. + +**[ON-SCREEN CALLOUT]** "Live metadata synchronization • Role & Team drill-down • Karma point tracking" + +--- + +## 4. Real-Time Curation: To-Dos, Comments & Bookmarks (2:05 – 2:50) + +**[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. + +**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. + +**[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) + +**[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. + +**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**. + +**[ON-SCREEN CALLOUT]** "Unified Catalog Search • Instant Data Sampling (`Ctrl+L`) • Governed Subscriptions (`Ctrl+U`)" + +--- + +## 6. Collaboration, Networks & Technology Types (3:50 – 4:30) + +**[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. + +**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. + +--- + +## 7. Wrap-up & Call to Action (4:30 – 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"* + +--- + +## 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. + > + > 📺 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 + > #Egeria #DataGovernance #OpenMetadata #Python #Textual #DataMesh #CocoPharmaceuticals diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/ViewSubscriptionsScreen.py b/my_egeria/my_egeria/ViewSubscriptionsScreen.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/ViewSubscriptionsScreen.py rename to my_egeria/my_egeria/ViewSubscriptionsScreen.py diff --git a/my_egeria/my_egeria/__init__.py b/my_egeria/my_egeria/__init__.py index 419eb61f..b242efcb 100644 --- a/my_egeria/my_egeria/__init__.py +++ b/my_egeria/my_egeria/__init__.py @@ -1,9 +1,11 @@ -"""my_egeria package""" - """ - - PDX-License-Identifier: Apache-2.0 + SPDX-License-Identifier: Apache-2.0 Copyright Contributors to the ODPi Egeria project. + The my_egeria TUI application package. """ +from my_egeria.my_profile import MyProfileApp, MyEgeriaApp +from my_egeria.my_egeria_app import MyEgeria + +__all__ = ["MyProfileApp", "MyEgeriaApp", "MyEgeria"] diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/bookmarks_handler.py b/my_egeria/my_egeria/bookmarks_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/bookmarks_handler.py rename to my_egeria/my_egeria/bookmarks_handler.py index 7da6aee4..e22594fa 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/bookmarks_handler.py +++ b/my_egeria/my_egeria/bookmarks_handler.py @@ -16,7 +16,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/catalog_api_calls.md b/my_egeria/my_egeria/catalog_api_calls.md similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/catalog_api_calls.md rename to my_egeria/my_egeria/catalog_api_calls.md index f1d31461..e81e5753 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/catalog_api_calls.md +++ b/my_egeria/my_egeria/catalog_api_calls.md @@ -1,6 +1,6 @@ # Catalog (Shop for Data) — pyegeria API Call Reference -This document maps each UI function in the **Catalogs / Shop for Data** flow of `my_egeria.py` +This document maps each UI function in the **Catalogs / Shop for Data** flow of `my_profile.py` to the underlying pyegeria API calls it makes. --- diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/community_handler.py b/my_egeria/my_egeria/community_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/community_handler.py rename to my_egeria/my_egeria/community_handler.py index d276a5bf..7368af37 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/community_handler.py +++ b/my_egeria/my_egeria/community_handler.py @@ -28,7 +28,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/elements_crud_handler.py b/my_egeria/my_egeria/elements_crud_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/elements_crud_handler.py rename to my_egeria/my_egeria/elements_crud_handler.py index 5c2031e9..3fd963c3 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/elements_crud_handler.py +++ b/my_egeria/my_egeria/elements_crud_handler.py @@ -10,7 +10,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/feedback_handler.py b/my_egeria/my_egeria/feedback_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/feedback_handler.py rename to my_egeria/my_egeria/feedback_handler.py index 1ec41a1e..de8da89e 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/feedback_handler.py +++ b/my_egeria/my_egeria/feedback_handler.py @@ -19,7 +19,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/main.py b/my_egeria/my_egeria/main.py index a54d6319..79b266d5 100644 --- a/my_egeria/my_egeria/main.py +++ b/my_egeria/my_egeria/main.py @@ -1,8 +1,8 @@ """ - - PDX-License-Identifier: Apache-2.0 + SPDX-License-Identifier: Apache-2.0 Copyright Contributors to the ODPi Egeria project. + Main entry point for the my_egeria application. """ from my_egeria.startup_check import check_connection @@ -10,7 +10,7 @@ from my_egeria.my_egeria_app import MyEgeria -def on_mount(self): +def run_app(): ok, msg = check_connection() if not ok: # Show popup with OK -> exit @@ -21,8 +21,10 @@ def on_mount(self): MyEgeria().run() return 0 + def main(): - return on_mount(self=None)\ + return run_app() + if __name__ == "__main__": - raise SystemExit(on_mount(self=None)) + raise SystemExit(main()) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/my_egeria.py b/my_egeria/my_egeria/my_profile.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/my_egeria.py rename to my_egeria/my_egeria/my_profile.py index 9c9558fa..247fbf68 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/my_egeria.py +++ b/my_egeria/my_egeria/my_profile.py @@ -12,7 +12,7 @@ import asyncio # Add the project root to sys.path to allow running this script from any directory -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) @@ -100,7 +100,7 @@ class MyProfileApp(App, TechTypesMixin, ShopForDataMixin, TeamRolesMixin, ElementsCrudMixin, FeedbackMixin, BookmarksMixin, NetworkMixin, CommunitiesMixin): - """My Profile App. + """My Profile / My Egeria App. Retrieves a user's profile from Egeria and displays current work items. If no profile is found, offers a UI to create one. @@ -963,8 +963,12 @@ async def get_guid_for_qualified_name(self, qname: str) -> str: eclient.close_session() return guid +# Aliases for backward and forward compatibility +MyEgeriaApp = MyProfileApp + + def main() -> None: - """Entry point for the my_profile console script.""" + """Entry point for the my_egeria / my_profile console script.""" MyProfileApp().run() diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/my_profile.tcss b/my_egeria/my_egeria/my_profile.tcss similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/my_profile.tcss rename to my_egeria/my_egeria/my_profile.tcss diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/network_handler.py b/my_egeria/my_egeria/network_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/network_handler.py rename to my_egeria/my_egeria/network_handler.py index e851d589..b7d4ad15 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/network_handler.py +++ b/my_egeria/my_egeria/network_handler.py @@ -14,7 +14,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/profile_utils.py b/my_egeria/my_egeria/profile_utils.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/profile_utils.py rename to my_egeria/my_egeria/profile_utils.py diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/sample-data b/my_egeria/my_egeria/sample-data similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/sample-data rename to my_egeria/my_egeria/sample-data diff --git a/my_egeria/my_egeria/serve.py b/my_egeria/my_egeria/serve.py index c3d3ba59..b586f1d3 100644 --- a/my_egeria/my_egeria/serve.py +++ b/my_egeria/my_egeria/serve.py @@ -32,7 +32,7 @@ APPS = { # name: (module run with `python -m`, port env var, default port, public URL env var) "My Egeria": ("my_egeria.main", "MY_EGERIA_PORT", "8021", "MY_EGERIA_PUBLIC_URL"), - "My Profile": ("my_egeria.DemoCode.My_Profile.my_egeria", "MY_PROFILE_PORT", "8020", "MY_PROFILE_PUBLIC_URL"), + "My Profile": ("my_egeria.my_profile", "MY_PROFILE_PORT", "8020", "MY_PROFILE_PUBLIC_URL"), } diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/shop_for_data_handler.py b/my_egeria/my_egeria/shop_for_data_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/shop_for_data_handler.py rename to my_egeria/my_egeria/shop_for_data_handler.py index e86d9048..2583b926 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/shop_for_data_handler.py +++ b/my_egeria/my_egeria/shop_for_data_handler.py @@ -17,7 +17,7 @@ from textual.worker import Worker, WorkerState # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/team_roles_handler.py b/my_egeria/my_egeria/team_roles_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/team_roles_handler.py rename to my_egeria/my_egeria/team_roles_handler.py index 048af837..6cbeab23 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/team_roles_handler.py +++ b/my_egeria/my_egeria/team_roles_handler.py @@ -10,7 +10,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/tech_types_handler.py b/my_egeria/my_egeria/tech_types_handler.py similarity index 99% rename from my_egeria/my_egeria/DemoCode/My_Profile/tech_types_handler.py rename to my_egeria/my_egeria/tech_types_handler.py index 004ba1b9..c02ac342 100644 --- a/my_egeria/my_egeria/DemoCode/My_Profile/tech_types_handler.py +++ b/my_egeria/my_egeria/tech_types_handler.py @@ -12,7 +12,7 @@ from typing import Any # Ensure project root is on sys.path -root_path = Path(__file__).resolve().parents[4] +root_path = Path(__file__).resolve().parents[2] if str(root_path) not in sys.path: sys.path.append(str(root_path)) diff --git a/my_egeria/my_egeria/DemoCode/My_Profile/test1.py b/my_egeria/my_egeria/test1.py similarity index 100% rename from my_egeria/my_egeria/DemoCode/My_Profile/test1.py rename to my_egeria/my_egeria/test1.py diff --git a/my_egeria/pyproject.toml b/my_egeria/pyproject.toml index 8fced501..d3a871f5 100644 --- a/my_egeria/pyproject.toml +++ b/my_egeria/pyproject.toml @@ -34,6 +34,7 @@ include = ["my_egeria", "my_egeria.*"] [project.scripts] # Terminal mode my-egeria = "my_egeria.main:main" +my-profile = "my_egeria.my_profile:main" # Local browser mode (textual-serve); env: MY_EGERIA_HOST, MY_EGERIA_PORT, MY_PROFILE_PORT serve-my-egeria = "my_egeria.serve:serve_my_egeria" serve-my-profile = "my_egeria.serve:serve_my_profile" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e5d0c64d..5aa78e31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,7 +139,7 @@ dependencies = [ # my_egeria TUI apps — terminal mode my_egeria = "my_egeria.main:main" - my_profile = "my_egeria.DemoCode.My_Profile.my_egeria:main" + my_profile = "my_egeria.my_profile:main" # my_egeria TUI apps — local browser mode (textual-serve); env: MY_EGERIA_HOST, MY_EGERIA_PORT, MY_PROFILE_PORT serve_my_egeria = "my_egeria.serve:serve_my_egeria" serve_my_profile = "my_egeria.serve:serve_my_profile" diff --git a/tests/micro-tests/my_profile/README.md b/tests/micro-tests/my_profile/README.md index 0d83d505..41781c10 100644 --- a/tests/micro-tests/my_profile/README.md +++ b/tests/micro-tests/my_profile/README.md @@ -4,7 +4,7 @@ # tests/micro-tests/my_profile Tests for the `MyProfileApp` Textual TUI in -`my_egeria/my_egeria/DemoCode/My_Profile/` — not the `pyegeria.omvs.my_profile` +`my_egeria/my_egeria/` — not the `pyegeria.omvs.my_profile` OMVS client, which is covered in `tests/functional-tests/`. The suite runs two ways from the same test code. diff --git a/tests/micro-tests/my_profile/conftest.py b/tests/micro-tests/my_profile/conftest.py index 154c8649..4bd4f7e3 100644 --- a/tests/micro-tests/my_profile/conftest.py +++ b/tests/micro-tests/my_profile/conftest.py @@ -30,7 +30,7 @@ # finds it ahead of the (editable-installed) package the tests import the app through. import my_egeria # noqa: E402,F401 -profile_path = root_path / "my_egeria" / "my_egeria" / "DemoCode" / "My_Profile" +profile_path = root_path / "my_egeria" / "my_egeria" if str(profile_path) not in sys.path: sys.path.insert(0, str(profile_path)) diff --git a/tests/micro-tests/my_profile/test_connection_and_change_user.py b/tests/micro-tests/my_profile/test_connection_and_change_user.py index 4e534515..ed56e6db 100644 --- a/tests/micro-tests/my_profile/test_connection_and_change_user.py +++ b/tests/micro-tests/my_profile/test_connection_and_change_user.py @@ -10,7 +10,7 @@ from textual.app import App from textual.widgets import Button, Input, Static -from my_egeria.DemoCode.My_Profile.my_egeria import MyProfileApp +from my_egeria.my_profile import MyProfileApp from ChangeUserScreen import ChangeUserScreen from ConnectionErrorScreen import ConnectionErrorScreen, RETRY_INTERVAL from SplashScreen import SplashScreen @@ -199,7 +199,7 @@ class TestAppConnectionAndUserChange: @pytest.mark.asyncio async def test_connection_failure_message_names_platform(self): app = MyProfileApp() - with patch("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile", + with patch("my_egeria.my_profile.MyProfile", side_effect=PyegeriaConnectionException(None, None, ConnectionError("refused"))): assert await app._load_profile_and_populate() is False assert app.load_error == f"Unable to connect to the Egeria platform at {app.platform_url}." diff --git a/tests/micro-tests/my_profile/test_key_bindings.py b/tests/micro-tests/my_profile/test_key_bindings.py index 0c0b923d..2571a6ce 100644 --- a/tests/micro-tests/my_profile/test_key_bindings.py +++ b/tests/micro-tests/my_profile/test_key_bindings.py @@ -39,7 +39,7 @@ import TechnologyTypeScreens import UserIdentitiesScreen import ViewSubscriptionsScreen -from my_egeria.DemoCode.My_Profile.my_egeria import MyProfileApp +from my_egeria.my_profile import MyProfileApp MODULES = [ AddCommentScreen, AddToElementsScreens, CommunitiesScreen, CommunityScreen, CreateProfileScreen, CreateSubscriptionRequestScreen, diff --git a/tests/micro-tests/my_profile/test_my_egeria.py b/tests/micro-tests/my_profile/test_my_egeria.py index c277167c..ce63f3d2 100644 --- a/tests/micro-tests/my_profile/test_my_egeria.py +++ b/tests/micro-tests/my_profile/test_my_egeria.py @@ -14,7 +14,7 @@ from textual.widgets import Button, OptionList, DataTable from textual.widgets._option_list import Option -from my_egeria.DemoCode.My_Profile.my_egeria import MyProfileApp +from my_egeria.my_profile import MyProfileApp from MainScreen import MainScreen from CreateProfileScreen import CreateProfileScreen from SplashScreen import SplashScreen @@ -34,7 +34,7 @@ def stub_profile_client(backend, profile_data, identities, todos): under test is mocked. Live mode leaves the real client in place. """ if backend.live: - return backend.patch("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile") + return backend.patch("my_egeria.my_profile.MyProfile") mock_mp = MagicMock() mock_mp.create_egeria_bearer_token.return_value = "token" @@ -47,8 +47,8 @@ def stub_profile_client(backend, profile_data, identities, todos): # The My Collections lookup goes through the Egeria facade, not MyProfile mock_egeria = MagicMock() mock_egeria.find_collections.return_value = SAMPLE_COLLECTIONS - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.Egeria", returns=mock_egeria) - return backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile", returns=mock_mp) + backend.always_fake("my_egeria.my_profile.Egeria", returns=mock_egeria) + return backend.always_fake("my_egeria.my_profile.MyProfile", returns=mock_mp) def _collection(guid, name, created_by, qualified_name=None): @@ -132,7 +132,7 @@ async def test_app_on_mount_prompt_create_profile(self, backend): mock_mp = MagicMock() mock_mp.create_egeria_bearer_token.return_value = "token" mock_mp._async_get_my_profile = AsyncMock(return_value=[]) - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile", returns=mock_mp) + backend.always_fake("my_egeria.my_profile.MyProfile", returns=mock_mp) app = MyProfileApp() async with app.run_test() as pilot: @@ -164,7 +164,7 @@ async def test_splash_escape_still_prompts_create_profile(self, backend): mock_mp = MagicMock() mock_mp.create_egeria_bearer_token.return_value = "token" mock_mp._async_get_my_profile = AsyncMock(return_value=[]) - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile", returns=mock_mp) + backend.always_fake("my_egeria.my_profile.MyProfile", returns=mock_mp) app = MyProfileApp() async with app.run_test() as pilot: @@ -186,8 +186,8 @@ async def test_app_load_profile_exception_shows_connection_error(self, backend): mock_mp = MagicMock() mock_mp.create_egeria_bearer_token.return_value = "token" mock_mp._async_get_my_profile = AsyncMock(side_effect=PyegeriaException("Server error")) - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.MyProfile", returns=mock_mp) - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.check_egeria_access", returns="Bad credentials") + backend.always_fake("my_egeria.my_profile.MyProfile", returns=mock_mp) + backend.always_fake("my_egeria.my_profile.check_egeria_access", returns="Bad credentials") app = MyProfileApp() app.exit = MagicMock() @@ -359,14 +359,14 @@ def test_roles_row_selected_delegates_to_mixin(self): def test_add_comment_callback_ignores_cancel(self, returned): """Cancel/quit/no-selection returns are not errors and make no Egeria call.""" app = MyProfileApp() - with patch("my_egeria.DemoCode.My_Profile.my_egeria.Egeria") as mock_egeria: + with patch("my_egeria.my_profile.Egeria") as mock_egeria: assert app.add_comment_callback(returned) is None mock_egeria.assert_not_called() def test_add_comment_callback_success(self): app = MyProfileApp() app.notify = MagicMock() - with patch("my_egeria.DemoCode.My_Profile.my_egeria.Egeria") as mock_egeria: + with patch("my_egeria.my_profile.Egeria") as mock_egeria: client = mock_egeria.return_value client.add_comment_to_element.return_value = "comment-guid-1" assert app.add_comment_callback(["Nice", "question", "elem-guid-1"]) == 200 @@ -459,7 +459,7 @@ async def test_get_data_product_catalog_table_success( backend, sample_profile_data, sample_user_identities, sample_todos_data ) mock_exec = backend.patch( - "my_egeria.DemoCode.My_Profile.my_egeria.exec_report_spec", + "my_egeria.my_profile.exec_report_spec", returns={ "kind": "data", "data": [ @@ -493,7 +493,7 @@ async def test_get_data_product_catalog_table_empty( stub_profile_client( backend, sample_profile_data, sample_user_identities, sample_todos_data ) - backend.always_fake("my_egeria.DemoCode.My_Profile.my_egeria.exec_report_spec", returns={"kind": "empty", "data": []}) + backend.always_fake("my_egeria.my_profile.exec_report_spec", returns={"kind": "empty", "data": []}) app = MyProfileApp() async with app.run_test(): rc = app.get_data_product_catalog_table()