# ankitlenka26/sbi-fx-ratekeeper architecture

> Architecture diagram of the GitHub repository ankitlenka26/sbi-fx-ratekeeper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ankitlenka26/sbi-fx-ratekeeper
- Repository: https://github.com/ankitlenka26/sbi-fx-ratekeeper

## Overview

#### Purpose and delivery model
SBI FX RateKeeper is a repository-backed data pipeline for preserving daily State Bank of India telegraphic-transfer reference FX rates and publishing them as Excel/Google Sheets-compatible CSV histories. It is not a web application; GitHub-hosted files are the consumer interface.

Key paths: `README.md`, `csv_files/SBI_REFERENCE_RATES_USD.csv`, `csv_files/SBI_REFERENCE_RATES_EUR.csv`.

#### Execution entry points
The Python scripts are the operational entry points: `main.py` is the primary rate-collection/processing program, while `mksco.py` appears to support acquisition from the Maneesh K. Singh & Co. archive source used for historical coverage. Execution outcomes are persisted directly into repository files rather than a database.

Key paths: `main.py`, `mksco.py`, `requirements.txt`.

#### Scheduled ingestion
A GitHub Actions workflow automates recurring downloads and repository updates. Its workflow-specific properties file likely supplies the scheduled job’s inputs or metadata. GitHub Actions is therefore the material runtime/infrastructure boundary between the source website and committed datasets.

Key paths: `.github/workflows/daily-download.yml`, `.github/daily-download.properties.json`.

#### External-source boundary
The pipeline depends on SBI-published daily rate-card PDFs as the authoritative input. SBI does not guarantee a document for every working day, so missing dates are an expected source-data condition rather than necessarily a pipeline failure. Historical reconstruction may use external archives, including Maneesh K. Singh & Co.; RBI and OANDA are documented alternatives but are not represented as repository integrations.

Key paths: `main.py`, `mksco.py`, `README.md`.

#### Raw evidence archive
Downloaded source artifacts are retained as immutable-looking PDF evidence, partitioned by year and month and named by publication date. This archive supports verification and allows published CSV values to be traced back to their original rate card. It is the largest persistent store and the raw-data boundary of the system.

Key paths: `pdf_files/2020/1/2020-01-04.pdf`, `pdf_files/2024/12/2024-12-31.pdf`, `pdf_files/2026/7/2026-07-28.pdf`.

#### Normalization and publication
The processing stage extracts the reference-rate range specified by SBI—₹10–20 lakh transactions—from each daily source and appends normalized records to one CSV per currency. The currency-specific CSV layout is the public contract: consumers query/download a single currency history rather than a combined dataset.

Key paths: `main.py`, `csv_files/SBI_REFERENCE_RATES_USD.csv`, `csv_files/SBI_REFERENCE_RATES_JPY.csv`.

#### Operational boundaries and observability
There is no database, service API, or separately deployed application in the tree. State is Git-tracked filesystem content: PDFs are provenance artifacts, CSVs are curated outputs, and `log.txt` is local/run-level operational output. Correctness depends on source document availability, PDF parsing stability, and preserving the per-currency CSV schema across automated commits.

Key paths: `log.txt`, `pdf_files/`, `csv_files/`.

Main entry points: [`main.py`](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/main.py) (Primary collector), [`.github/workflows/daily-download.yml`](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/.github/workflows/daily-download.yml) (GitHub Actions), [`mksco.py`](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/mksco.py) (Archive acquisition), [`csv_files/SBI_REFERENCE_RATES_USD.csv`](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_USD.csv) (USD rate history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["Automation"]
  node_github_actions{{"GitHub Actions<br/>scheduled runtime<br/>[daily-download.yml]"}}
  node_workflow_properties["Workflow properties<br/>job inputs"]
end

subgraph group_pipeline["Collection pipeline"]
  node_main["Primary collector<br/>Python pipeline<br/>[main.py]"]
  node_mksco["Archive acquisition<br/>Python utility<br/>[mksco.py]"]
  node_normalization["₹10–20 lakh extraction<br/>normalization stage<br/>[main.py]"]
end

subgraph group_storage["Git-tracked data"]
  node_pdf_archive[("PDF evidence archive<br/>raw artifact store")]
  node_usd_csv["USD rate history<br/>published CSV"]
  node_eur_csv["EUR rate history<br/>published CSV"]
  node_jpy_csv["JPY rate history<br/>published CSV"]
  node_run_log["Run log<br/>operational output<br/>[log.txt]"]
end

node_sbi_rate_cards["SBI rate-card PDFs<br/>authoritative source"]
node_mksco_archive["Maneesh K. Singh &amp; Co. archive<br/>historical source"]
node_github_repository[("GitHub repository<br/>consumer interface")]
node_readme["Repository documentation<br/>[README.md]"]

node_workflow_properties -->|"configures job"| node_github_actions
node_github_actions -->|"runs"| node_main
node_github_actions -.->|"can run"| node_mksco
node_sbi_rate_cards -->|"daily input"| node_main
node_mksco_archive -->|"archive input"| node_mksco
node_mksco -->|"stores evidence"| node_pdf_archive
node_main -->|"archives downloads"| node_pdf_archive
node_main -->|"parses rate cards"| node_normalization
node_normalization -->|"appends USD records"| node_usd_csv
node_normalization -->|"appends EUR records"| node_eur_csv
node_normalization -->|"appends JPY records"| node_jpy_csv
node_main -->|"writes run output"| node_run_log
node_usd_csv -->|"published via commits"| node_github_repository
node_eur_csv -->|"published via commits"| node_github_repository
node_jpy_csv -->|"published via commits"| node_github_repository
node_readme -->|"documents dataset"| node_github_repository

click node_github_actions "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/.github/workflows/daily-download.yml"
click node_workflow_properties "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/.github/daily-download.properties.json"
click node_main "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/main.py"
click node_mksco "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/mksco.py"
click node_normalization "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/main.py"
click node_usd_csv "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_USD.csv"
click node_eur_csv "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_EUR.csv"
click node_jpy_csv "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_JPY.csv"
click node_run_log "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/log.txt"
click node_readme "https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/README.md"

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_github_actions,node_workflow_properties toneBlue
class node_main,node_mksco,node_normalization toneAmber
class node_pdf_archive,node_usd_csv,node_eur_csv,node_jpy_csv,node_run_log toneMint
class node_sbi_rate_cards,node_mksco_archive,node_github_repository,node_readme toneNeutral
```

## Components

### Automation

Scheduled repository ingestion.

- [GitHub Actions](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/.github/workflows/daily-download.yml): scheduled runtime · Runs recurring downloads and commits updates. · `.github/workflows/daily-download.yml`
- [Workflow properties](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/.github/daily-download.properties.json): job inputs · `.github/daily-download.properties.json`

### Collection pipeline

Acquisition and normalization programs.

- [Primary collector](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/main.py): Python pipeline · Downloads, parses, and publishes daily reference rates. · `main.py`
- [Archive acquisition](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/mksco.py): Python utility · Acquires historical archive material. · `mksco.py`
- [₹10–20 lakh extraction](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/main.py): normalization stage · Extracts SBI's specified reference-rate transaction range. · `main.py`

### Git-tracked data

Repository files are the persistent state and publication surface.

- **PDF evidence archive**: raw artifact store · Date-partitioned source PDFs retained for provenance.
- [USD rate history](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_USD.csv): published CSV · `csv_files/SBI_REFERENCE_RATES_USD.csv`
- [EUR rate history](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_EUR.csv): published CSV · `csv_files/SBI_REFERENCE_RATES_EUR.csv`
- [JPY rate history](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/csv_files/SBI_REFERENCE_RATES_JPY.csv): published CSV · `csv_files/SBI_REFERENCE_RATES_JPY.csv`
- [Run log](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/log.txt): operational output · `log.txt`

### Other components

- **SBI rate-card PDFs**: authoritative source · Daily documents can be absent on some working days.
- **Maneesh K. Singh & Co. archive**: historical source · Supports historical coverage reconstruction.
- **GitHub repository**: consumer interface · Committed CSV files are the public delivery mechanism.
- [Repository documentation](https://github.com/ankitlenka26/sbi-fx-ratekeeper/blob/main/README.md): documentation · Documents sources, coverage, and consumer usage. · `README.md`

## Connections

- Workflow properties → GitHub Actions: configures job
- GitHub Actions → Primary collector: runs
- GitHub Actions → Archive acquisition: can run
- SBI rate-card PDFs → Primary collector: daily input
- Maneesh K. Singh & Co. archive → Archive acquisition: archive input
- Archive acquisition → PDF evidence archive: stores evidence
- Primary collector → PDF evidence archive: archives downloads
- Primary collector → ₹10–20 lakh extraction: parses rate cards
- ₹10–20 lakh extraction → USD rate history: appends USD records
- ₹10–20 lakh extraction → EUR rate history: appends EUR records
- ₹10–20 lakh extraction → JPY rate history: appends JPY records
- Primary collector → Run log: writes run output
- USD rate history → GitHub repository: published via commits
- EUR rate history → GitHub repository: published via commits
- JPY rate history → GitHub repository: published via commits
- Repository documentation → GitHub repository: documents dataset
