Package: censusviz
censusviz -- map Census dataThis package helps users more easily visualize maps using Census Population Estimate API and the Census Cartographic GeoJSON boundary files. It transforms GeoJSON files into easy to work with GeoPandas.GeoDataFrame and plot choropleth maps.How To InstallPlease install and import the censusviz package using the following commands.pip install censusvizAfter installing via pip, please import the package to use on your Python IDE.from censusviz import censusvizUsageFind Available Geo ParametersThelist_geoparamsfunction returns a table from the Census' Github telling users which GeoJSON files are available by Year and geography area type.Parameters (optional):year: A string value of the year you would like to recall. %Y. Optional and will return a subset of table if specified.censusviz.list_geoparams()

censusviz.list_geoparams(year = "2010")Return a Geopandas dataframeTheget_geocen_dffunction returns a geopandas.GeoDataFrame of Census cartographic files.Parameters:quality: a string value of the resolution of the GeoJSON file. The available resolutions are 20m, 5m, and 500k.year:  a string value of the year you would like to recall. %Y. Year availables: 1990, 2000, 2010, 2012-2019.area_type: a stringe value of the geography area value you would like to specify.censusviz.get_geocen_df(quality = "20m", year = "2010", area_type= "county")Return State IdentifiersTheget_state_idsfunction returns a pandas.DataFrame of state-related federal codes such as FIPS and USPS codes.Parameters:state_initials: a string value of the officially recognized state abbreviation.censusviz.get_state_ids(state_initials = "OR")

censusviz.get_state_ids(state_initials = "NY")Plot Cartographic shapesTheget_geocen_plotfunction returns a matplotlib.pyplot.plot of a specified cartographic area by year, area type and resolution quality.Parametersquality: a string value of the resolution of the GeoJSON file. The available resolutions are 20m, 5m, and 500k.year:  a string value of the year you would like to recall. %Y. Years available: 1990, 2000, 2010, 2012-2019.area_type: a string value of the geography area value you would like to specify.boundaries: a boolean value that if True returns only the outline/boundaries of the area specified and if false returns the whole area filled in.censusviz.get_geocen_plot(quality ="20m", year="2010", area_type="county", boundaries=False)Return Population Data with MapTheget_popfunction  returns a choropleth map in matplotlib.pyplot.plot format or a geopandas.GeoDataFrame of the U.S. population by year and geometric boundaries. It utilizes the U.S. Census Bureau Population Estimate API and the Census GeoJSON database on GitHub.Parametersapi_key: a private api key provided by the U.S. Census Bureau.https://www.census.gov/data/developers/data-sets/popest-popproj/popest.htmlyear:  a string value of the year you would like to recall. %Y. Year availables: 2015-2019.map: a boolean value that if True returns matplotlib.pyplot.plot of the area specified and if false returns a geopandas.GeoDataFrame of the same values.censusviz.get_pop(api_key = my_api_key, year="2018", map = False)

censusviz.get_pop(api_key = my_api_key, year="2019", map = True)Return Population Data with Map (By Region)Theget_region_popfunction function returns a choropleth map in matplotlib.pyplot.plot format or a geopandas.GeoDataFrame of the U.S. population by year and region. It utilizes the U.S. Census Bureau Population Estimate API and the Census GeoJSON database on GitHub.Parametersapi_key: a private api key provided by the U.S. Census Bureau.https://www.census.gov/data/developers/data-sets/popest-popproj/popest.htmlyear:  a string value of the year you would like to recall. %Y. Year availables: 2018-2019.map: a boolean value that if True returns matplotlib.pyplot.plot of the area specified and if false returns a geopandas.GeoDataFrame for the same values.censusviz.get_region_pop(api_key = my_api_key, year="2016", map = False)

censusviz.get_region_pop(api_key = my_api_key, year="2019", map = True)Return Population Data with Map (By State)Theget_state_popfunction returns a choropleth map in matplotlib.pyplot.plot format or a geopandas.GeoDataFrame of the U.S. population by year and state. It utlizes the U.S. Census Bureau Population Estimate API and the Census GeoJSON database on GitHub.Parametersapi_key: a private api key provided by the U.S. Census Bureau.https://www.census.gov/data/developers/data-sets/popest-popproj/popest.htmlyear:  a string value of the year you would like to recall. %Y. Year availables: 2018-2019.state_fip: a string value of the state Federal Information Processing Standard state code.map: a boolean value that if True returns matplotlib.pyplot.plot of the area specified and if false returns a geopandas.GeoDataFrame for the same values.censusviz.get_state_pop(api_key = my_api_key, year="2016", state_fip = "15", map = False)

censusviz.get_state_pop(api_key = my_api_key, year="2019", state_fip = "29", map = True)Return Housing Unit Estimation Data with MapTheget_house_estreturns a choropleth map in matplotlib.pyplot.plot format or a geopandas.GeoDataFrame of the U.S. housing estimates by year. It utlizes the U.S. Census Bureau Housing Unit Estimate API and the Census GeoJSON database on GitHub.Parametersapi_key: a private api key provided by the U.S. Census Bureau.https://www.census.gov/data/developers/data-sets/popest-popproj/popest.htmlyear:  a string value of the year you would like to recall. %Y. Year availables: 2018-2019.map: a boolean value that if True returns matplotlib.pyplot.plot of the area specified and if false returns a geopandas.GeoDataFrame for the same values.censusviz.get_house_est(api_key = my_api_key, year="2018", map = False)

censusviz.get_house_est(api_key = my_api_key, year="2019", map = True)Dependenciespython = "^3.6"pandaspyprojrequestsnumpyshapelygdal =Wheels for Windows Userfiona =Wheels for Windows UsergeopandasmatplotlibdescarteslxmlDocumentationThe official documentation is hosted on Read the Docs:https://censusviz.readthedocs.io/en/latest/ContributorsWe welcome and recognize all contributions. You can see a list of current contributors in thecontributors tab.CreditsThis package was created with Cookiecutter and the UBC-MDS/cookiecutter-ubc-mds project template, modified from thepyOpenSci/cookiecutter-pyopensciproject template and theaudreyr/cookiecutter-pypackage.