Search Demographics Example

This example shows some error handling

python3 search_demographics.py
Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 1
County name (or prefix)? Cas

================================================================================
|          County |  State |   Ed-HS|   H-Own%|  # House | Pop-2020 | Pop. PSQM|
--------------------------------------------------------------------------------
|  Cascade County |     MT |   91.8 |     64.4|    34329 |    84414 |        30|
|    Casey County |     KY |   76.0 |     77.3|     6099 |    15941 |        35|
|     Cass County |     IA |   88.0 |     69.2|     5921 |    13127 |        24|
|     Cass County |     IL |   84.0 |     74.6|     5043 |    13042 |        36|
|     Cass County |     IN |   85.4 |     74.0|    14688 |    37870 |        94|
|     Cass County |     MI |   87.7 |     80.0|    21019 |    51589 |       106|
|     Cass County |     MN |   92.2 |     81.5|    13164 |    30066 |        14|
|     Cass County |     MO |   92.4 |     76.5|    39770 |   107824 |       142|
|     Cass County |     ND |   94.8 |     52.1|    75843 |   184525 |        84|
|     Cass County |     NE |   94.4 |     81.7|     9945 |    26598 |        45|
|     Cass County |     TX |   85.9 |     79.3|    11934 |    28454 |        32|
|   Cassia County |     ID |   83.6 |     70.3|     7711 |    24655 |         8|
|   Castro County |     TX |   74.1 |     64.5|     2532 |     7371 |         9|
|  Caswell County |     NC |   80.4 |     76.4|     9145 |    22736 |        55|
--------------------------------------------------------------------------------

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 2
State name (or prefix)? V

