π‘ homestock¶
homestock is a Python package designed to simplify access to American Community Survey (ACS) data from the U.S. Census Bureau. It enables users to fetch detailed demographic, housing, and economic data, and seamlessly convert the results into pandas DataFrames or CSV files for further analysis.
Whether you're exploring patterns at the state level or diving deep into neighborhoods using census tracts and block groups, homestock provides a flexible, scriptable workflow for researchers, students, journalists, and developers.
π What is the ACS?¶
The American Community Survey (ACS) is an ongoing survey conducted by the U.S. Census Bureau that collects vital information on income, education, housing, employment, and more.
There are two primary types of ACS data products:
πΉ 1-Year Estimates¶
- Based on data collected over 12 months
- Available for areas with populations of 65,000+
- Best for analyzing current trends in large cities or regions
- Less stable for small populations due to smaller sample size
πΈ 5-Year Estimates¶
- Based on data collected over 60 months (5 years)
- Available for all geographic areas, down to block groups
- Best for granular spatial analysis or long-term planning
- More reliable for small population areas
πΊοΈ Supported Geographic Levels¶
| Geographic Level | Description | Available In |
|---|---|---|
| Nation | Entire United States | 1-Year, 5-Year |
| State | Individual U.S. states | 1-Year, 5-Year |
| County | Counties within states | 1-Year, 5-Year |
| County Subdivision | Minor civil divisions (e.g., townships) | 5-Year only |
| Place | Incorporated places (cities, towns) | 1-Year, 5-Year |
| ZIP Code Tabulation Area (ZCTA) | Approximated ZIP Code boundaries | 5-Year only |
| Metropolitan/Micropolitan Area | Census-defined metro or micro areas | 1-Year, 5-Year |
| Census Tract | Small subdivisions of counties (~4,000 residents) | 5-Year only |
| Block Group | Subdivisions of tracts (~600β3,000 residents) | 5-Year only |
| Block | The smallest geography (~40β100 people) | 5-Year only |
βοΈ What Can You Do with homestock?¶
- π§© Pull specific ACS tables by table ID (e.g.,
B19013for median household income) - π Convert results to
pandasDataFrames or export them as.csv - π Query different geographic levels, from national down to individual blocks
- π Explore metadata dynamically using Census variable labels
- πΊοΈ Use results in mapping tools like
folium,geopandas, orleafmap