pybcm


Namepybcm JSON
Version 0.1.12 PyPI version JSON
download
home_pageNone
SummaryA Business Capability Modeler built with Python and ttkbootstrap
upload_time2025-01-23 05:18:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 PyBCM Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bcm business capability enterprise-architecture modeling
VCS
bugtrack_url
requirements aiosqlite annotated-types anthropic anyio cachetools certifi charset-normalizer click colorama deprecated distro et-xmlfile eval-type-backport executing fastapi google-auth googleapis-common-protos greenlet griffe groq h11 httpcore httptools httpx idna importlib-metadata jinja2 jiter jsonpath-python logfire logfire-api lxml markdown markdown-it-py markupsafe mdurl mistralai mypy-extensions numpy openai openpyxl opentelemetry-api opentelemetry-exporter-otlp-proto-common opentelemetry-exporter-otlp-proto-http opentelemetry-instrumentation opentelemetry-instrumentation-dbapi opentelemetry-instrumentation-sqlite3 opentelemetry-proto opentelemetry-sdk opentelemetry-semantic-conventions packaging pandas pillow protobuf pyasn1 pyasn1-modules pydantic pydantic-ai pydantic-ai-slim pydantic-core pygments pyperclip python-dateutil python-dotenv python-pptx pytz pyyaml requests rich rsa setuptools six sniffio sqlalchemy starlette tkhtmlview tkinterweb tqdm ttkbootstrap typing-extensions typing-inspect tzdata urllib3 uvicorn watchfiles websockets wrapt xlsxwriter zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyBCM - Python Business Capability Modeler

> **NOTICE:** The `pybcm-noai` branch does not include built-in LLM generation or chat features, and AI-powered capability generation is supported exclusively through smart copy/paste features, allowing integration with browser-based AI chat agents like ChatGPT. If you do not have access to common API powered LLM services supported by PydanticAI, then choose the `pybcm-noai` branch. 

**PyBCM** is a powerful and user-friendly Business Capability Modeling (BCM) application built with Python. It provides an intuitive graphical interface for creating, visualizing, and managing hierarchical business capability models. This tool is designed to help business architects, analysts, and strategists map and understand their organization's capabilities effectively.

