Skip to main content

CLI for querying Census ACS 5-year data for Michigan counties

Project description

acs-cli-mi

A command-line tool for querying U.S. Census Bureau American Community Survey (ACS) 5-year estimates for Michigan counties. Returns clean CSV output ready for spreadsheets, data pipelines, or further analysis.

Install

# Run directly without installing
uvx acs-cli-mi --help

# Or install with pip/uv
pip install acs-cli-mi

Requires Python 3.14+.

Setup

Get a free Census API key at https://api.census.gov/data/key_signup.html, then save it:

acs-cli-mi login --api-key YOUR_KEY

The key is stored in ~/.config/acs-cli/config. Alternatively, set CENSUS_API_KEY in your environment or a .env file.

Usage

Query topics

# Population demographics for all Michigan counties
acs-cli-mi query population

# Filter to a specific county
acs-cli-mi query income --county Wayne

# Combine multiple topics
acs-cli-mi query population income education --county Washtenaw

# All topics at once
acs-cli-mi query all

Multi-year queries

Query across multiple ACS vintages to see trends over time. Adds a Year column to the output.

acs-cli-mi query population --years 2019,2020,2021,2022,2023,2024
acs-cli-mi query income --years 2019,2024 --county Wayne

Save to file

acs-cli-mi query population income --output data.csv
acs-cli-mi query all --years 2020,2024 --output trend.csv

Sort results

acs-cli-mi query population --sort "Total Population"

County profile

Get all topics for a single county in a vertical layout:

acs-cli-mi info Washtenaw
acs-cli-mi info "Grand Traverse" --year 2022

List available topics

acs-cli-mi topics

Raw Census variables

Bypass the topic system and request specific ACS variable codes:

acs-cli-mi query -v B01003_001E -v B19013_001E

Available Topics

Topic Description
population Total population, male/female, age breakouts (by sex), under 18, nativity/citizenship, households, housing units
income Median household/family income, per capita income, Gini index, earnings by sex, household income distribution (16 brackets), income sources (Social Security, SSI, public assistance, retirement)
age Median age overall, male, female
poverty Poverty universe and count below poverty level
education Full educational attainment for pop 25+ (no schooling through doctorate, including partial levels)
race Total, White, Black, AIAN, Asian
health_insurance Insurance universe, with coverage, without coverage
disability Disability universe, male with disability, female with disability
insurance_income Insurance status by household income brackets

Output Format

All output is CSV written to stdout (or a file with --output). Values are raw numbers without formatting so they can be consumed directly by pandas, Excel, database imports, or other tools. Suppressed Census values appear as empty fields.

Data Source

All data comes from the Census Bureau ACS 5-Year Estimates API. Available vintages: 2009-2024. Data covers all 83 Michigan counties (FIPS state code 26).

Project Structure

src/acs_cli/
├── cli.py              # Typer CLI commands
├── topics.py           # Variable definitions and topic registry
└── census_api/
    ├── __init__.py
    └── client.py       # API client, key management, CSV output

Project details


Download files

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

Source Distribution

acs_cli_mi-0.1.2.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

acs_cli_mi-0.1.2-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file acs_cli_mi-0.1.2.tar.gz.

File metadata

  • Download URL: acs_cli_mi-0.1.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acs_cli_mi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8668e2567f0af24d77f1ee9965a90e57a90f5a167808da72e816784a284b396b
MD5 5c9e673c09878643a4053c9928766914
BLAKE2b-256 af3dd8f92b781edf8ba16a5b16bffb22dfd799056910bbe58b7ff0383d610031

See more details on using hashes here.

File details

Details for the file acs_cli_mi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: acs_cli_mi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acs_cli_mi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e43eb6caf7658daea31b2f42d396cbbb4db6eb02e9dabfb22c8d5e53c131f3
MD5 b0dc976782585f55d91601e005d41e88
BLAKE2b-256 2d9ba755e629b0d9bba95264c82b497bf50a683f49297c075eaba21d64df5f20

See more details on using hashes here.

Supported by

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