Skip to content

Commit e3df949

Browse files
Merge pull request #151 from cooperjaXC/staging
Add support for 2023 ACS Data
2 parents dd8b5b5 + 513b726 commit e3df949

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ Datasets
6767

6868
For each dataset, the first year listed is the default.
6969

70-
* acs5: `ACS 5 Year Estimates <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
70+
* acs5: `ACS 5 Year Estimates <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
7171
* acs3: `ACS 3 Year Estimates <https://www.census.gov/data/developers/data-sets/acs-3year.html>`_ (2013, 2012)
72-
* acs1: `ACS 1 Year Estimates <https://www.census.gov/data/developers/data-sets/acs-1year.html>`_ (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
73-
* acs5dp: `ACS 5 Year Estimates, Data Profiles <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
72+
* acs1: `ACS 1 Year Estimates <https://www.census.gov/data/developers/data-sets/acs-1year.html>`_ (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
73+
* acs5dp: `ACS 5 Year Estimates, Data Profiles <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
7474
* acs3dp: `ACS 3 Year Estimates, Data Profiles <https://www.census.gov/data/developers/data-sets/acs-3year.html>`_ (2013, 2012)
75-
* acs1dp: `ACS 1 Year Estimates, Data Profiles <https://www.census.gov/data/developers/data-sets/acs-1year.html>`_ (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
76-
* acs5st: `ACS 5 Year Estimates, Subject Tables <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
75+
* acs1dp: `ACS 1 Year Estimates, Data Profiles <https://www.census.gov/data/developers/data-sets/acs-1year.html>`_ (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
76+
* acs5st: `ACS 5 Year Estimates, Subject Tables <https://www.census.gov/data/developers/data-sets/acs-5year.html>`_ (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
7777
* sf1: `Census Summary File 1 <https://www.census.gov/data/datasets/2010/dec/summary-file-1.html>`_ (2010)
7878
* pl: `Redistricting Data Summary File <https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.2020.html>`_ (2020, 2010, 2000)
7979

census/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ def get(self, *args, **kwargs):
327327

328328
class ACS5Client(ACSClient):
329329

330-
default_year = 2022
330+
default_year = 2023
331331
dataset = 'acs5'
332332

333-
years = (2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
333+
years = (2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009)
334334

335335
@supported_years()
336336
def state_county_subdivision(self, fields, state_fips,
@@ -359,7 +359,7 @@ def state_county_blockgroup(self, fields, state_fips, county_fips,
359359
geo['in'] += ' tract:{}'.format(tract)
360360
return self.get(fields, geo=geo, **kwargs)
361361

362-
@supported_years(2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
362+
@supported_years(2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
363363
def zipcode(self, fields, zcta, **kwargs):
364364
warnings.warn(
365365
"zipcode has been deprecated; use state_zipcode instead",
@@ -370,7 +370,7 @@ def zipcode(self, fields, zcta, **kwargs):
370370

371371
return self.state_zipcode(fields, state_fips, zcta, **kwargs)
372372

373-
@supported_years(2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
373+
@supported_years(2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
374374
def state_zipcode(self, fields, state_fips, zcta, **kwargs):
375375
year = kwargs.get('year', self.default_year)
376376
geo = {
@@ -422,10 +422,10 @@ class ACS3DpClient(ACS3Client):
422422

423423
class ACS1Client(ACSClient):
424424

425-
default_year = 2022
425+
default_year = 2023
426426
dataset = 'acs1'
427427

428-
years = (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005)
428+
years = (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005)
429429

430430
@supported_years()
431431
def state_county_subdivision(self, fields, state_fips,
@@ -440,7 +440,7 @@ class ACS1DpClient(ACS1Client):
440440

441441
dataset = 'acs1/profile'
442442

443-
years = (2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012)
443+
years = (2023, 2022, 2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012)
444444

445445

446446
class SF1Client(Client):

census/tests/test_census.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,15 @@ def test_acs5(self):
166166
('Block Group 1; Census Tract 7007.06; '
167167
'Montgomery County; Maryland')),
168168
('state_place', 'Gaithersburg city, Maryland'),
169+
# 2022 and 2023 ACS5 API calls use legislative districts from 2022 as their geography
169170
('state_district',
170171
'Congressional District 6 (118th Congress), Maryland'),
171172
('state_congressional_district',
172173
'Congressional District 6 (118th Congress), Maryland'),
173174
('state_legislative_district_upper',
174-
'State Senate District 6 (2022), Maryland'),
175+
'State Senate District 6 (2022); Maryland'),
175176
('state_legislative_district_lower',
176-
'State Legislative District 6 (2022), Maryland'),
177+
'State Legislative District 6 (2022); Maryland'),
177178
('state_zipcode', 'ZCTA5 20877'),
178179
)
179180

0 commit comments

Comments
 (0)