Skip to main content

nmtc-mapper 🗺️

Automated NMTC eligibility checker for addresses and census tracts.

Pass a DataFrame of addresses and get back a boolean column for NMTC eligibility, distress level, poverty rate, AMI ratio, and more — using official CDFI Fund and Census Bureau data. No manual lookups required.


Why nmtc-mapper?

The CDFI Fund provides a manual web tool (CIMS) for checking NMTC eligibility one address at a time. nmtc-mapper automates this — pass 10,000 addresses and get results in seconds, using the same official data source.


Installation

pip install nmtc-mapper

Quickstart

from nmtcmapper import NMTCMapper

mapper = NMTCMapper()

# Single address (geocodes automatically)
result = mapper.check_address("1234 S Michigan Ave, Chicago, IL 60605")
result.summary()
print(result.nmtc_eligible)    # True
print(result.distress_level)   # "severe"
print(result.poverty_rate)     # 0.38

# Known census tract (no geocoding needed)
result = mapper.check_tract("17031840100")
print(result.nmtc_eligible)    # True

# Batch — enrich a DataFrame of addresses
import pandas as pd
df = pd.read_csv("projects.csv")   # must have 'address' column
df = mapper.enrich(df, address_col="address")
print(df["nmtc_eligible"].value_counts())
print(df["distress_level"].value_counts())

# If you already have census tract IDs
df = mapper.enrich(df, tract_col="tract_id")

# Summary stats
mapper.eligible_count(df)

Failure behavior & offline / demo mode

NMTCMapper() downloads the official CDFI Fund eligibility and Opportunity Zone files (cached under ~/.nmtcmapper/cache). As of 0.3.4 it fails loud: if a download or parse fails, it raises a typed error instead of silently substituting demo data. (Before 0.3.4 any failure silently fell back to a 12-tract synthetic sample, which could report a real, eligible tract as "ineligible" — see the CHANGELOG.)

from nmtcmapper import NMTCMapper, NMTCMapperError

try:
    mapper = NMTCMapper()
except NMTCMapperError as e:
    # Blocked network, moved URL, corrupt file, etc. — never a fabricated answer.
    print(f"Could not load real NMTC data: {e}")
    raise

The exception hierarchy (NMTCMapperErrorEligibilityDataError / OZDataError → specific *DownloadError / *ParseError leaves) is exported from the top level, so you can catch broadly or precisely.

Explicit demo / offline data — for examples, tests, or an air-gapped demo, opt in to the synthetic sample dataset. This performs no network calls and stamps the mapper so you can tell demo answers from real ones:

from nmtcmapper import NMTCMapper, load_sample_table

mapper = NMTCMapper.from_sample()   # 12 sample tracts + 6 OZ tracts, offline
print(mapper.data_source)           # "sample"   (real data → "cdfi_fund")

df = load_sample_table()            # the raw 12-tract sample frame

⚠️ Sample data is 12 synthetic-vintage tracts for demos and tests. It is never valid for a real NMTC eligibility answer.


Eligibility Rules (2016-2020 ACS — mandatory since Sept 1, 2024)

A census tract qualifies as a Low-Income Community (LIC) if it meets ANY of:

  • Poverty rate >= 20%
  • Median Family Income <= 80% of metro/state AMI
  • Median Family Income <= 85% of state AMI (high migration rural counties)

Distress levels:

  • deep — Poverty >= 40% OR AMI <= 50% OR unemployment >= 2x national rate
  • severe — Poverty >= 30% OR AMI <= 60% OR unemployment >= 1.5x national rate
  • lic — NMTC eligible (meets LIC criteria)
  • ineligible — Does not qualify

Data Sources


Output Columns

After running .enrich(), your DataFrame will have:

  • nmtc_eligible (bool)
  • distress_level (str: deep / severe / lic / ineligible)
  • poverty_rate (float)
  • ami_ratio (float)
  • unemployment_rate (float)
  • is_non_metro (bool)
  • severe_distress (bool)
  • deep_distress (bool)

Running Tests

PYTHONPATH=. pytest tests/ -v

44 tests across all modules (including fail-loud and explicit-sample-mode coverage added in 0.3.4).


Who This Is For

  • CDEs screening project locations for NMTC eligibility
  • CDFI analysts qualifying borrower locations at scale
  • Researchers analyzing geographic distribution of LIC tracts
  • Anyone replacing manual CIMS lookups with automated Python

License

MIT 2026 Jaypatel1511

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nmtc_mapper-0.3.4.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nmtc_mapper-0.3.4-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file nmtc_mapper-0.3.4.tar.gz.

File metadata

  • Download URL: nmtc_mapper-0.3.4.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nmtc_mapper-0.3.4.tar.gz
Algorithm Hash digest
SHA256 a4ae50e78c70460079cf99372be749a3ae6851486db94a892ce61d60a8562e63
MD5 efcb99aefd7b7a3668829202a57b64b0
BLAKE2b-256 efb348856f4174b8382d10f32bf7b0c1e06b6d648224d8ce1d03ea90dffcde44

See more details on using hashes here.

Provenance

The following attestation bundles were made for nmtc_mapper-0.3.4.tar.gz:

Publisher: release.yml on Jaypatel1511/nmtc-mapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nmtc_mapper-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: nmtc_mapper-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nmtc_mapper-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 56632d94c565b257945b82b931858e82ea2703389ee7647b92447ce90a48f7a8
MD5 01823a5d93279ad95173f8a73ebb3fa5
BLAKE2b-256 4829650ff52318d76f90e451665ff07130e47b296d427071cd7626513e6580f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nmtc_mapper-0.3.4-py3-none-any.whl:

Publisher: release.yml on Jaypatel1511/nmtc-mapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

This release

0.3.4 This release

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page