[x] HIGH - Get the data that is supposed to be in the map (URLs, keys, etc.) [x] Make the data that is being extracted for the map to update progressively as the years come and take the data from the years before (check if there is a better method to do this than having to save the information to a csv file because it will take a lot of data as the years come) * One method is explained in the last two responses of ChatGPT [5].
* Make sure to check that the data for that year is available and THEN update the map according to that
- This might be able to be done with the following (provided by ChatGPT [5]):
```response = requests.get(base_url, params=params)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"Error {response.status_code}: {response.text}")```
* Make sure that for the step of updating according to the release date is scheduled according to the following website: https://www.census.gov/programs-surveys/acs/news/data-releases/2021/release-schedule.html
* Create a function that calls the createMap function according to the new updated data
[x] Make the map interactive so that it updates the map according to the data extracted from the last step [ ] HIGH - Pass the maps to Wordpress. More information about this on reference link [6] [ ] AFTER - Fix README.md to be readable in GitHub [x] LOW - Verify if .venv can be activated when the user runs the program from GitHub so that it can run smoothly [x] HIGH - Change the buttons of the Dash app to show the years of the map on the button-dropdown [x] HIGH - Change this to make the csv according to the year (e.g. '2023perPerSubCou') [x] Create collapse of data from total_calories [8] [ ] Personalize the toml files from Ouslam's branch [ ] DUMP - Remove the verifyFile() , cleaningData() from total_calories.py since a module for the same function was created [x] Use Render.com to deploy my website
Recommended by Ouslam:
- Read: 158 a 172 lines of https://github.com/ouslan/mov/blob/main/src/data/data_pull.py
- Note: The key in line 172 is not neccesary
Priority of tasks:
- LOW - Not required, but a preference
- HIGH - Must be done and it takes a lot of effort to complete
- AFTER - Task to be done after finishing the project
- DUMP - To reduce space
Personal notes: API User Guide [1] - Guidelines - Page 22 is to guide on use of UCGID - Page 16 includes instructions of the last step on how to handle the URL of the API
- Page 35-36 [2] contains information of all the common ACS API Variables
- Total population group name: P1_001N
- Reference [7] gave a lot of details about how to work with Dash when the image does not show.
- Other ways to host an app, other than Render.com:
- https://www.reddit.com/r/datascience/comments/rwrfmk/deploy_dash_app_for_free/
- https://www.pythonanywhere.com/
- Simply search up "how to host dash app for free"
- How to refresh the requirements.txt whenever a library is installed $ pip freeze > requirements.txt
- Have python 3.12.5+
- Install geopandas, mapclassify, requests, pandas, pathlib, plotly, shapely, plotly-geo*, pyshp*, dash, json, openpyxl, gunicorn, datetime, git, re
- Libraries with asterik were only installed for the Plotly map, which currently won't be used
- Use the following command in a new environment (e.g. .venv) to install all the dependencies listed in the file: $ pip install -r requirements.txt
$ .venv/Scripts/activate
- Run $ Set-ExecutionPolicy Unrestricted -Scope Process
Note: To run this code, it is recommended to install and activate .venv for a smoother run of the program
[1] https://www.census.gov/content/dam/Census/data/developers/api-user-guide/api-user-guide.pdf [2] https://www2.census.gov/about/training-workshops/2020/2020-07-22-cedsci-presentation.pdf [3] https://portal.nifa.usda.gov/web/crisprojectpages/1029124-food-security-and-agricultural-research-data-center.html [4] https://data.census.gov/table/ACSDP5Y2023.DP05?q=DP05:%20ACS%20Demographic%20and%20Housing%20Estimates&g=040XX00US72$0600000 [5] https://chatgpt.com/share/675f46fe-9334-8011-aba7-b02d3ffad84a (Chat named: Sorting GeoDataFrame Column) [6] https://chatgpt.com/share/675f4648-ca64-8011-8120-ee3d45e2ef63 (Chat named: Display Map from GitHub) [7] https://chatgpt.com/share/67630cf7-12b8-8011-a192-5ba70e7abe4c [8] https://outlook.office.com/mail/id/AAQkADg3ODZlNWM3LTM3ZTItNGUyOS05MDI1LTJmYTU4NGVlZTY4ZQAQAL81162xZvlEiasxtrIs%2F1w%3D [9] https://chatgpt.com/share/67708be0-61e0-8011-b2b8-771151339a7e (Chat named: Correccion de progreso)
Variable names that are being used for the population:
- B01001_003E Estimate!!Total:!!Male:!!Under 5 years
- B01001_004E Estimate!!Total:!!Male:!!5 to 9 years
- B01001_005E Estimate!!Total:!!Male:!!10 to 14 years
- B01001_006E Estimate!!Total:!!Male:!!15 to 17 years
- B01001_007E Estimate!!Total:!!Male:!!18 and 19 years
- B01001_008E Estimate!!Total:!!Male:!!20 years
- B01001_009E Estimate!!Total:!!Male:!!21 years
- B01001_010E Estimate!!Total:!!Male:!!22 to 24 years
- B01001_011E Estimate!!Total:!!Male:!!25 to 29 years
- B01001_012E Estimate!!Total:!!Male:!!30 to 34 years
- B01001_013E Estimate!!Total:!!Male:!!35 to 39 years
- B01001_014E Estimate!!Total:!!Male:!!40 to 44 years
- B01001_015E Estimate!!Total:!!Male:!!45 to 49 years
- B01001_016E Estimate!!Total:!!Male:!!50 to 54 years
- B01001_017E Estimate!!Total:!!Male:!!55 to 59 years
- B01001_018E Estimate!!Total:!!Male:!!60 and 61 years
- B01001_019E Estimate!!Total:!!Male:!!62 to 64 years
- B01001_020E Estimate!!Total:!!Male:!!65 and 66 years
- B01001_021E Estimate!!Total:!!Male:!!67 to 69 years
- B01001_022E Estimate!!Total:!!Male:!!70 to 74 years
- B01001_023E Estimate!!Total:!!Male:!!75 to 79 years
- B01001_024E Estimate!!Total:!!Male:!!80 to 84 years
- B01001_025E Estimate!!Total:!!Male:!!85 years and over
- B01001_027E Estimate!!Total:!!Female:!!Under 5 years
- B01001_028E Estimate!!Total:!!Female:!!5 to 9 years
- B01001_029E Estimate!!Total:!!Female:!!10 to 14 years
- B01001_030E Estimate!!Total:!!Female:!!15 to 17 years
- B01001_031E Estimate!!Total:!!Female:!!18 and 19 years
- B01001_032E Estimate!!Total:!!Female:!!20 years
- B01001_033E Estimate!!Total:!!Female:!!21 years
- B01001_034E Estimate!!Total:!!Female:!!22 to 24 years
- B01001_035E Estimate!!Total:!!Female:!!25 to 29 years
- B01001_036E Estimate!!Total:!!Female:!!30 to 34 years
- B01001_037E Estimate!!Total:!!Female:!!35 to 39 years
- B01001_038E Estimate!!Total:!!Female:!!40 to 44 years
- B01001_039E Estimate!!Total:!!Female:!!45 to 49 years
- B01001_040E Estimate!!Total:!!Female:!!50 to 54 years
- B01001_041E Estimate!!Total:!!Female:!!55 to 59 years
- B01001_042E Estimate!!Total:!!Female:!!60 and 61 years
- B01001_043E Estimate!!Total:!!Female:!!62 to 64 years
- B01001_044E Estimate!!Total:!!Female:!!65 and 66 years
- B01001_045E Estimate!!Total:!!Female:!!67 to 69 years
- B01001_046E Estimate!!Total:!!Female:!!70 to 74 years
- B01001_047E Estimate!!Total:!!Female:!!75 to 79 years
- B01001_048E Estimate!!Total:!!Female:!!80 to 84 years
- B01001_049E Estimate!!Total:!!Female:!!85 years and over
- DP05_0002PE Percent!!SEX AND AGE!!Total population!!Male
- DP05_0003PE Percent!!SEX AND AGE!!Total population!!Female
- DP03_0051E Estimate!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households
- DP03_0051PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households
- DP03_0052PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!Less than $10,000
- DP03_0053PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$10,000 to $14,999
- DP03_0054PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$15,000 to $24,999
- DP03_0055PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$25,000 to $34,999
- DP03_0056PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$35,000 to $49,999
- DP03_0057PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$50,000 to $74,999
- DP03_0058PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$75,000 to $99,999
- DP03_0059PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$100,000 to $149,999
- DP03_0060PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$150,000 to $199,999
- DP03_0061PE Percent!!INCOME AND BENEFITS (IN 2023 INFLATION-ADJUSTED DOLLARS)!!Total households!!$200,000 or more
.columns = returns df's columns .rows = returns df's rows
- if name == "main": This is used to prevent a code block from being executed when importing that code block's module to another module.
- This program creates the maps assuming that the data for the input year exists. If the CENSUS Beaureu does not create the data for that year, this program is sensitive to that, and it is a fault that has to be fixed.