================================================================================
|          County |  State |   Ed-HS|   H-Own%|  # House | Pop-2020 | Pop. PSQM|
--------------------------------------------------------------------------------
| Accomack County |     VA |   81.5 |     66.8|    13438 |    33413 |        73|
|  Addison County |     VT |   93.5 |     76.0|    14584 |    37363 |        48|
| Albemarle Count |     VA |   92.1 |     63.3|    41496 |   112395 |       137|
| Alexandria city |     VA |   93.0 |     43.3|    70598 |   159467 |      9314|
| Alleghany Count |     VA |   86.0 |     76.2|     6600 |    15223 |        36|
|   Amelia County |     VA |   83.9 |     84.4|     4954 |    13265 |        35|
|  Amherst County |     VA |   85.6 |     77.1|    12160 |    31307 |        68|
| Appomattox Coun |     VA |   85.9 |     77.8|     6091 |    16119 |        44|
| Arlington Count |     VA |   94.3 |     42.7|   107032 |   238643 |      7993|
|  Augusta County |     VA |   87.4 |     79.3|    29539 |    77487 |        76|
|     Bath County |     VA |   90.3 |     75.3|     1801 |     4209 |         8|
|  Bedford County |     VA |   90.0 |     82.1|    31317 |    79462 |        91|
| Bennington Coun |     VT |   91.2 |     74.0|    14581 |    37347 |        55|
|    Bland County |     VA |   88.6 |     81.4|     2367 |     6270 |        19|
| Botetourt Count |     VA |   92.8 |     86.3|    13264 |    33596 |        61|
|    Bristol city |     VA |   84.7 |     60.4|     7334 |    17219 |      1370|
| Brunswick Count |     VA |   78.5 |     70.7|     6037 |    15849 |        30|
| Buchanan County |     VA |   70.1 |     77.3|     8569 |    20355 |        47|
| Buckingham Coun |     VA |   79.8 |     75.2|     5826 |    16824 |        29|
| Buena Vista cit |     VA |   81.1 |     68.0|     2517 |     6641 |       992|
| Caledonia Count |     VT |   91.3 |     73.1|    12434 |    30233 |        48|
| Campbell County |     VA |   87.2 |     74.7|    23071 |    55696 |       108|
| Caroline County |     VA |   85.1 |     79.2|    10946 |    30887 |        54|
|  Carroll County |     VA |   80.8 |     78.3|    12357 |    29155 |        63|
| Charles City Co |     VA |   79.7 |     83.9|     2896 |     6773 |        39|
| Charlotte Count |     VA |   83.2 |     71.3|     4661 |    11529 |        26|
| Charlottesville |     VA |   91.1 |     42.8|    18617 |    46553 |      4246|
| Chesapeake city |     VA |   92.1 |     71.4|    84849 |   249422 |       652|
| Chesterfield Co |     VA |   92.3 |     75.8|   124971 |   364548 |       747|
| Chittenden Coun |     VT |   94.4 |     62.4|    66160 |   168323 |       291|
|   Clarke County |     VA |   89.1 |     75.0|     5612 |    14783 |        79|
| Colonial Height |     VA |   91.5 |     62.9|     7036 |    18170 |      2315|
|  Covington city |     VA |   87.3 |     74.5|     2384 |     5737 |      1090|
|    Craig County |     VA |   90.8 |     76.4|     2297 |     4892 |        15|
| Culpeper County |     VA |   86.1 |     72.7|    17071 |    52552 |       123|
| Cumberland Coun |     VA |   83.5 |     73.9|     3975 |     9675 |        33|
|   Danville city |     VA |   81.8 |     51.5|    18293 |    42590 |      1002|
| Dickenson Count |     VA |   77.4 |     75.7|     5778 |    14124 |        48|
| Dinwiddie Count |     VA |   83.2 |     77.2|    10401 |    27947 |        55|
|    Emporia city |     VA |   79.4 |     40.1|     2086 |     5766 |       859|
|    Essex County |     VA |   82.3 |     67.1|     4555 |    10599 |        43|
|    Essex County |     VT |   86.8 |     81.2|     2740 |     5920 |         9|
|  Fairfax County |     VA |   92.5 |     68.0|   396501 |  1150309 |      2766|
|    Fairfax city |     VA |   94.0 |     70.0|     8577 |    24146 |      3616|
| Falls Church ci |     VA |   98.9 |     58.3|     5493 |    14658 |      6169|
| Fauquier County |     VA |   92.5 |     78.3|    24562 |    72972 |       100|
|    Floyd County |     VA |   87.0 |     81.1|     6493 |    15476 |        40|
| Fluvanna County |     VA |   91.1 |     85.0|     9923 |    27249 |        89|
| Franklin County |     VA |   88.1 |     81.7|    22997 |    54477 |        81|
| Franklin County |     VT |   90.7 |     75.4|    18563 |    49946 |        75|
|   Franklin city |     VA |   86.3 |     51.6|     3522 |     8180 |      1045|
| Frederick Count |     VA |   89.2 |     77.6|    31503 |    91419 |       189|
| Fredericksburg  |     VA |   90.2 |     35.5|    10762 |    27982 |      2326|
|      Galax city |     VA |   75.7 |     68.1|     2663 |     6720 |       854|
|    Giles County |     VA |   88.9 |     75.1|     6910 |    16787 |        48|
| Gloucester Coun |     VA |   89.6 |     78.2|    14786 |    38711 |       169|
| Goochland Count |     VA |   91.4 |     84.9|     8506 |    24727 |        77|
| Grand Isle Coun |     VT |   92.9 |     84.0|     2956 |     7293 |        85|
|  Grayson County |     VA |   81.3 |     81.3|     6498 |    15333 |        35|
|   Greene County |     VA |   86.1 |     77.6|     7548 |    20552 |       117|
| Greensville Cou |     VA |   77.8 |     73.3|     3647 |    11391 |        41|
|  Halifax County |     VA |   81.5 |     74.1|    14158 |    34022 |        44|
|    Hampton city |     VA |   91.4 |     55.7|    54050 |   137148 |      2673|
|  Hanover County |     VA |   93.1 |     82.5|    38987 |   109979 |       213|
| Harrisonburg ci |     VA |   83.9 |     39.6|    16723 |    51814 |      2808|
|  Henrico County |     VA |   91.7 |     62.7|   128464 |   334389 |      1313|
|    Henry County |     VA |   80.1 |     71.9|    21218 |    50948 |       141|
| Highland County |     VA |   88.5 |     82.9|     1078 |     2232 |         5|
|   Hopewell city |     VA |   81.3 |     46.7|     9224 |    23033 |      2197|
| Isle of Wight C |     VA |   87.9 |     75.8|    14587 |    38606 |       111|
| James City Coun |     VA |   95.1 |     76.4|    28920 |    78254 |       470|
| King George Cou |     VA |   93.3 |     78.8|     9202 |    26723 |       131|
| King William Co |     VA |   92.1 |     87.4|     6078 |    17810 |        58|
| King and Queen  |     VA |   88.1 |     83.5|     2707 |     6608 |        22|
| Lamoille County |     VT |   92.8 |     73.2|    10546 |    25945 |        53|
| Lancaster Count |     VA |   90.4 |     75.9|     5062 |    10919 |        85|
|      Lee County |     VA |   76.7 |     70.8|     9149 |    22173 |        58|
|  Lexington city |     VA |   91.4 |     52.4|     2158 |     7320 |      2820|
|  Loudoun County |     VA |   93.9 |     78.0|   128637 |   420959 |       605|
|   Louisa County |     VA |   85.2 |     80.0|    13871 |    37596 |        66|
| Lunenburg Count |     VA |   77.8 |     71.8|     4293 |    11936 |        29|
|  Lynchburg city |     VA |   88.7 |     48.7|    28273 |    79009 |      1538|
|  Madison County |     VA |   86.1 |     74.5|     4949 |    13837 |        41|
| Manassas Park c |     VA |   82.7 |     65.9|     4641 |    17219 |      5633|
|   Manassas city |     VA |   82.7 |     66.1|    12898 |    42772 |      3827|
| Martinsville ci |     VA |   82.8 |     55.9|     5532 |    13485 |      1261|
|  Mathews County |     VA |   90.5 |     85.0|     3920 |     8533 |       104|
| Mecklenburg Cou |     VA |   81.9 |     71.1|    12075 |    30319 |        52|
| Middlesex Count |     VA |   87.1 |     78.7|     4603 |    10625 |        84|
| Montgomery Coun |     VA |   93.2 |     55.4|    35685 |    99721 |       243|
|   Nelson County |     VA |   85.7 |     76.4|     6419 |    14775 |        31|
| New Kent County |     VA |   92.7 |     86.5|     7961 |    22945 |        87|
| Newport News ci |     VA |   91.0 |     48.9|    69835 |   186247 |      2630|
|    Norfolk city |     VA |   88.0 |     43.4|    88353 |   238005 |      4486|
| Northampton Cou |     VA |   82.5 |     65.2|     5148 |    12282 |        58|
| Northumberland  |     VA |   91.0 |     89.2|     5584 |    11839 |        64|
|     Norton city |     VA |   84.0 |     50.1|     1628 |     3687 |       529|
| Nottoway County |     VA |   79.7 |     64.7|     5446 |    15642 |        50|
|   Orange County |     VA |   88.7 |     78.8|    13679 |    36254 |        98|
|   Orange County |     VT |   91.8 |     80.5|    12279 |    29277 |        42|
|  Orleans County |     VT |   88.3 |     78.2|    11779 |    27393 |        39|
|     Page County |     VA |   82.6 |     71.1|     9286 |    23709 |        77|
|  Patrick County |     VA |   80.2 |     79.0|     7755 |    17608 |        38|
| Petersburg city |     VA |   82.8 |     38.8|    13165 |    33458 |      1413|
| Pittsylvania Co |     VA |   82.7 |     75.4|    26267 |    60501 |        65|
|   Poquoson city |     VA |   94.9 |     81.4|     4593 |    12460 |       793|
| Portsmouth city |     VA |   88.3 |     55.0|    36370 |    97915 |      2838|
| Powhatan County |     VA |   89.9 |     90.1|    10265 |    30333 |       107|
| Prince Edward C |     VA |   86.0 |     64.4|     7185 |    21849 |        66|
| Prince George C |     VA |   90.6 |     67.6|    11507 |    43010 |       134|
| Prince William  |     VA |   88.5 |     73.3|   142000 |   482204 |      1195|
|  Pulaski County |     VA |   87.4 |     71.4|    14533 |    33800 |       109|
|    Radford city |     VA |   91.2 |     46.6|     5573 |    16070 |      1662|
| Rappahannock Co |     VA |   88.4 |     74.2|     2913 |     7348 |        27|
| Richmond County |     VA |   80.6 |     69.9|     3069 |     8923 |        48|
|   Richmond city |     VA |   85.4 |     42.6|    90301 |   226610 |      3414|
|  Roanoke County |     VA |   92.3 |     74.8|    38222 |    96929 |       368|
|    Roanoke city |     VA |   86.2 |     51.5|    41740 |   100011 |      2279|
| Rockbridge Coun |     VA |   86.8 |     75.2|     9248 |    22650 |        37|
| Rockingham Coun |     VA |   84.0 |     74.5|    30994 |    83757 |        89|
|  Russell County |     VA |   80.3 |     76.1|    10812 |    25781 |        61|
|  Rutland County |     VT |   92.6 |     71.4|    25338 |    60572 |        66|
|      Salem city |     VA |   89.2 |     63.6|     9912 |    25346 |      1718|
|    Scott County |     VA |   81.4 |     77.4|     8773 |    21576 |        43|
| Shenandoah Coun |     VA |   87.0 |     70.9|    17402 |    44186 |        82|
|    Smyth County |     VA |   83.3 |     71.5|    12686 |    29800 |        71|
| Southampton Cou |     VA |   84.8 |     74.8|     6562 |    17996 |        31|
| Spotsylvania Co |     VA |   91.2 |     78.1|    44436 |   140032 |       304|
| Stafford County |     VA |   93.2 |     77.4|    47075 |   156927 |       479|
|   Staunton city |     VA |   89.7 |     57.3|    10597 |    25750 |      1188|
|    Suffolk city |     VA |   89.9 |     68.7|    33774 |    94324 |       211|
|    Surry County |     VA |   85.0 |     74.3|     2730 |     6561 |        25|
|   Sussex County |     VA |   80.3 |     69.2|     3794 |    10829 |        24|
| Tazewell County |     VA |   81.7 |     74.5|    16531 |    40429 |        86|
| Virginia Beach  |     VA |   93.5 |     63.7|   170798 |   459470 |      1758|
|   Warren County |     VA |   86.9 |     76.7|    14651 |    40727 |       176|
| Washington Coun |     VA |   85.7 |     75.2|    22321 |    53935 |        97|
| Washington Coun |     VT |   93.7 |     70.4|    24828 |    59807 |        86|
| Waynesboro city |     VA |   86.1 |     57.7|     9193 |    22196 |      1396|
| Westmoreland Co |     VA |   84.5 |     73.2|     7923 |    18477 |        76|
| Williamsburg ci |     VA |   94.7 |     49.3|     4706 |    15425 |      1559|
| Winchester city |     VA |   84.1 |     44.3|    10490 |    28120 |      2838|
|  Windham County |     VT |   92.4 |     67.3|    18943 |    45905 |        56|
|  Windsor County |     VT |   93.4 |     73.8|    24298 |    57753 |        58|
|     Wise County |     VA |   75.9 |     66.6|    14925 |    36130 |       102|
|    Wythe County |     VA |   86.2 |     78.0|    11983 |    28290 |        63|
|     York County |     VA |   94.7 |     71.3|    25103 |    70045 |       624|
--------------------------------------------------------------------------------

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 3
Minimum population? 1000000

