# sassoftware/python-sasctl architecture

> Architecture diagram of the GitHub repository sassoftware/python-sasctl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sassoftware/python-sasctl
- Repository: https://github.com/sassoftware/python-sasctl

## Overview

##### Main Components and Architecture

a) Core Components:
- Session Management Layer
- Service Layer
- Task Layer
- Utility Layer
- CLI Interface

b) External Integrations:
- SAS Viya Platform
- Model Management Systems
- Authentication Services
- Data Sources

##### Component Relationships

**[Client Applications] → [sasctl Interface Layer]**
- ↓
**[Session Management] ←→ [Authentication]**
- ↓
**[Service Layer] → [REST API Handlers]**
- ↓
**[Task Layer] → [Model Management]**
- ↓
**[Utility Layer] → [Data Processing]**
- ↓
**[SAS Viya Platform]**

##### Detailed Component Breakdown

a) Session Management:
- Authentication handlers
- Session state management
- Connection pooling

b) Service Layer:
- Model Repository Service
- Folder Management
- File Management
- Project Management
- Text Analytics Services
- Microanalytic Score Service

c) Task Layer:
- Model Registration
- Model Publishing
- Score Execution
- Performance Monitoring

d) Utility Layer:
- PyMAS Integration
- Model Info Handlers
- Data Conversion Tools
- JSON Writers

##### Implementation Details

Technical aspects:
- REST API communication paths
- Authentication flows
- Model deployment pipelines
- Data transformation processes

**[Client Layer]**
- ↓
**[Interface Layer]**
- ↓
**[Service Layer]**
- ↓
**[Integration Layer]**
- ↓
**[Platform Layer]**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        CA[Client Applications]
        CLI[CLI Interface]:::cli
    end

    subgraph Interface
        SIL[sasctl Interface Layer]
    end

    subgraph SessionMgmt[Session Management]
        SM[Session Manager]:::session
        AH[Authentication Handler]:::auth
    end

    subgraph Services[Service Layer]
        MRS[Model Repository Service]:::service
        FM[Folder Management]:::service
        FIM[File Management]:::service
        PM[Project Management]:::service
        TAS[Text Analytics Services]:::service
        MSS[Microanalytic Score Service]:::service
    end

    subgraph Tasks[Task Layer]
        TR[Task Runner]:::task
        MR[Model Registration]:::task
        MP[Model Publishing]:::task
        SE[Score Execution]:::task
        PMon[Performance Monitoring]:::task
    end

    subgraph Utils[Utility Layer]
        PI[PyMAS Integration]:::util
        MIH[Model Info Handlers]:::util
        DCT[Data Conversion Tools]:::util
        JW[JSON Writers]:::util
    end

    subgraph External[External Systems]
        SV[SAS Viya Platform]
        MMS[Model Management Systems]
        AS[Authentication Services]
        DS[Data Sources]
    end

    %% Relationships
    CA --> SIL
    CLI --> SIL
    SIL --> SM
    SM <--> AH
    AH <--> AS
    SM --> Services
    Services --> Tasks
    Tasks --> Utils
    Utils --> SV
    Tasks --> MMS
    Utils --> DS

    %% Click Events
    click SM "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/core.py"
    click CLI "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/utils/cli.py"
    click MRS "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/model_repository.py"
    click FM "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/folders.py"
    click FIM "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/files.py"
    click PM "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/projects.py"
    click TAS "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/text_parsing.py"
    click MSS "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/microanalytic_score.py"
    click TR "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/tasks.py"
    click MP "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/model_publish.py"
    click SE "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/score_execution.py"
    click PI "https://github.com/sassoftware/python-sasctl/tree/master/src/sasctl/utils/pymas/"
    click MIH "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/utils/model_info.py"
    click DCT "https://github.com/sassoftware/python-sasctl/tree/master/src/sasctl/utils/pyml2ds/"
    click JW "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/pzmm/write_json_files.py"
    click AH "https://github.com/sassoftware/python-sasctl/blob/master/src/sasctl/_services/saslogon.py"

    %% Styles
    classDef service fill:#3498db,stroke:#2980b9,color:white
    classDef task fill:#2ecc71,stroke:#27ae60,color:white
    classDef util fill:#f1c40f,stroke:#f39c12,color:black
    classDef session fill:#9b59b6,stroke:#8e44ad,color:white
    classDef auth fill:#e74c3c,stroke:#c0392b,color:white
    classDef cli fill:#1abc9c,stroke:#16a085,color:white

    %% Legend
    subgraph Legend
        S1[Service Component]:::service
        T1[Task Component]:::task
        U1[Utility Component]:::util
        SM1[Session Component]:::session
        A1[Auth Component]:::auth
        C1[CLI Component]:::cli
    end
```
