How to use the censusdata.search function in CensusData

To help you get started, we’ve selected a few CensusData examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jtleider / censusdata / test / test_variable_info.py View on Github external
def test_unknown_tabletype(self):
		self.assertRaises(ValueError, censusdata.censusvar, 'acs5', 2015, ['B19013_001E', 'D19013_002E'])
		self.assertRaises(ValueError, censusdata.censustable, 'acs5', 2015, 'C19013')
		self.assertRaises(ValueError, censusdata.search, 'acs5', 2015, 'concept', 'unweighted sample', tabletype='cdetail')
github jtleider / censusdata / test / test_variable_info.py View on Github external
def test_search(self):
		self.assertEqual(censusdata.search('acs5', 2015, 'concept', 'unweighted sample'), [
		('B00001_001E', 'B00001.  Unweighted Sample Count of the Population', 'Total'),
		('B00001_001M', 'B00001.  Unweighted Sample Count of the Population', 'Margin Of Error For!!Total'),
		('B00002_001E', 'B00002.  Unweighted Sample Housing Units', 'Total'),
		('B00002_001M', 'B00002.  Unweighted Sample Housing Units', 'Margin Of Error For!!Total'),
		])
		s = censusdata.search('acs5', 2018, 'concept', 'SEX BY AGE')
		self.assertEqual(len(s), 2969)
		self.assertEqual(s[0], ('B01001A_001E', 'SEX BY AGE (WHITE ALONE)', 'Estimate!!Total'))
github jtleider / censusdata / test / test_variable_info.py View on Github external
def test_search(self):
		self.assertEqual(censusdata.search('acs5', 2015, 'concept', 'unweighted sample'), [
		('B00001_001E', 'B00001.  Unweighted Sample Count of the Population', 'Total'),
		('B00001_001M', 'B00001.  Unweighted Sample Count of the Population', 'Margin Of Error For!!Total'),
		('B00002_001E', 'B00002.  Unweighted Sample Housing Units', 'Total'),
		('B00002_001M', 'B00002.  Unweighted Sample Housing Units', 'Margin Of Error For!!Total'),
		])
		s = censusdata.search('acs5', 2018, 'concept', 'SEX BY AGE')
		self.assertEqual(len(s), 2969)
		self.assertEqual(s[0], ('B01001A_001E', 'SEX BY AGE (WHITE ALONE)', 'Estimate!!Total'))

CensusData

Download data from U.S. Census API

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Similar packages