================================================================================
|          County |  State |   Ed-HS|   H-Own%|  # House | Pop-2020 | Pop. PSQM|
--------------------------------------------------------------------------------
|  Alameda County |     CA |   88.4 |     53.5|   577177 |  1682353 |      2043|
| Allegheny Count |     PA |   94.6 |     64.3|   541541 |  1250578 |      1675|
|    Bexar County |     TX |   84.2 |     58.5|   636245 |  2009324 |      1383|
|    Bronx County |     NY |   72.8 |     19.7|   503829 |  1472654 |     32903|
|  Broward County |     FL |   89.0 |     62.1|   690050 |  1944375 |      1444|
|    Clark County |     NV |   86.1 |     53.8|   783524 |  2265461 |       247|
|   Collin County |     TX |   93.8 |     65.0|   341163 |  1064465 |       930|
| Contra Costa Co |     CA |   89.5 |     65.9|   394769 |  1165927 |      1465|
|     Cook County |     IL |   87.1 |     56.9|  1972108 |  5275541 |      5495|
| Cuyahoga County |     OH |   89.8 |     58.2|   540965 |  1264817 |      2800|
|   Dallas County |     TX |   79.3 |     50.0|   928341 |  2613539 |      2718|
|  Fairfax County |     VA |   92.5 |     68.0|   396501 |  1150309 |      2766|
| Franklin County |     OH |   91.2 |     53.4|   511447 |  1323807 |      2186|
|   Fresno County |     CA |   76.0 |     53.3|   307906 |  1008654 |       156|
|   Fulton County |     GA |   92.6 |     51.6|   410576 |  1066710 |      1748|
|   Harris County |     TX |   81.4 |     54.6|  1605368 |  4731145 |      2402|
| Hennepin County |     MN |   93.3 |     62.4|   508030 |  1281565 |      2081|
| Hillsborough Co |     FL |   88.7 |     58.6|   526175 |  1459762 |      1204|
| Honolulu County |     HI |   91.9 |     56.2|   312795 |  1016508 |      1586|
|     King County |     WA |   93.1 |     56.9|   882028 |  2269675 |       912|
|    Kings County |     NY |   82.4 |     30.1|   958567 |  2736074 |     35369|
| Los Angeles Cou |     CA |   79.1 |     45.8|  3316795 | 10014009 |      2419|
| Maricopa County |     AZ |   87.7 |     62.2|  1552096 |  4420568 |       414|
| Mecklenburg Cou |     NC |   90.3 |     56.4|   411097 |  1115482 |      1755|
| Miami-Dade Coun |     FL |   81.4 |     51.2|   883372 |  2701767 |      1315|
| Middlesex Count |     MA |   93.4 |     62.4|   604384 |  1632002 |      1837|
| Montgomery Coun |     MD |   91.0 |     65.4|   370950 |  1062061 |      1978|
|   Nassau County |     NY |   91.4 |     80.7|   446977 |  1395774 |      4704|
| New York County |     NY |   87.3 |     24.1|   759460 |  1694251 |     69467|
|  Oakland County |     MI |   94.1 |     71.0|   504585 |  1274395 |      1385|
|   Orange County |     CA |   85.5 |     57.4|  1037492 |  3186989 |      3807|
|   Orange County |     FL |   88.5 |     55.4|   461705 |  1429908 |      1268|
| Palm Beach Coun |     FL |   88.5 |     68.9|   554095 |  1492191 |       670|
| Philadelphia Co |     PA |   84.7 |     53.0|   601337 |  1603797 |     11379|
|     Pima County |     AZ |   88.4 |     63.2|   404739 |  1043433 |       106|
|   Queens County |     NY |   82.0 |     44.8|   778932 |  2405464 |     20553|
| Riverside Count |     CA |   82.0 |     66.3|   724893 |  2418185 |       303|
| Sacramento Coun |     CA |   87.7 |     56.4|   543025 |  1585055 |      1470|
| Salt Lake Count |     UT |   90.8 |     67.1|   374820 |  1185238 |      1387|
| San Bernardino  |     CA |   80.0 |     59.8|   636041 |  2181654 |       101|
| San Diego Count |     CA |   87.4 |     53.3|  1125286 |  3298634 |       735|
| Santa Clara Cou |     CA |   88.4 |     56.4|   640215 |  1936259 |      1381|
| St. Louis Count |     MO |   93.5 |     68.6|   405984 |  1004125 |      1967|
|  Suffolk County |     NY |   90.6 |     80.6|   489301 |  1525920 |      1637|
|  Tarrant County |     TX |   86.1 |     60.5|   708252 |  2110640 |      2094|
|   Travis County |     TX |   89.3 |     52.4|   472361 |  1290188 |      1034|
|     Wake County |     NC |   93.0 |     63.9|   400172 |  1129410 |      1078|
|    Wayne County |     MI |   86.5 |     62.0|   682282 |  1793561 |      2974|
| Westchester Cou |     NY |   88.1 |     61.4|   349292 |  1004457 |      2204|
--------------------------------------------------------------------------------

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 0

Goodbye!