# audi0417/fineta architecture

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

- Interactive diagram: https://gitdiagram.com/audi0417/fineta
- Repository: https://github.com/audi0417/fineta

## Overview

##### Main Components Identification

The system can be broken down into three major components:
- Data Acquisition Layer (Crawler)
- Processing Layer (Indicators)
- Export Layer (Export)

##### Component Details

a) Crawler Module (Blue Components):
- Financial Report Crawler
- Stock Price Fetcher
- ESG Report Crawler
- Configuration Handler
- Exception Handler

b) Indicators Module (Green Components):
- Fundamental Indicators
- Technical Indicators
- Risk Indicators
- Return Indicators

c) Export Module (Orange Components):
- CSV Exporter
- Excel Exporter

##### Relationships and Data Flow

- Data flow from external sources to crawlers
- Processing flow through indicators
- Output flow to export formats

##### Specific Implementation Details

Technical elements:
- Python 3.7+ Runtime Environment
- pandas DataFrame as the central data structure
- External dependencies (shown in requirements.txt)

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Systems Layer
    subgraph External
        TWSE[TWSE API]
        YF[Yahoo Finance API]
        ESG[ESG Report Sources]
    end

    %% Core Components Layer
    subgraph Crawler["Data Acquisition Layer"]
        FRC["Financial Report Crawler"]:::crawler
        SPC["Stock Price Fetcher"]:::crawler
        ESGC["ESG Report Crawler"]:::crawler
        CH["Configuration Handler"]:::crawler
        EH["Exception Handler"]:::crawler
    end

    subgraph Processing["Processing Layer"]
        Stock["Core Stock Model"]:::core
        subgraph Indicators
            FI["Fundamental Indicators"]:::processor
            TI["Technical Indicators"]:::processor
            RI["Risk Indicators"]:::processor
            RTI["Return Indicators"]:::processor
        end
    end

    subgraph Export["Export Layer"]
        CSV["CSV Exporter"]:::exporter
        Excel["Excel Exporter"]:::exporter
    end

    %% Relationships
    TWSE --> FRC
    YF --> SPC
    ESG --> ESGC
    
    FRC --> Stock
    SPC --> Stock
    ESGC --> Stock
    
    CH -.-> FRC
    CH -.-> SPC
    CH -.-> ESGC
    
    EH -.-> FRC
    EH -.-> SPC
    EH -.-> ESGC
    
    Stock --> FI
    Stock --> TI
    Stock --> RI
    Stock --> RTI
    
    FI --> CSV
    TI --> CSV
    RI --> CSV
    RTI --> CSV
    
    FI --> Excel
    TI --> Excel
    RI --> Excel
    RTI --> Excel

    %% Styling
    classDef crawler fill:#a8d1f0
    classDef processor fill:#90EE90
    classDef exporter fill:#FFB347
    classDef external fill:#D3D3D3
    classDef core fill:#FFFFFF,stroke:#333,stroke-width:2px
    
    %% Click Events
    click FRC "https://github.com/audi0417/Fineta/blob/main/crawler/financial_report.py"
    click SPC "https://github.com/audi0417/Fineta/blob/main/crawler/stock_price_fetcher.py"
    click ESGC "https://github.com/audi0417/Fineta/blob/main/crawler/esg_report.py"
    click CH "https://github.com/audi0417/Fineta/blob/main/crawler/config.py"
    click EH "https://github.com/audi0417/Fineta/blob/main/crawler/exceptions.py"
    click FI "https://github.com/audi0417/Fineta/blob/main/indicators/fundamental_indicators.py"
    click TI "https://github.com/audi0417/Fineta/blob/main/indicators/technical_indicators.py"
    click RI "https://github.com/audi0417/Fineta/blob/main/indicators/risk_indicators.py"
    click RTI "https://github.com/audi0417/Fineta/blob/main/indicators/return_indicators.py"
    click CSV "https://github.com/audi0417/Fineta/blob/main/export/export_to_csv.py"
    click Excel "https://github.com/audi0417/Fineta/blob/main/export/export_to_excel.py"
    click Stock "https://github.com/audi0417/Fineta/blob/main/stock.py"
```
