# jaypatel1511/cdfi-data architecture

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

- Interactive diagram: https://gitdiagram.com/jaypatel1511/cdfi-data
- Repository: https://github.com/jaypatel1511/cdfi-data

## Overview

cdfi-data is a Python ETL library for preparing CDFI Fund Transaction Level Report (TLR), Consumer Loan Report (CLR), and Awards data for analysis. A user calls a dataset loader; TLR can download and extract cached annual releases, while CLR and Awards accept local CSV files. Loaders standardize records, expose dataset-specific filtering and summaries, and export results. The TLR loader also stacks annual releases with provenance. Source excerpts establish the main calls; unsampled modules and finer-grained runtime behavior are not inferred.

Main entry points: [`cdfidata/sources/tlr.py`](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/tlr.py) (TLR loader), [`cdfidata/sources/clr.py`](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/clr.py) (CLR loader), [`cdfidata/sources/awards.py`](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/awards.py) (Awards loader), [`cdfidata/utils/schema.py`](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/utils/schema.py) (Dataset schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_loaders["Dataset loaders"]
  node_api["Public API<br/>[__init__.py]"]
  node_tlr["TLR loader<br/>[tlr.py]"]
  node_clr["CLR loader<br/>[clr.py]"]
  node_awards["Awards loader<br/>[awards.py]"]
end

subgraph group_ingest["Data acquisition"]
  node_downloader["Download and extract<br/>[downloader.py]"]
  node_cdfi["CDFI Fund releases"]
  node_cache[("Local cache")]
end

subgraph group_normalize["Standardization"]
  node_cleaner["Data standardizer<br/>[cleaner.py]"]
  node_schema["Dataset schemas<br/>[schema.py]"]
end

subgraph group_output["Analysis and export"]
  node_exporter["Data exporter<br/>[exporter.py]"]
  node_analyst["Analysis results"]
end

node_user(("Python user"))

node_user -->|"imports"| node_api
node_api -->|"exposes"| node_tlr
node_api -->|"exposes"| node_clr
node_api -->|"exposes"| node_awards
node_user -->|"loads and analyzes"| node_tlr
node_user -->|"loads and analyzes"| node_clr
node_user -->|"loads and analyzes"| node_awards
node_tlr -->|"downloads releases"| node_downloader
node_downloader -->|"requests data"| node_cdfi
node_downloader -->|"reads and writes"| node_cache
node_tlr -->|"standardizes rows"| node_cleaner
node_clr -->|"standardizes rows"| node_cleaner
node_awards -->|"standardizes rows"| node_cleaner
node_cleaner -->|"uses value rules"| node_schema
node_downloader -->|"uses release URLs"| node_schema
node_tlr -->|"uses TLR definitions"| node_schema
node_clr -->|"uses CLR definitions"| node_schema
node_awards -->|"uses award definitions"| node_schema
node_tlr -->|"exports frames"| node_exporter
node_clr -->|"exports frames"| node_exporter
node_awards -->|"exports frames"| node_exporter
node_exporter -->|"writes files"| node_analyst

click node_api "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/__init__.py"
click node_tlr "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/tlr.py"
click node_clr "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/clr.py"
click node_awards "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/awards.py"
click node_downloader "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/downloader.py"
click node_cleaner "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/cleaner.py"
click node_schema "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/utils/schema.py"
click node_exporter "https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/exporter.py"

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_api,node_tlr,node_clr,node_awards,node_user toneBlue
class node_downloader,node_cdfi,node_cache toneAmber
class node_cleaner,node_schema toneMint
class node_exporter,node_analyst toneRose
```

## Components

### Dataset loaders

- [Public API](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/__init__.py): `cdfidata/__init__.py`
- [TLR loader](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/tlr.py): `cdfidata/sources/tlr.py`
- [CLR loader](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/clr.py): `cdfidata/sources/clr.py`
- [Awards loader](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/sources/awards.py): `cdfidata/sources/awards.py`

### Data acquisition

- [Download and extract](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/downloader.py): `cdfidata/pipeline/downloader.py`
- **CDFI Fund releases**
- **Local cache**

### Standardization

- [Data standardizer](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/cleaner.py): `cdfidata/pipeline/cleaner.py`
- [Dataset schemas](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/utils/schema.py): `cdfidata/utils/schema.py`

### Analysis and export

- [Data exporter](https://github.com/jaypatel1511/cdfi-data/blob/main/cdfidata/pipeline/exporter.py): `cdfidata/pipeline/exporter.py`
- **Analysis results**

### Other components

- **Python user**

## Connections

- Python user → Public API: imports (evidence: `README.md`)
- Public API → TLR loader: exposes (evidence: `cdfidata/__init__.py`)
- Public API → CLR loader: exposes (evidence: `cdfidata/__init__.py`)
- Public API → Awards loader: exposes (evidence: `cdfidata/__init__.py`)
- Python user → TLR loader: loads and analyzes (evidence: `README.md`)
- Python user → CLR loader: loads and analyzes (evidence: `README.md`)
- Python user → Awards loader: loads and analyzes (evidence: `README.md`)
- TLR loader → Download and extract: downloads releases (evidence: `cdfidata/sources/tlr.py`)
- Download and extract → CDFI Fund releases: requests data (evidence: `cdfidata/pipeline/downloader.py`)
- Download and extract → Local cache: reads and writes (evidence: `cdfidata/pipeline/downloader.py`)
- TLR loader → Data standardizer: standardizes rows (evidence: `cdfidata/sources/tlr.py`)
- CLR loader → Data standardizer: standardizes rows (evidence: `cdfidata/sources/clr.py`)
- Awards loader → Data standardizer: standardizes rows (evidence: `cdfidata/sources/awards.py`)
- Data standardizer → Dataset schemas: uses value rules (evidence: `cdfidata/pipeline/cleaner.py`)
- Download and extract → Dataset schemas: uses release URLs (evidence: `cdfidata/pipeline/downloader.py`)
- TLR loader → Dataset schemas: uses TLR definitions (evidence: `cdfidata/sources/tlr.py`)
- CLR loader → Dataset schemas: uses CLR definitions (evidence: `cdfidata/sources/clr.py`)
- Awards loader → Dataset schemas: uses award definitions (evidence: `cdfidata/sources/awards.py`)
- TLR loader → Data exporter: exports frames (evidence: `cdfidata/sources/tlr.py`)
- CLR loader → Data exporter: exports frames (evidence: `cdfidata/sources/clr.py`)
- Awards loader → Data exporter: exports frames (evidence: `cdfidata/sources/awards.py`)
- Data exporter → Analysis results: writes files (evidence: `cdfidata/pipeline/exporter.py`)
