Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return collapsed
class ACS5Client(census.core.ACS5Client, GeoClient):
@supported_years(2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010)
def state_place_tract(self, *args, **kwargs):
return self._state_place_area(self.geo_tract, *args, **kwargs)
@supported_years(2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010)
def state_place_blockgroup(self, *args, **kwargs):
return self._state_place_area(self.geo_blockgroup, *args, **kwargs)
class SF1Client(census.core.SF1Client, GeoClient):
@supported_years(2010, 2000, 1990)
def state_place_tract(self, *args, **kwargs):
return self._state_place_area(self.geo_tract, *args, **kwargs)
@supported_years(2010, 2000)
def state_place_blockgroup(self, *args, **kwargs):
return self._state_place_area(self.geo_blockgroup, *args, **kwargs)
@supported_years(2010, 2000)
def state_place_block(self, *args, **kwargs):
return self._state_place_area(self.geo_block, *args, **kwargs)
@supported_years(2010, 2000)
def geo_block(self, fields, geojson_geometry, year):
if year is None:
year = self.default_year
session = new_session()
self.session = session
self.session.headers.update({
'User-Agent': ('python-census/{} '.format(__version__) +
'github.com/datamade/census')
})
self._acs = ACS5Client(key, year, session) # deprecated
self.acs5 = ACS5Client(key, year, session)
self.acs3 = ACS3Client(key, year, session)
self.acs1 = ACS1Client(key, year, session)
self.acs5dp = ACS5DpClient(key, year, session)
self.acs3dp = ACS3DpClient(key, year, session)
self.acs1dp = ACS1DpClient(key, year, session)
self.sf1 = SF1Client(key, year, session)
self.sf3 = SF3Client(key, year, session)
def tables(self, *args, **kwargs):
self._switch_endpoints(kwargs.get('year', self.default_year))
return super(SF1Client, self).tables(*args, **kwargs)