Skip to main content

healthcare-access

Measure spatial access to healthcare with floating catchment area (FCA) and gravity models, in a few lines of Python.

tests PyPI Python License: MIT

"How many doctors can people here actually reach?" A simple provider-to-population ratio by county hides the answer. People cross county lines, and a clinic 5 minutes away matters more than one 40 minutes away. FCA models answer the question using travel time and competition for providers. They are the standard methods in health geography and in US shortage-area research.

Four accessibility models compared on a synthetic county The same synthetic county under four models. Red dots are clinics, sized by number of physicians. The data is synthetic, generated by examples/synthetic_county_demo.py.

What's included

Model Function Reference
Two-step FCA two_step_fca Luo & Wang (2003)
Enhanced 2SFCA (stepwise travel-time zones) enhanced_2sfca Luo & Qi (2009)
Gaussian / kernel 2SFCA gaussian_2sfca Dai (2010)
Three-step FCA (selection weights for overlapping catchments) three_step_fca Wan, Zou & Sternberg (2012)
Modified 2SFCA (squared distance weights) modified_2sfca Delamater (2013)
Gravity model with competition gravity Joseph & Bantock (1982)
Any decay function you write fca(..., decay_fn)
Nearest provider, providers within X minutes nearest_provider_cost, providers_within

The package also includes:

  • Travel-cost helpers: haversine and Euclidean matrices, origin-destination table pivoting, network shortest paths with networkx that respect one-way streets, and an OpenStreetMap drive-time helper (osmnx).
  • Equity summaries: population-weighted Gini, share of people below a shortage threshold, and group comparisons (e.g. urban vs rural).

Install

pip install healthcare-access            # add [osm] for OpenStreetMap drive times

The import name is healthaccess. To install the latest code from GitHub instead:

pip install "git+https://github.com/rajibhossain26/healthcare-access.git"

For development:

git clone https://github.com/rajibhossain26/healthcare-access.git
cd healthcare-access
pip install -e ".[examples,dev]"

Quick start

import pandas as pd
import healthaccess as ha

population = pd.Series({"A": 100, "B": 300})            # people per neighborhood
physicians = pd.Series({"X": 2, "Y": 1})                # providers per clinic
minutes = pd.DataFrame({"X": [5, 15], "Y": [25, 8]},    # drive time, neighborhood x clinic
                       index=["A", "B"])

ha.two_step_fca(population, physicians, minutes, threshold=20) * 1000
# A    5.00   physicians per 1,000 residents
# B    8.33

How the numbers come about. Clinic X is within 20 minutes of both neighborhoods, so its 2 physicians are shared by 400 people (0.005 each). Clinic Y only reaches B, so its 1 physician serves 300 people. B adds both shares and gets 0.0083. The model always conserves supply: population times access, summed over neighborhoods, gives back all 3 physicians. The tests check this property for every model.

With real data

tracts = ...   # DataFrame indexed by GEOID with lon, lat (centroids) and population (ACS B01003)
clinics = ...  # DataFrame indexed by provider id with lon, lat and physicians (e.g. from NPPES)

minutes = ha.distance.osm_drive_cost_matrix("Clarke County, Georgia, USA",
                                            tracts, clinics, cutoff_minutes=60)
access = ha.enhanced_2sfca(tracts.population, clinics.physicians, minutes)

ha.equity.weighted_gini(access, tracts.population)
ha.equity.share_below(access, tracts.population, threshold=1 / 3500)   # HPSA-style ratio

If you already have a travel-time table from ArcGIS Network Analyst (OD Cost Matrix), R5 or OSRM, load it with ha.distance.from_long(table, "origin", "destination", "minutes").

Choosing a model

  • 2SFCA is the easiest to explain. Everyone inside the catchment counts equally and nobody outside counts at all, which creates sharp edges.
  • Enhanced and Gaussian 2SFCA add distance decay inside the catchment. They are usually the best default for primary care.
  • Three-step FCA stops people who can reach several clinics from being counted in full by each one, which matters in dense cities with overlapping catchments.
  • Modified 2SFCA weights distance twice, so a far-away but uncrowded clinic adds less. It does not conserve total supply, by design.
  • Gravity has no hard cutoff and is sensitive to beta. It is useful for sensitivity analysis.

The synthetic demo shows why the choice matters. On the same county, the share of residents below a 1:3,500 shortage ratio ranges from 20% to 29% depending on the model.

Run the tests

pytest

Roadmap

  • Three-step FCA (Wan et al. 2012) and Modified 2SFCA (Delamater 2013)
  • Published on PyPI
  • GeoDataFrame in, GeoDataFrame out
  • Worked example with real Georgia census tracts and provider data

Citation

If you use the package, please cite it (GitHub's "Cite this repository" button reads CITATION.cff) along with the original paper for the model you used.

Author

Rajib Hossain, PhD researcher in GIScience & environmental health, University of Georgia · LinkedIn

References

  • Luo, W., & Wang, F. (2003). Measures of spatial accessibility to health care in a GIS environment. Environment and Planning B, 30(6), 865–884.
  • Luo, W., & Qi, Y. (2009). An enhanced two-step floating catchment area (E2SFCA) method. Health & Place, 15(4), 1100–1107.
  • Dai, D. (2010). Black residential segregation, disparities in spatial access to health care facilities, and late-stage breast cancer diagnosis in metropolitan Detroit. Health & Place, 16(5), 1038–1052.
  • Wan, N., Zou, B., & Sternberg, T. (2012). A three-step floating catchment area method for analyzing spatial access to health services. International Journal of Geographical Information Science, 26(6), 1073–1089.
  • Delamater, P. L. (2013). Spatial accessibility in suboptimally configured health care systems: A modified two-step floating catchment area (M2SFCA) metric. Health & Place, 24, 30–43.
  • Joseph, A. E., & Bantock, P. R. (1982). Measuring potential physical accessibility to general practitioners in rural areas. Social Science & Medicine, 16(1), 85–90.

MIT License

Metadata

Release files for healthcare-access 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for healthcare-access 0.2.0
File Size Uploaded Provenance Actions
healthcare_access-0.2.0.tar.gz 17.1 kB With provenance Details for healthcare_access-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for healthcare-access 0.2.0
File Interpreter ABI Platform Actions
healthcare_access-0.2.0-py3-none-any.whl Python 3 none any Details for healthcare_access-0.2.0-py3-none-any.whl

Total release size: 30.2 kB

Release files / healthcare_access-0.2.0.tar.gz

Download URL healthcare_access-0.2.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2569274a7a7c74dd7759368548af4eb4c437edc56f0a7b22f4740e04237070ac
BLAKE2b-256 checksum
How to use checksums
20092d764c5eb5b2ca9c02182fd2504361e2484d467230ea39ad688c3dd37a32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Release files / healthcare_access-0.2.0-py3-none-any.whl

Download URL healthcare_access-0.2.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
335191643931defbcfbce9f9b93a946120629b932e730c81a5f820f58be70c44
BLAKE2b-256 checksum
How to use checksums
adbbeab9c4f0a49811e28629467aba8669861112b9876d2daa824b3a981a64f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Security for healthcare-access 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for healthcare_access-0.2.0.tar.gz

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 Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page