# guille-ux/conduitpkg architecture

> Architecture diagram of the GitHub repository guille-ux/conduitpkg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guille-ux/conduitpkg
- Repository: https://github.com/guille-ux/conduitpkg

## Overview

##### Project type and purpose
- This is an open-source Python packaging toolkit (“conduitpkg”) that exposes a CLI, a GUI, and a programmatic API for scaffolding (“builder”), compressing/extracting packages (“packaging”), and installing/searching packages (“install”). It bundles itself into wheel/tar.gz and publishes to PyPI.

##### File structure
- Top-level: LICENSE, README, docs.
- python-package/: all source, tests, build scripts, distribution artifacts.
- src/conduitpkg/api → core library methods (advanced operations)
- src/conduitpkg/cli → CLI entry-point and parser (cpkg_cli.py, parsertoapi.py)
- src/conduitpkg/gui → GUI frontend
- src/conduitpkg/builder → project scaffolding (new_packet)
- src/conduitpkg/install → package installation/search/dependencies
- src/conduitpkg/packaging → compress/extract modules
- src/conduitpkg/templates → code/license/package templates
- build.sh & dist/ → packaging & distribution artifacts
- tests/ → unit tests

##### README insights
- Usage: pip install conduitpkg
- Licensing: GPLv3+

##### Main components & their interactions
a. Interfaces
- CLI (cpkg_cli.py + parsertoapi)
- GUI module
- Programmatic API
b. Core Services
- Builder Service (scaffolding new packages with templates)
- Packaging Service (compress_packet, extract_packet)
- Installation Service (install_pkg, search_packet, dependencies resolution)
c. Templates Repository
- builder_template, gpl_template, package_template
d. Distribution & Publishing
- build.sh → invokes packaging services → produces .whl/.tar.gz in dist/
- External Service: PyPI
e. Tests
- Validate each service independently

##### Architectural patterns & design principles
- Layered architecture: Interfaces → API orchestration → Core services → Templates → Distribution
- Separation of concerns: CLI/GUI vs. core logic vs. templates vs. packaging vs. install
- Modular, extensible design: each “service” is a self-contained module

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Interfaces
    subgraph "Interfaces" 
        direction TB
        CLI_CLI["cpkg_cli.py"]:::interface
        CLI_Parser["parsertoapi.py"]:::interface
        GUI["GUI Module"]:::interface
    end

    %% API Layer
    subgraph "Programmatic API"
        direction TB
        API_Init["__init__.py"]:::api
        API_Adv["advanced.py"]:::api
    end

    %% Core Services
    subgraph "Core Services"
        direction TB
        subgraph Builder
            direction TB
            Builder_Init["__init__.py"]:::core
            Builder_New["new_packet.py"]:::core
        end
        subgraph Packaging
            direction TB
            Pack_Compress["compress_packet.py"]:::core
            Pack_Extract["extract_packet.py"]:::core
        end
        subgraph Installer
            direction TB
            Install_Install["install_pkg.py"]:::core
            Install_Search["search_packet.py"]:::core
            Install_Deps["dependencies.py"]:::core
            Install_Entries["entries.py"]:::core
        end
    end

    %% Templates
    subgraph "Templates"
        direction TB
        Temp_Builder["builder_template.py"]:::templates
        Temp_GPL["gpl_template.py"]:::templates
        Temp_Pkg["package_template.py"]:::templates
    end

    %% Distribution & Publishing
    subgraph "Distribution & Publishing"
        direction TB
        BuildSh["build.sh"]:::dist
        PyProject["pyproject.toml"]:::dist
        Dist_Wheel[".whl Archive"]:::dist
        Dist_Tar[".tar.gz Archive"]:::dist
    end

    %% External
    subgraph "External Systems"
        direction TB
        PyPI[(PyPI)]:::external
        Pip[(pip)]:::external
    end

    %% Test Suite
    subgraph "Test Suite"
        direction TB
        Tests["tests/"]:::tests
    end

    %% Relationships
    CLI_CLI -->|"parse args"| CLI_Parser
    CLI_Parser -->|"calls"| API_Adv
    GUI -->|"calls"| API_Adv
    API_Adv -->|"orchestrates"| Builder_New
    API_Adv -->|"orchestrates"| Pack_Compress
    API_Adv -->|"orchestrates"| Pack_Extract
    API_Adv -->|"orchestrates"| Install_Install
    API_Adv -->|"orchestrates"| Install_Search
    API_Adv -->|"orchestrates"| Install_Deps
    API_Adv -->|"orchestrates"| Install_Entries

    Builder_New -->|"reads templates"| Temp_Builder
    Builder_New -->|"reads templates"| Temp_GPL
    Builder_New -->|"reads templates"| Temp_Pkg

    Pack_Compress -->|"outputs"| Dist_Wheel
    Pack_Compress -->|"outputs"| Dist_Tar
    Pack_Extract -->|"extracts from"| Dist_Tar

    BuildSh -->|"invokes packaging"| Pack_Compress
    BuildSh -->|"invokes packaging"| Pack_Extract
    BuildSh -->|"produces artifacts"| Dist_Wheel
    BuildSh -->|"produces artifacts"| Dist_Tar
    Dist_Wheel -->|"upload"| PyPI
    Dist_Tar -->|"upload"| PyPI

    Install_Install -->|"fetches from"| PyPI
    Install_Search -->|"queries"| PyPI
    Install_Deps -->|"resolves via"| PyPI
    Pip -->|"installs package"| Install_Install

    Tests -->|"validate"| API_Adv
    Tests -->|"validate"| Builder_New
    Tests -->|"validate"| Pack_Compress
    Tests -->|"validate"| Pack_Extract
    Tests -->|"validate"| Install_Install
    Tests -->|"validate"| Install_Search
    Tests -->|"validate"| Install_Deps

    %% Click Events
    click CLI_CLI "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/cpkg_cli.py"
    click CLI_Parser "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/cli/parsertoapi.py"
    click GUI "https://github.com/guille-ux/conduitpkg/tree/master/python-package/src/conduitpkg/gui/"
    click API_Init "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/api/__init__.py"
    click API_Adv "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/api/advanced.py"
    click Builder_Init "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/builder/__init__.py"
    click Builder_New "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/builder/new_packet.py"
    click Pack_Compress "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/packaging/compress/compress_packet.py"
    click Pack_Extract "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/packaging/extracting/extract_packet.py"
    click Install_Install "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/install/install_pkg.py"
    click Install_Search "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/install/search_packet.py"
    click Install_Deps "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/install/dependencies.py"
    click Install_Entries "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/install/entries.py"
    click Temp_Builder "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/templates/builder_template.py"
    click Temp_GPL "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/templates/gpl_template.py"
    click Temp_Pkg "https://github.com/guille-ux/conduitpkg/blob/master/python-package/src/conduitpkg/templates/package_template.py"
    click BuildSh "https://github.com/guille-ux/conduitpkg/blob/master/python-package/build.sh"
    click PyProject "https://github.com/guille-ux/conduitpkg/blob/master/python-package/pyproject.toml"
    click Dist_Wheel "https://github.com/guille-ux/conduitpkg/blob/master/python-package/dist/conduitpkg-0.2.0-py3-none-any.whl"
    click Dist_Tar "https://github.com/guille-ux/conduitpkg/blob/master/python-package/dist/conduitpkg-0.2.0.tar.gz"
    click Tests "https://github.com/guille-ux/conduitpkg/tree/master/python-package/tests/"

    %% Styles
    classDef interface fill:#a2f5a2,stroke:#2d8f2d,color:#000;
    classDef api fill:#c2e7ff,stroke:#0077b6,color:#000;
    classDef core fill:#aed6f1,stroke:#21618c,color:#000;
    classDef templates fill:#ffd699,stroke:#b35b00,color:#000;
    classDef dist fill:#d3d3d3,stroke:#555,color:#000;
    classDef external fill:#f0f8ff,stroke:#5b88ad,color:#000,stroke-dasharray: 5 5;
    classDef tests fill:#f4c2c2,stroke:#a93226,color:#000;
```
