ETL pipeline for US Treasury CDFI Fund public datasets — TLR, CLR, and Awards data
Project description
cdfi-data 🏦
ETL pipeline for US Treasury CDFI Fund public datasets.
Download, clean, and analyze Transaction Level Report (TLR), Consumer Loan Report (CLR), and Awards data from the US Department of Treasury's CDFI Fund — in one line of Python.
Why cdfi-data?
The CDFI Fund releases massive public datasets covering millions of loans and investments in low-income communities. But the raw files are messy, inconsistently formatted, and require significant cleaning before analysis. cdfi-data standardizes the entire pipeline.
Installation
pip install cdfidata
Quickstart
from cdfidata import TLRLoader, CLRLoader, AwardsLoader
# Load a single TLR fiscal year (downloads & caches automatically)
tlr = TLRLoader()
df = tlr.load(year=2022)
# Load the full cumulative TLR (FY2020–FY2022), stacked with provenance
cum = tlr.load_cumulative()
# ...or an explicit range:
cum = tlr.load_range(2020, 2022)
# Filter to Illinois
il = tlr.filter_state("IL")
# Filter by loan type and amount
small_biz = tlr.filter_loan_type("Business")
large = tlr.filter_amount(min_amount=500_000)
# Summary stats
tlr.summary()
# Export
tlr.to_csv("cdfi_transactions.csv")
tlr.to_sqlite("cdfi.db", table="tlr")
Caveat — cumulative frames stack overlapping releases. load_cumulative() /
load_range() concatenate releases with no dedup: each row carries a source_release
column (FY2020/FY2021/FY2022), and releases overlap on fiscal_year (FY2022 restates
and expands prior-year data). Filter by source_release and prefer the latest release for a
given fiscal year — don't naively aggregate the full frame, or restated rows double-count.
Field completeness (rate/term/NAICS) is also era-dependent. See docs/CANONICAL_SCHEMA.md.
Sample Data (No Download Required)
from cdfidata import TLRLoader, CLRLoader, AwardsLoader
tlr = TLRLoader()
df = tlr.load_sample(n=1000)
clr = CLRLoader()
df = clr.load_sample(n=1000)
awards = AwardsLoader()
df = awards.load_sample(n=500)
Datasets Supported
| Dataset | Source | Description |
|---|---|---|
| TLR (Transaction Level Report) | CDFI Fund | 1M+ individual CDFI loans, 61 variables |
| CLR (Consumer Loan Report) | CDFI Fund | 3.2M consumer loans aggregated to census tract |
| Awards Database | CDFI Fund | All CDFI Fund program awardees across all years |
Data Sources
CDFI Fund datasets (TLR, CLR, Awards) come from the US Department of Treasury CDFI Fund: https://www.cdfifund.gov/research-data
All data is released under open government data principles.
Running Tests
PYTHONPATH=. pytest tests/ -v
44 tests across all modules.
Who This Is For
- Impact investors analyzing CDFI loan portfolios
- Academic researchers studying community development finance
- Policy analysts evaluating CDFI Fund program outcomes
- CDFIs benchmarking their own performance against peers
- Anyone who needs clean, analysis-ready CDFI Fund data
License
MIT 2026 Jaypatel1511
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdfidata-0.3.1.tar.gz.
File metadata
- Download URL: cdfidata-0.3.1.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb0334c127a7def7bd2ec67525273e4c06e5e8daf07349a56ff914f7d85edd01
|
|
| MD5 |
f8b960040839bb3f040b40d1fdbb6ceb
|
|
| BLAKE2b-256 |
71ae3630a79859252a44e37730d1b9a18789660125b0b82aef0700079ce4e166
|
Provenance
The following attestation bundles were made for cdfidata-0.3.1.tar.gz:
Publisher:
release.yml on Jaypatel1511/cdfi-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cdfidata-0.3.1.tar.gz -
Subject digest:
cb0334c127a7def7bd2ec67525273e4c06e5e8daf07349a56ff914f7d85edd01 - Sigstore transparency entry: 1728698654
- Sigstore integration time:
-
Permalink:
Jaypatel1511/cdfi-data@8f820362c2209eb8e2070aeb612f2f6a211a0cb5 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Jaypatel1511
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8f820362c2209eb8e2070aeb612f2f6a211a0cb5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cdfidata-0.3.1-py3-none-any.whl.
File metadata
- Download URL: cdfidata-0.3.1-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96b51763e04994ffa69b031f709d1a94cb3f82e1bdc031f9434d3fa02d6504a9
|
|
| MD5 |
bb9813c9cd238361d6fccb5eb46e3159
|
|
| BLAKE2b-256 |
b3bb53d9d7286230b5820e2dd2a8101a215f901e0f97b3e5b03eac77c69e9645
|
Provenance
The following attestation bundles were made for cdfidata-0.3.1-py3-none-any.whl:
Publisher:
release.yml on Jaypatel1511/cdfi-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cdfidata-0.3.1-py3-none-any.whl -
Subject digest:
96b51763e04994ffa69b031f709d1a94cb3f82e1bdc031f9434d3fa02d6504a9 - Sigstore transparency entry: 1728698842
- Sigstore integration time:
-
Permalink:
Jaypatel1511/cdfi-data@8f820362c2209eb8e2070aeb612f2f6a211a0cb5 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Jaypatel1511
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8f820362c2209eb8e2070aeb612f2f6a211a0cb5 -
Trigger Event:
push
-
Statement type: