Skip to content

Commit

Permalink
Merge pull request #132 from arturo-ramos/add_2021
Browse files Browse the repository at this point in the history
Adding 2021 to available years for ACS1Client and ACS5Client
  • Loading branch information
fgregg authored Jan 4, 2024
2 parents b3d7c18 + dceef8d commit 63445ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ Datasets

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

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

Expand Down
9 changes: 5 additions & 4 deletions census/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class Client(object):
groups_url = 'https://api.census.gov/data/%s/%s/groups.json'

def __init__(self, key, year=None, session=None, retries=3):
self.dataset = None
self._key = key
self.session = session or new_session()
if year:
Expand Down Expand Up @@ -292,7 +293,7 @@ class ACSClient(Client):

def _switch_endpoints(self, year):

if year > 2009:
if year >= 2005:
self.endpoint_url = 'https://api.census.gov/data/%s/acs/%s'
self.definitions_url = 'https://api.census.gov/data/%s/acs/%s/variables.json'
self.definition_url = 'https://api.census.gov/data/%s/acs/%s/variables/%s.json'
Expand Down Expand Up @@ -410,10 +411,10 @@ class ACS3DpClient(ACS3Client):

class ACS1Client(ACSClient):

default_year = 2019
default_year = 2021
dataset = 'acs1'

years = (2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011)
years = (2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005)

@supported_years()
def state_county_subdivision(self, fields, state_fips,
Expand All @@ -428,7 +429,7 @@ class ACS1DpClient(ACS1Client):

dataset = 'acs1/profile'

years = (2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012)
years = (2021, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012)


class SF1Client(Client):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requests>=2.31
pytest>=2.9

0 comments on commit 63445ba

Please sign in to comment.