Inspiration

In the United States, there have been frequent occurrences of wild fires and other natural events that have lead to a decrease in air quality. In some locations, the air quality is so hazardous that long exposure will cause health issues. As a result, we wanted to make a project that could visualize the air quality in the United States and alert the user of the air quality given their location.The team experimented with various different APIs until we finally decided to do a visual representation of a graph of the air quality index (AQI) for a set of zip codes. We finally implemented a text-to-user feature where one can receive texts of the air quality.

What it does

Our project takes a set of random zip codes and displays them onto a map of the United States, with markers illustrating the region on the map, along with that region's zip code and the AQI for the current day. The map has a search feature that allows the user to search for a particular zip code too. Lastly, there is a text feature that can ask the user what their zip code is which the user can reply to and receive the API value for their region.

How we built it

We used Python in a collaborative version of Jupyter notebooks called DataLore. DataLore helped us collaborate over the internet because it had real-time editing capabilities. Additionally, we used Google Colab. To get our datasets, we used various libraries and APIs. To grab data for the AQI of each zip code, we used the AirNow API. We used Folium and Pandas to be able to create data frames to implement into our map. The map was created using folium. There is a zip code function that outputs an AQI value for a particular zip code. Additionally, we have a for loop that runs through many zip codes and calls the function on those individual zip codes.

Challenges I ran into

Formatting our data was challenging. The data from the API could return strings or integers, depending on what method we called from it. Many zip codes either had no values or "NaN" values that we had to delete. Finding a way to correctly find the zip codes and display them onto the map was challenging because folium uses latitude and longitude. As a result, we had to find the latitude and longitude for the different zip codes and add those values into the data frame. We also had trouble selecting an API that would be suitable for grabbing the data that we wanted or required. The search feature was tough to implement because we could not find many examples on how to implement the feature. Lastly, the text feature took a very long time to implement because there are many exceptions and correctly writing the code was difficult without much trial and error and debugging. Reading the user input and responding to it required additional code.

Accomplishments that I'm proud of

We found appropriate APIs and correctly extrapolated data from it while applying data manipulation. The main API we used was an API from Air Now, a website that tracks the air quality of different locations in the United States. Two out of three of the members primarily use Java, and one member barely had experience in Python, so working with Python extensively allowed all of us to practice our Python ability. Formatting data frames was a challenge, but correctly finding the zip codes, finding the AQI values for each zip code, and finally plotting the values on the map was something we were all proud of accomplishing. Lastly, getting the text-to-user feature to work was very time consuming and required a lot of debugging. Finally implementing the feature was a huge accomplishment.

What I learned

The biggest thing we learned was dedication. Coming across failures and obstacles that we thought were impossible to overcome was common, and often times, we felt like ditching some ideas. However, through trial and error and patience, we were able to implement everything we wanted. We learned how to access APIs and find information that we needed for our data frames. We learned how to create data frames and format it correctly. We learned how to use the folium library to visualize data and display markers for different zip codes. Lastly, we learned how we could use Python to send and receive text messages from the user and correctly use it for our purposes.

What's next for the Air Quality Data Visualizer

We can refine the search feature to search for more values in the map. The text-to-user function can also be improved as it requires a lot of work to send texts to the user and can result in errors if one does not properly run through the procedure correctly.

Built With

Share this project:

Updates

Submission history