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
Metadata
Release files for cdfidata 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cdfidata-0.4.0.tar.gz | 25.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cdfidata-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.7 kB
Release files / cdfidata-0.4.0.tar.gz
| Download URL | cdfidata-0.4.0.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
224a1f5f4588c2b47ccce3a91b354e489c5ed30a68ce66947b2b5a61f5b1613c
|
|
BLAKE2b-256 checksum How to use checksums |
9ee699fd51118f85b06efa7632792ee4e8b85cac95326dcefd52b40b50a65ef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / cdfidata-0.4.0-py3-none-any.whl
| Download URL | cdfidata-0.4.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd96c5382a76ca27a96a5f1fb4f83710b8d080a4a9c8e1c5f6babe1983f41c94
|
|
BLAKE2b-256 checksum How to use checksums |
e95851226b80f889e70f2a4a08eca9a95c6633135362148a26a7e59682e7b8b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency log