{"id":23413,"library":"census","title":"Census API Wrapper","description":"A Python wrapper for the US Census Bureau's API, providing simple access to ACS, Decennial Census, and other datasets. Current version 0.8.26, with yearly updates for new data years.","status":"active","version":"0.8.26","language":"python","source_language":"en","source_url":"http://github.com/datamade/census","tags":["census","api","wrapper","data","demographics"],"install":[{"cmd":"pip install census","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP calls to Census API","package":"requests","optional":false},{"reason":"FIPS code validation","package":"us","optional":true}],"imports":[{"note":"Census is a class; direct import of module does not provide class.","wrong":"import census","symbol":"Census","correct":"from census import Census"}],"quickstart":{"code":"from census import Census\n\n# Get your API key from https://api.census.gov/data/key_signup.html\napi_key = os.environ.get('CENSUS_API_KEY', '')\nc = Census(api_key)\n\n# Fetch ACS5 2023 data for a state\nresult = c.acs5.state(('NAME', 'B01001_001E'), 'Illinois')\nprint(result)","lang":"python","description":"Initialize with API key, then call endpoint methods (e.g., acs5.state) with variables and location."},"warnings":[{"fix":"Check Census API documentation for available variables per dataset and year.","message":"Variable names come from Census API, not library; ensure you use valid codes (e.g., 'B01001_001E').","severity":"gotcha","affected_versions":"all"},{"fix":"Explicitly pass year parameter to ACS methods (e.g., .acs5.state(..., year=2023)).","message":"Support for ACS 1-year estimates may be dropped in future; always specify year to avoid surprises.","severity":"deprecated","affected_versions":">=0.8.19"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Set your Census API key before creating instance: c = Census('your_key_here')","cause":"Missing or empty API key string passed to Census constructor.","error":"NoAuthHandlerError: No API key provided"},{"fix":"Verify variable codes and geography parameters (e.g., state FIPS code) via Census API documentation.","cause":"Invalid variable code, year, or geography specification.","error":"census.core.CensusUnavailable: 400 Client Error: Bad Request for url"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}