# kholidfu/twitsaham architecture

> Architecture diagram of the GitHub repository kholidfu/twitsaham, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kholidfu/twitsaham
- Repository: https://github.com/kholidfu/twitsaham

## Overview

twitsaham is a small Python script for fetching IHSG history, calculating technical-analysis series, saving a chart, and uploading that image to Twitter. Running `app.py` imports `pandasaham.py`, whose module-level `dl()` runs once, then calls `dl()` again; each run downloads and analyzes the data. The README describes Moving Average and Bollinger Bands; the sampled code calculates a 12-day rolling mean and 20-day Bollinger Bands. It saves `ihsg.png` rather than displaying the chart. The arrows reflect the sampled code, including its two download calls.

Main entry points: [`pandasaham.py`](https://github.com/kholidfu/twitsaham/blob/master/pandasaham.py) (IHSG download and analysis), [`app.py`](https://github.com/kholidfu/twitsaham/blob/master/app.py) (Twitter workflow), [`table.csv`](https://github.com/kholidfu/twitsaham/blob/master/table.csv) (History CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_app["Twitter workflow<br/>[app.py]"]
end

subgraph group_analysis["Data analysis"]
  node_analysis_module["IHSG download and analysis<br/>[pandasaham.py]"]
  node_csv[("History CSV<br/>[table.csv]")]
  node_chart["Chart image"]
end

subgraph group_integrations["External integrations"]
  node_yahoo["Yahoo Finance"]
  node_matplotlib["Matplotlib"]
  node_twitter["Twitter API"]
end

node_runner(("Script runner"))

node_runner -->|"runs"| node_app
node_app -->|"imports; calls dl"| node_analysis_module
node_analysis_module -->|"fetches history"| node_yahoo
node_yahoo -->|"returns CSV data"| node_analysis_module
node_analysis_module -->|"writes; reads"| node_csv
node_analysis_module -->|"plots series"| node_matplotlib
node_analysis_module -->|"saves chart"| node_chart
node_app -->|"opens image"| node_chart
node_app -->|"uploads media"| node_twitter

click node_app "https://github.com/kholidfu/twitsaham/blob/master/app.py"
click node_analysis_module "https://github.com/kholidfu/twitsaham/blob/master/pandasaham.py"
click node_csv "https://github.com/kholidfu/twitsaham/blob/master/table.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app toneBlue
class node_analysis_module,node_csv,node_chart toneAmber
class node_yahoo,node_matplotlib,node_twitter toneMint
class node_runner toneIndigo
```

## Components

### Orchestration

- [Twitter workflow](https://github.com/kholidfu/twitsaham/blob/master/app.py): `app.py`

### Data analysis

- [IHSG download and analysis](https://github.com/kholidfu/twitsaham/blob/master/pandasaham.py): `pandasaham.py`
- [History CSV](https://github.com/kholidfu/twitsaham/blob/master/table.csv): `table.csv`
- **Chart image**

### External integrations

- **Yahoo Finance**
- **Matplotlib**
- **Twitter API**

### Other components

- **Script runner**

## Connections

- Script runner → Twitter workflow: runs
- Twitter workflow → IHSG download and analysis: imports; calls dl
- IHSG download and analysis → Yahoo Finance: fetches history
- Yahoo Finance → IHSG download and analysis: returns CSV data
- IHSG download and analysis → History CSV: writes; reads
- IHSG download and analysis → Matplotlib: plots series
- IHSG download and analysis → Chart image: saves chart
- Twitter workflow → Chart image: opens image
- Twitter workflow → Twitter API: uploads media