![PyBCM Screenshot](https://github.com/ThomasRohde/PyBCM/blob/master/images/image.png?raw=true)

## Key Features

PyBCM offers a comprehensive set of features to support various aspects of business capability modeling:

### Core Capability Management

*   **Hierarchical Tree View:**  Visualize and navigate your capability model in an intuitive tree structure.
*   **Drag-and-Drop Reordering:** Easily rearrange capabilities within the hierarchy by simply dragging and dropping them.
*   **CRUD Operations:** Create, read, update, and delete capabilities seamlessly.
*   **Rich Text Descriptions:**  Add detailed descriptions to capabilities using Markdown, with real-time preview and automatic saving.
*   **Persistent Storage:** Utilizes a robust SQLite database to store your capability model reliably.
*   **Search Functionality:** Quickly find capabilities by name or description using the built-in search bar.
*   **Import/Export:** Import and export your entire capability model in JSON format for easy sharing and backup.

### Advanced AI Assistance

*   **AI-Powered Expansion:**  Leverage the power of large language models (LLMs) to automatically generate sub-capabilities based on selected capabilities.
*   **First-Level Capability Generation:** Use AI to create initial high-level capabilities from an organization name and description.
*   **Customizable AI Settings:** Configure the maximum number of AI-generated capabilities and adjust settings for initial capability creation.
*   **AI Chat Interface:** Interact with an AI assistant to explore your capability model, search capabilities, and get insights.

### Interactive Visualization

*   **Dynamic Visualizer:** Generate interactive visualizations of your capability model within a dedicated window.
*   **Zoom and Pan:**  Easily navigate the visualization using zoom (Ctrl + Mouse Wheel) and pan (click and drag).
*   **Color-Coded Levels:** Visually distinguish different levels of the capability hierarchy with customizable color schemes.
*   **Tooltips:** Hover over capabilities to view their detailed descriptions.
*   **Auto-Layout:**  Intelligent layout algorithms automatically arrange capabilities for optimal clarity and readability.
    *   **Standard Layout:** A balanced layout algorithm suitable for most models.
    *   **High-Quality (HQ) Layout:** An advanced algorithm that optimizes for aspect ratio and space utilization, especially useful for complex models.
*   **Customizable Visualization Settings:** Adjust layout parameters, colors, font sizes, and more to tailor the visualization to your preferences.

### Export Options

*   **SVG Export:** Generate high-quality vector graphics (SVG) of your capability model for use in documentation, presentations, and web pages.
*   **PowerPoint Export:** Export your capability model directly to a PowerPoint presentation, preserving layout and styling for seamless integration into your reports.
*   **Archimate Open Exchange Format:** Export your capability model in Archimate Open Exchange format, making it compatible with popular enterprise architecture tools like Archi.
*   **Audit Log Export:** Export detailed audit logs of all changes made to your capability model in Excel format.

### Audit Logging and Security

*   **Detailed Audit Trail:** Track all changes to your capability model, including creation, updates, deletions, and moves, with timestamps and details of old and new values.
*   **Audit Log Viewer:** A dedicated interface to view, search, and filter audit logs.
*   **Excel Export:** Export audit logs to an Excel file for further analysis and reporting.
*   **Secure Database:** The application uses SQLite with foreign key constraints enabled by default to ensure data integrity and prevent unauthorized modifications.

## Installation

### Prerequisites

*   Python 3.11 or higher
*   `uv` package manager (recommended for faster dependency management)

### Steps

1. **Clone the repository:**

    ```bash
    git clone https://github.com/yourusername/pybcm.git
    cd pybcm
    ```

2. **Install dependencies using `uv`:**

    ```bash
    uv pip install -e .
    ```

3. **Alternative: Run as a uv tool:**

    You can install bcm directly as a uv tool:

    ```bash
    uv tool install pybcm
    bcm
    ```

4. **Updating the Project:**

    To update PyBCM to the latest version from GitHub:

    1. Navigate to your local repository:
       ```bash
       cd path/to/pybcm
       ```
    
    2. Pull the latest changes:
       ```bash
       git pull origin master
       ```
    
    3. Update dependencies:
       ```bash
       uv pip install -e .
       ```
    
    Note: Before updating, it's recommended to:
    - Back up your `.pybcm` directory in case you've made custom template modifications
    - Check the release notes on GitHub for any breaking changes
    - Export your capability models if you want to be extra cautious

5. **Configure LLM API Keys:**

    PyBCM uses PydanticAI to interact with various LLM providers. You'll need to:

    1. Copy the sample environment file to your user directory:
       ```bash
       mkdir -p ~/.pybcm
       cp .env.sample ~/.pybcm/.env
       ```
    2. Edit `~/.pybcm/.env` and configure your environment:

       Required variables:
       - `OPENAI_API_KEY`: Your OpenAI API key (required for default setup)

       Optional LLM providers:
       - `ANTHROPIC_API_KEY`: For Claude models
       - `GOOGLE_API_KEY`: For Gemini models
       - `GROQ_API_KEY`: For Groq models
       - `MISTRAL_API_KEY`: For Mistral models

       Model settings:
       - `DEFAULT_MODEL`: Model to use (default: gpt-4-turbo-preview)
       - `MAX_TOKENS`: Maximum response length (default: 2000)
       - `TEMPERATURE`: Response creativity 0.0-1.0 (default: 0.7)

       See the [Logfire documentation](https://logfire.pydantic.dev/docs/reference/configuration/#using-environment-variables) for setting environment variables for logging.
    
    The application validates these settings on startup and will show an error if required variables are missing.

6. **Configure Logfire logging (first time only):**

    PyBCM uses Logfire for advanced logging and monitoring. On first run, you'll need to:

    1. Create a Logfire account at [logfire.pydantic.dev](https://logfire.pydantic.dev)
    2. Install the Logfire CLI:
       ```bash
       uv pip install logfire
       ```
    3. Authenticate with Logfire:
       ```bash
       logfire auth
       ```
    4. Create and select a project:
       ```bash
       logfire projects new pybcm
       logfire projects use pybcm
       ```

    This only needs to be done once. Credentials are stored in `~/.logfire/default.toml`.


## Usage

### Launching the Application

Run the application from the command line:

```bash
bcm
```

### Basic Navigation

*   **Tree View:** The left panel displays the hierarchical capability tree.
*   **Description:** The right panel shows the description of the selected capability.
*   **Toolbar:** Provides quick access to common actions like expand/collapse, AI expansion, visualization, search, and editing.
*   **Menu Bar:** Offers more advanced options, including import/export, settings, and audit log management.

### Managing Capabilities

1. **Adding a Capability:**
    *   Right-click on the desired parent in the tree view and select "New Child."
    *   Enter the capability name and an optional description.
    *   Click "OK."

2. **Updating a Capability:**
    *   Select a capability in the tree view.
    *   Click "Edit" in the toolbar to switch to edit mode.
    *   Modify the name or description in the right panel.
    *   Click "View" to see a markdown preview or "Save" to save changes to the database.

3. **Deleting a Capability:**
    *   Right-click on the capability in the tree view and select "Delete."
    *   Confirm the deletion.

4. **Reordering Capabilities:**
    *   Drag and drop capabilities within the tree view to change their order or parent.

5. **Copy/Paste Capabilities:**
    *   **Copy (Ctrl+C):** Select a capability and press Ctrl+C to copy its context to the clipboard in a format suitable for AI expansion.
    *   **Paste (Ctrl+V):** Select a parent capability, then press Ctrl+V to paste a JSON array of sub-capabilities. Each capability in the array must have `name` and `description` fields.
    *   This allows you to:
        - Copy capability context for use with external AI tools
        - Paste pre-defined sets of capabilities from JSON
        - Share capability structures between models

### Using AI Features

1. **AI Capability Expansion:**
    *   Select a capability in the tree view.
    *   Click the "✨" (sparkles) button in the toolbar.
    *   Review the AI-generated sub-capabilities.
    *   Check the boxes next to the capabilities you want to add.
    *   Click "OK."

2. **AI Chat:**
    *   Click the "πŸ€–" (robot) button in the toolbar.
    *   A new browser window will open, allowing you to interact with the AI assistant.
    *   Ask questions about your capability model, search for capabilities, and get insights using natural language.

### Working with Visualizations

1. **Opening the Visualizer:**
    *   Click the "πŸ—ΊοΈ" (map) button in the toolbar or select "Visualize Model" from the "Edit" menu.
    *   A new window opens displaying the interactive visualization.

2. **Navigation:**
    *   **Zoom:** Use Ctrl + Mouse Wheel to zoom in and out.
    *   **Pan:** Click and drag to move around the canvas.

3. **Tooltips:**
    *   Hover your mouse over a capability to view its description in a tooltip.

4. **Exporting:**
    *   **SVG:** Select "File" > "Export to SVG..." to save the visualization as an SVG file.
    *   **PowerPoint:** Select "File" > "Export to PowerPoint..." to generate a PowerPoint presentation.
    *   **Archimate:** Select "File" > "Export to Archimate..." to create an Archimate Open Exchange file.

5. **Customization:**
    *   Access visualization settings through "File" > "Settings."
    *   Customize colors, layout parameters, font sizes, and more.

### Settings

Access the application settings through "File" > "Settings." Here you can customize:

*   **Visual Theme:** Choose from a variety of ttkbootstrap themes.
*   **AI Generation:** Configure the maximum number of AI-generated capabilities, range for first-level capabilities, and select prompt templates for different operations.
*   **Model Selection:** Select the LLM model to be used for AI features.
*   **Layout:** Adjust layout algorithm, root font size, box dimensions, gaps, padding, target aspect ratio, and maximum level for visualization.
*   **Coloring:** Customize the color scheme for different capability levels and leaf nodes in the visualizer.

### User Directory and Template Customization

PyBCM creates a `.pybcm` directory in your home folder to store user-specific data and customizations:

```
~/.pybcm/
β”œβ”€β”€ .env              # Environment configuration
β”œβ”€β”€ settings.json     # User settings  
β”œβ”€β”€ templates/        # Customizable templates
β”‚   β”œβ”€β”€ chat.html            # Chat interface template
β”‚   β”œβ”€β”€ expansion_prompt.j2  # AI capability expansion prompt
β”‚   β”œβ”€β”€ first_level_prompt.j2# First-level capabilities prompt
β”‚   └── system_prompt.j2     # AI system prompt
```

#### Template Customization

You can customize how PyBCM generates capabilities and displays the chat interface by modifying the templates in `~/.pybcm/templates/`:

1. **AI Prompts:**
   - `expansion_prompt.j2`: Customize how the AI generates sub-capabilities
   - `first_level_prompt.j2`: Modify the prompt for generating first-level capabilities
   - `system_prompt.j2`: Adjust the AI system prompt for better domain-specific responses

2. **Chat Interface:**
   - `chat.html`: Customize the appearance and behavior of the AI chat interface

The application will:
1. Create these templates automatically on first run
2. Use your customized versions if they exist
3. Fall back to the built-in templates if a customized version doesn't exist

You can select which templates to use for different operations through the Settings dialog:
1. Open Settings (File > Settings)
2. Go to the "AI Generation" tab
3. Choose templates from the dropdown menus:
   - "First-level generation template": Template for generating initial capabilities
   - "Normal generation template": Template for expanding existing capabilities

This allows you to:
- Tailor the AI prompts for your specific industry or use case
- Customize the chat interface appearance
- Experiment with different prompt strategies
- Switch between different prompt templates without editing files
- Maintain multiple template versions for different use cases
- Maintain your customizations across application updates

## Development

### Technologies Used

*   **Frontend:**
    *   [ttkbootstrap](https://ttkbootstrap.readthedocs.io/): Modern, themed Tkinter widgets.
    *   [tkinterweb](https://github.com/Andereoo/Tkinterweb): HTML rendering for rich text display.
*   **Backend:**
    *   [SQLAlchemy](https://www.sqlalchemy.org/): Database ORM for interacting with SQLite.
    *   [Pydantic](https://docs.pydantic.dev/): Data validation and settings management.
    *   [PydanticAI](https://github.com/e-dang/pydantic_ai): AI agent based on Pydantic models.
*   **AI:**
    *   [PydanticAI](https://github.com/pydantic/pydantic-ai): Agent framework for LLM interactions
    *   Supported LLM providers:
        - OpenAI (default)
        - Anthropic
        - Google AI (Gemini)
        - Groq
        - Mistral
        - Ollama
*   **Visualization:**
    *   Custom layout algorithms implemented in `layout.py` and `hq_layout.py`.
    *   `tkinter` Canvas for rendering.
*   **Export:**
    *   `svgwrite` (implicitly used for SVG generation)
    *   `python-pptx` for PowerPoint generation.
    *   `xml.etree.ElementTree` for Archimate XML generation.
*   **Other:**
    *   `uv`: Fast package manager for installing dependencies.
    *   `jinja2`: Templating engine for generating prompts and reports.
    *   `markdown`: For Markdown rendering in descriptions and AI chat.
    *   `logfire`: For logging and instrumentation.

### Contributing

Contributions are welcome! If you want to contribute to PyBCM, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and write unit tests if applicable.
4. Ensure all tests pass and the code follows the project's style guide (we use `black`).
5. Submit a pull request with a clear description of your changes.

## License

PyBCM is released under the [MIT License](https://opensource.org/licenses/MIT).

## Acknowledgements

*   Thanks to the developers of all the open-source libraries used in this project.
*   Special thanks to [ttkbootstrap](https://github.com/israel-dryer/ttkbootstrap) for providing a fantastic set of modern Tkinter themes and widgets.

## Contact

For any questions or feedback, please open an issue on the [GitHub repository](https://github.com/ThomasRohde/PyBCM).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pybcm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "bcm, business, capability, enterprise-architecture, modeling",
    "author": null,
    "author_email": "Thomas Klok Rohde <thomas@rohde.name>",
    "download_url": "https://files.pythonhosted.org/packages/25/5e/aad4a28dee26dc6ca52b186a9c5c2d5145dde5992b70189668712cc04dfc/pybcm-0.1.12.tar.gz",
    "platform": null,
    "description": "# PyBCM - Python Business Capability Modeler\n\n> **NOTICE:** The `pybcm-noai` branch does not include built-in LLM generation or chat features, and AI-powered capability generation is supported exclusively through smart copy/paste features, allowing integration with browser-based AI chat agents like ChatGPT. If you do not have access to common API powered LLM services supported by PydanticAI, then choose the `pybcm-noai` branch. \n\n**PyBCM** is a powerful and user-friendly Business Capability Modeling (BCM) application built with Python. It provides an intuitive graphical interface for creating, visualizing, and managing hierarchical business capability models. This tool is designed to help business architects, analysts, and strategists map and understand their organization's capabilities effectively.\n\n![PyBCM Screenshot](https://github.com/ThomasRohde/PyBCM/blob/master/images/image.png?raw=true)\n\n## Key Features\n\nPyBCM offers a comprehensive set of features to support various aspects of business capability modeling:\n\n### Core Capability Management\n\n*   **Hierarchical Tree View:**  Visualize and navigate your capability model in an intuitive tree structure.\n*   **Drag-and-Drop Reordering:** Easily rearrange capabilities within the hierarchy by simply dragging and dropping them.\n*   **CRUD Operations:** Create, read, update, and delete capabilities seamlessly.\n*   **Rich Text Descriptions:**  Add detailed descriptions to capabilities using Markdown, with real-time preview and automatic saving.\n*   **Persistent Storage:** Utilizes a robust SQLite database to store your capability model reliably.\n*   **Search Functionality:** Quickly find capabilities by name or description using the built-in search bar.\n*   **Import/Export:** Import and export your entire capability model in JSON format for easy sharing and backup.\n\n### Advanced AI Assistance\n\n*   **AI-Powered Expansion:**  Leverage the power of large language models (LLMs) to automatically generate sub-capabilities based on selected capabilities.\n*   **First-Level Capability Generation:** Use AI to create initial high-level capabilities from an organization name and description.\n*   **Customizable AI Settings:** Configure the maximum number of AI-generated capabilities and adjust settings for initial capability creation.\n*   **AI Chat Interface:** Interact with an AI assistant to explore your capability model, search capabilities, and get insights.\n\n### Interactive Visualization\n\n*   **Dynamic Visualizer:** Generate interactive visualizations of your capability model within a dedicated window.\n*   **Zoom and Pan:**  Easily navigate the visualization using zoom (Ctrl + Mouse Wheel) and pan (click and drag).\n*   **Color-Coded Levels:** Visually distinguish different levels of the capability hierarchy with customizable color schemes.\n*   **Tooltips:** Hover over capabilities to view their detailed descriptions.\n*   **Auto-Layout:**  Intelligent layout algorithms automatically arrange capabilities for optimal clarity and readability.\n    *   **Standard Layout:** A balanced layout algorithm suitable for most models.\n    *   **High-Quality (HQ) Layout:** An advanced algorithm that optimizes for aspect ratio and space utilization, especially useful for complex models.\n*   **Customizable Visualization Settings:** Adjust layout parameters, colors, font sizes, and more to tailor the visualization to your preferences.\n\n### Export Options\n\n*   **SVG Export:** Generate high-quality vector graphics (SVG) of your capability model for use in documentation, presentations, and web pages.\n*   **PowerPoint Export:** Export your capability model directly to a PowerPoint presentation, preserving layout and styling for seamless integration into your reports.\n*   **Archimate Open Exchange Format:** Export your capability model in Archimate Open Exchange format, making it compatible with popular enterprise architecture tools like Archi.\n*   **Audit Log Export:** Export detailed audit logs of all changes made to your capability model in Excel format.\n\n### Audit Logging and Security\n\n*   **Detailed Audit Trail:** Track all changes to your capability model, including creation, updates, deletions, and moves, with timestamps and details of old and new values.\n*   **Audit Log Viewer:** A dedicated interface to view, search, and filter audit logs.\n*   **Excel Export:** Export audit logs to an Excel file for further analysis and reporting.\n*   **Secure Database:** The application uses SQLite with foreign key constraints enabled by default to ensure data integrity and prevent unauthorized modifications.\n\n## Installation\n\n### Prerequisites\n\n*   Python 3.11 or higher\n*   `uv` package manager (recommended for faster dependency management)\n\n### Steps\n\n1. **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/yourusername/pybcm.git\n    cd pybcm\n    ```\n\n2. **Install dependencies using `uv`:**\n\n    ```bash\n    uv pip install -e .\n    ```\n\n3. **Alternative: Run as a uv tool:**\n\n    You can install bcm directly as a uv tool:\n\n    ```bash\n    uv tool install pybcm\n    bcm\n    ```\n\n4. **Updating the Project:**\n\n    To update PyBCM to the latest version from GitHub:\n\n    1. Navigate to your local repository:\n       ```bash\n       cd path/to/pybcm\n       ```\n    \n    2. Pull the latest changes:\n       ```bash\n       git pull origin master\n       ```\n    \n    3. Update dependencies:\n       ```bash\n       uv pip install -e .\n       ```\n    \n    Note: Before updating, it's recommended to:\n    - Back up your `.pybcm` directory in case you've made custom template modifications\n    - Check the release notes on GitHub for any breaking changes\n    - Export your capability models if you want to be extra cautious\n\n5. **Configure LLM API Keys:**\n\n    PyBCM uses PydanticAI to interact with various LLM providers. You'll need to:\n\n    1. Copy the sample environment file to your user directory:\n       ```bash\n       mkdir -p ~/.pybcm\n       cp .env.sample ~/.pybcm/.env\n       ```\n    2. Edit `~/.pybcm/.env` and configure your environment:\n\n       Required variables:\n       - `OPENAI_API_KEY`: Your OpenAI API key (required for default setup)\n\n       Optional LLM providers:\n       - `ANTHROPIC_API_KEY`: For Claude models\n       - `GOOGLE_API_KEY`: For Gemini models\n       - `GROQ_API_KEY`: For Groq models\n       - `MISTRAL_API_KEY`: For Mistral models\n\n       Model settings:\n       - `DEFAULT_MODEL`: Model to use (default: gpt-4-turbo-preview)\n       - `MAX_TOKENS`: Maximum response length (default: 2000)\n       - `TEMPERATURE`: Response creativity 0.0-1.0 (default: 0.7)\n\n       See the [Logfire documentation](https://logfire.pydantic.dev/docs/reference/configuration/#using-environment-variables) for setting environment variables for logging.\n    \n    The application validates these settings on startup and will show an error if required variables are missing.\n\n6. **Configure Logfire logging (first time only):**\n\n    PyBCM uses Logfire for advanced logging and monitoring. On first run, you'll need to:\n\n    1. Create a Logfire account at [logfire.pydantic.dev](https://logfire.pydantic.dev)\n    2. Install the Logfire CLI:\n       ```bash\n       uv pip install logfire\n       ```\n    3. Authenticate with Logfire:\n       ```bash\n       logfire auth\n       ```\n    4. Create and select a project:\n       ```bash\n       logfire projects new pybcm\n       logfire projects use pybcm\n       ```\n\n    This only needs to be done once. Credentials are stored in `~/.logfire/default.toml`.\n\n\n## Usage\n\n### Launching the Application\n\nRun the application from the command line:\n\n```bash\nbcm\n```\n\n### Basic Navigation\n\n*   **Tree View:** The left panel displays the hierarchical capability tree.\n*   **Description:** The right panel shows the description of the selected capability.\n*   **Toolbar:** Provides quick access to common actions like expand/collapse, AI expansion, visualization, search, and editing.\n*   **Menu Bar:** Offers more advanced options, including import/export, settings, and audit log management.\n\n### Managing Capabilities\n\n1. **Adding a Capability:**\n    *   Right-click on the desired parent in the tree view and select \"New Child.\"\n    *   Enter the capability name and an optional description.\n    *   Click \"OK.\"\n\n2. **Updating a Capability:**\n    *   Select a capability in the tree view.\n    *   Click \"Edit\" in the toolbar to switch to edit mode.\n    *   Modify the name or description in the right panel.\n    *   Click \"View\" to see a markdown preview or \"Save\" to save changes to the database.\n\n3. **Deleting a Capability:**\n    *   Right-click on the capability in the tree view and select \"Delete.\"\n    *   Confirm the deletion.\n\n4. **Reordering Capabilities:**\n    *   Drag and drop capabilities within the tree view to change their order or parent.\n\n5. **Copy/Paste Capabilities:**\n    *   **Copy (Ctrl+C):** Select a capability and press Ctrl+C to copy its context to the clipboard in a format suitable for AI expansion.\n    *   **Paste (Ctrl+V):** Select a parent capability, then press Ctrl+V to paste a JSON array of sub-capabilities. Each capability in the array must have `name` and `description` fields.\n    *   This allows you to:\n        - Copy capability context for use with external AI tools\n        - Paste pre-defined sets of capabilities from JSON\n        - Share capability structures between models\n\n### Using AI Features\n\n1. **AI Capability Expansion:**\n    *   Select a capability in the tree view.\n    *   Click the \"\u2728\" (sparkles) button in the toolbar.\n    *   Review the AI-generated sub-capabilities.\n    *   Check the boxes next to the capabilities you want to add.\n    *   Click \"OK.\"\n\n2. **AI Chat:**\n    *   Click the \"\ud83e\udd16\" (robot) button in the toolbar.\n    *   A new browser window will open, allowing you to interact with the AI assistant.\n    *   Ask questions about your capability model, search for capabilities, and get insights using natural language.\n\n### Working with Visualizations\n\n1. **Opening the Visualizer:**\n    *   Click the \"\ud83d\uddfa\ufe0f\" (map) button in the toolbar or select \"Visualize Model\" from the \"Edit\" menu.\n    *   A new window opens displaying the interactive visualization.\n\n2. **Navigation:**\n    *   **Zoom:** Use Ctrl + Mouse Wheel to zoom in and out.\n    *   **Pan:** Click and drag to move around the canvas.\n\n3. **Tooltips:**\n    *   Hover your mouse over a capability to view its description in a tooltip.\n\n4. **Exporting:**\n    *   **SVG:** Select \"File\" > \"Export to SVG...\" to save the visualization as an SVG file.\n    *   **PowerPoint:** Select \"File\" > \"Export to PowerPoint...\" to generate a PowerPoint presentation.\n    *   **Archimate:** Select \"File\" > \"Export to Archimate...\" to create an Archimate Open Exchange file.\n\n5. **Customization:**\n    *   Access visualization settings through \"File\" > \"Settings.\"\n    *   Customize colors, layout parameters, font sizes, and more.\n\n### Settings\n\nAccess the application settings through \"File\" > \"Settings.\" Here you can customize:\n\n*   **Visual Theme:** Choose from a variety of ttkbootstrap themes.\n*   **AI Generation:** Configure the maximum number of AI-generated capabilities, range for first-level capabilities, and select prompt templates for different operations.\n*   **Model Selection:** Select the LLM model to be used for AI features.\n*   **Layout:** Adjust layout algorithm, root font size, box dimensions, gaps, padding, target aspect ratio, and maximum level for visualization.\n*   **Coloring:** Customize the color scheme for different capability levels and leaf nodes in the visualizer.\n\n### User Directory and Template Customization\n\nPyBCM creates a `.pybcm` directory in your home folder to store user-specific data and customizations:\n\n```\n~/.pybcm/\n\u251c\u2500\u2500 .env              # Environment configuration\n\u251c\u2500\u2500 settings.json     # User settings  \n\u251c\u2500\u2500 templates/        # Customizable templates\n\u2502   \u251c\u2500\u2500 chat.html            # Chat interface template\n\u2502   \u251c\u2500\u2500 expansion_prompt.j2  # AI capability expansion prompt\n\u2502   \u251c\u2500\u2500 first_level_prompt.j2# First-level capabilities prompt\n\u2502   \u2514\u2500\u2500 system_prompt.j2     # AI system prompt\n```\n\n#### Template Customization\n\nYou can customize how PyBCM generates capabilities and displays the chat interface by modifying the templates in `~/.pybcm/templates/`:\n\n1. **AI Prompts:**\n   - `expansion_prompt.j2`: Customize how the AI generates sub-capabilities\n   - `first_level_prompt.j2`: Modify the prompt for generating first-level capabilities\n   - `system_prompt.j2`: Adjust the AI system prompt for better domain-specific responses\n\n2. **Chat Interface:**\n   - `chat.html`: Customize the appearance and behavior of the AI chat interface\n\nThe application will:\n1. Create these templates automatically on first run\n2. Use your customized versions if they exist\n3. Fall back to the built-in templates if a customized version doesn't exist\n\nYou can select which templates to use for different operations through the Settings dialog:\n1. Open Settings (File > Settings)\n2. Go to the \"AI Generation\" tab\n3. Choose templates from the dropdown menus:\n   - \"First-level generation template\": Template for generating initial capabilities\n   - \"Normal generation template\": Template for expanding existing capabilities\n\nThis allows you to:\n- Tailor the AI prompts for your specific industry or use case\n- Customize the chat interface appearance\n- Experiment with different prompt strategies\n- Switch between different prompt templates without editing files\n- Maintain multiple template versions for different use cases\n- Maintain your customizations across application updates\n\n## Development\n\n### Technologies Used\n\n*   **Frontend:**\n    *   [ttkbootstrap](https://ttkbootstrap.readthedocs.io/): Modern, themed Tkinter widgets.\n    *   [tkinterweb](https://github.com/Andereoo/Tkinterweb): HTML rendering for rich text display.\n*   **Backend:**\n    *   [SQLAlchemy](https://www.sqlalchemy.org/): Database ORM for interacting with SQLite.\n    *   [Pydantic](https://docs.pydantic.dev/): Data validation and settings management.\n    *   [PydanticAI](https://github.com/e-dang/pydantic_ai): AI agent based on Pydantic models.\n*   **AI:**\n    *   [PydanticAI](https://github.com/pydantic/pydantic-ai): Agent framework for LLM interactions\n    *   Supported LLM providers:\n        - OpenAI (default)\n        - Anthropic\n        - Google AI (Gemini)\n        - Groq\n        - Mistral\n        - Ollama\n*   **Visualization:**\n    *   Custom layout algorithms implemented in `layout.py` and `hq_layout.py`.\n    *   `tkinter` Canvas for rendering.\n*   **Export:**\n    *   `svgwrite` (implicitly used for SVG generation)\n    *   `python-pptx` for PowerPoint generation.\n    *   `xml.etree.ElementTree` for Archimate XML generation.\n*   **Other:**\n    *   `uv`: Fast package manager for installing dependencies.\n    *   `jinja2`: Templating engine for generating prompts and reports.\n    *   `markdown`: For Markdown rendering in descriptions and AI chat.\n    *   `logfire`: For logging and instrumentation.\n\n### Contributing\n\nContributions are welcome! If you want to contribute to PyBCM, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes and write unit tests if applicable.\n4. Ensure all tests pass and the code follows the project's style guide (we use `black`).\n5. Submit a pull request with a clear description of your changes.\n\n## License\n\nPyBCM is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Acknowledgements\n\n*   Thanks to the developers of all the open-source libraries used in this project.\n*   Special thanks to [ttkbootstrap](https://github.com/israel-dryer/ttkbootstrap) for providing a fantastic set of modern Tkinter themes and widgets.\n\n## Contact\n\nFor any questions or feedback, please open an issue on the [GitHub repository](https://github.com/ThomasRohde/PyBCM).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 PyBCM Team  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A Business Capability Modeler built with Python and ttkbootstrap",
    "version": "0.1.12",
    "project_urls": {
        "GitHub": "https://github.com/ThomasRohde/PyBCM"
    },
    "split_keywords": [
        "bcm",
        " business",
        " capability",
        " enterprise-architecture",
        " modeling"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cae4127e79e35fe9f55c148be74149c6a5877b463a9403982386513568e49e73",
                "md5": "edf7bf8c909d3e3942f0084277c8f4d6",
                "sha256": "0d61f377a241ebbcd75d7a73c6cb77ba8d9139132636af8fe1cb831c64decd39"
            },
            "downloads": -1,
            "filename": "pybcm-0.1.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "edf7bf8c909d3e3942f0084277c8f4d6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 156231,
            "upload_time": "2025-01-23T05:18:20",
            "upload_time_iso_8601": "2025-01-23T05:18:20.993457Z",
            "url": "https://files.pythonhosted.org/packages/ca/e4/127e79e35fe9f55c148be74149c6a5877b463a9403982386513568e49e73/pybcm-0.1.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "255eaad4a28dee26dc6ca52b186a9c5c2d5145dde5992b70189668712cc04dfc",
                "md5": "3b912d2ba2c22ff2688f0075086b25e1",
                "sha256": "00ec7e972a82828479cc3ce1c39b90732c9d7ee040944eee675f19e15dfd6395"
            },
            "downloads": -1,
            "filename": "pybcm-0.1.12.tar.gz",
            "has_sig": false,
            "md5_digest": "3b912d2ba2c22ff2688f0075086b25e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 824206,
            "upload_time": "2025-01-23T05:18:24",
            "upload_time_iso_8601": "2025-01-23T05:18:24.445864Z",
            "url": "https://files.pythonhosted.org/packages/25/5e/aad4a28dee26dc6ca52b186a9c5c2d5145dde5992b70189668712cc04dfc/pybcm-0.1.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 05:18:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ThomasRohde",
    "github_project": "PyBCM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiosqlite",
            "specs": [
                [
                    "==",
                    "0.20.0"
                ]
            ]
        },
        {
            "name": "annotated-types",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "anthropic",
            "specs": [
                [
                    "==",
                    "0.42.0"
                ]
            ]
        },
        {
            "name": "anyio",
            "specs": [
                [
                    "==",
                    "4.8.0"
                ]
            ]
        },
        {
            "name": "cachetools",
            "specs": [
                [
                    "==",
                    "5.5.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.12.14"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.1"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.8"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "deprecated",
            "specs": [
                [
                    "==",
                    "1.2.15"
                ]
            ]
        },
        {
            "name": "distro",
            "specs": [
                [
                    "==",
                    "1.9.0"
                ]
            ]
        },
        {
            "name": "et-xmlfile",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "eval-type-backport",
            "specs": [
                [
                    "==",
                    "0.2.2"
                ]
            ]
        },
        {
            "name": "executing",
            "specs": [
                [
                    "==",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "fastapi",
            "specs": [
                [
                    "==",
                    "0.115.6"
                ]
            ]
        },
        {
            "name": "google-auth",
            "specs": [
                [
                    "==",
                    "2.37.0"
                ]
            ]
        },
        {
            "name": "googleapis-common-protos",
            "specs": [
                [
                    "==",
                    "1.66.0"
                ]
            ]
        },
        {
            "name": "greenlet",
            "specs": [
                [
                    "==",
                    "3.1.1"
                ]
            ]
        },
        {
            "name": "griffe",
            "specs": [
                [
                    "==",
                    "1.5.4"
                ]
            ]
        },
        {
            "name": "groq",
            "specs": [
                [
                    "==",
                    "0.14.0"
                ]
            ]
        },
        {
            "name": "h11",
            "specs": [
                [
                    "==",
                    "0.14.0"
                ]
            ]
        },
        {
            "name": "httpcore",
            "specs": [
                [
                    "==",
                    "1.0.7"
                ]
            ]
        },
        {
            "name": "httptools",
            "specs": [
                [
                    "==",
                    "0.6.4"
                ]
            ]
        },
        {
            "name": "httpx",
            "specs": [
                [
                    "==",
                    "0.27.2"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "8.5.0"
                ]
            ]
        },
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.5"
                ]
            ]
        },
        {
            "name": "jiter",
            "specs": [
                [
                    "==",
                    "0.8.2"
                ]
            ]
        },
        {
            "name": "jsonpath-python",
            "specs": [
                [
                    "==",
                    "1.0.6"
                ]
            ]
        },
        {
            "name": "logfire",
            "specs": [
                [
                    "==",
                    "3.1.0"
                ]
            ]
        },
        {
            "name": "logfire-api",
            "specs": [
                [
                    "==",
                    "3.1.0"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "==",
                    "5.3.0"
                ]
            ]
        },
        {
            "name": "markdown",
            "specs": [
                [
                    "==",
                    "3.7"
                ]
            ]
        },
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "markupsafe",
            "specs": [
                [
                    "==",
                    "3.0.2"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "mistralai",
            "specs": [
                [
                    "==",
                    "1.2.6"
                ]
            ]
        },
        {
            "name": "mypy-extensions",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "2.2.1"
                ]
            ]
        },
        {
            "name": "openai",
            "specs": [
                [
                    "==",
                    "1.59.6"
                ]
            ]
        },
        {
            "name": "openpyxl",
            "specs": [
                [
                    "==",
                    "3.1.5"
                ]
            ]
        },
        {
            "name": "opentelemetry-api",
            "specs": [
                [
                    "==",
                    "1.29.0"
                ]
            ]
        },
        {
            "name": "opentelemetry-exporter-otlp-proto-common",
            "specs": [
                [
                    "==",
                    "1.29.0"
                ]
            ]
        },
        {
            "name": "opentelemetry-exporter-otlp-proto-http",
            "specs": [
                [
                    "==",
                    "1.29.0"
                ]
            ]
        },
        {
            "name": "opentelemetry-instrumentation",
            "specs": [
                [
                    "==",
                    "0.50b0"
                ]
            ]
        },
        {
            "name": "opentelemetry-instrumentation-dbapi",
            "specs": [
                [
                    "==",
                    "0.50b0"
                ]
            ]
        },
        {
            "name": "opentelemetry-instrumentation-sqlite3",
            "specs": [
                [
                    "==",
                    "0.50b0"
                ]
            ]
        },
        {
            "name": "opentelemetry-proto",
            "specs": [
                [
                    "==",
                    "1.29.0"
                ]
            ]
        },
        {
            "name": "opentelemetry-sdk",
            "specs": [
                [
                    "==",
                    "1.29.0"
                ]
            ]
        },
        {
            "name": "opentelemetry-semantic-conventions",
            "specs": [
                [
                    "==",
                    "0.50b0"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "24.2"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.2.3"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": [
                [
                    "==",
                    "10.4.0"
                ]
            ]
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    "==",
                    "5.29.3"
                ]
            ]
        },
        {
            "name": "pyasn1",
            "specs": [
                [
                    "==",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "pyasn1-modules",
            "specs": [
                [
                    "==",
                    "0.4.1"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "2.10.5"
                ]
            ]
        },
        {
            "name": "pydantic-ai",
            "specs": [
                [
                    "==",
                    "0.0.18"
                ]
            ]
        },
        {
            "name": "pydantic-ai-slim",
            "specs": [
                [
                    "==",
                    "0.0.18"
                ]
            ]
        },
        {
            "name": "pydantic-core",
            "specs": [
                [
                    "==",
                    "2.27.2"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    "==",
                    "2.19.1"
                ]
            ]
        },
        {
            "name": "pyperclip",
            "specs": [
                [
                    "==",
                    "1.9.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "python-pptx",
            "specs": [
                [
                    "==",
                    "1.0.2"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2024.2"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.9.4"
                ]
            ]
        },
        {
            "name": "rsa",
            "specs": [
                [
                    "==",
                    "4.9"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    "==",
                    "75.8.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.17.0"
                ]
            ]
        },
        {
            "name": "sniffio",
            "specs": [
                [
                    "==",
                    "1.3.1"
                ]
            ]
        },
        {
            "name": "sqlalchemy",
            "specs": [
                [
                    "==",
                    "2.0.37"
                ]
            ]
        },
        {
            "name": "starlette",
            "specs": [
                [
                    "==",
                    "0.41.3"
                ]
            ]
        },
        {
            "name": "tkhtmlview",
            "specs": [
                [
                    "==",
                    "0.3.1"
                ]
            ]
        },
        {
            "name": "tkinterweb",
            "specs": [
                [
                    "==",
                    "3.24.14"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    "==",
                    "4.67.1"
                ]
            ]
        },
        {
            "name": "ttkbootstrap",
            "specs": [
                [
                    "==",
                    "1.10.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "typing-inspect",
            "specs": [
                [
                    "==",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2024.2"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.3.0"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": [
                [
                    "==",
                    "0.34.0"
                ]
            ]
        },
        {
            "name": "watchfiles",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "websockets",
            "specs": [
                [
                    "==",
                    "14.1"
                ]
            ]
        },
        {
            "name": "wrapt",
            "specs": [
                [
                    "==",
                    "1.17.0"
                ]
            ]
        },
        {
            "name": "xlsxwriter",
            "specs": [
                [
                    "==",
                    "3.2.0"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.21.0"
                ]
            ]
        }
    ],
    "lcname": "pybcm"
}
        
Elapsed time: 0.38697s