In this SQLAlchemy project, i used Python and SQLAlchemy to do a basic climate analysis and data exploration of my climate database as the first part of my project. To receive the desired output in this part, i used SQLAlchemy ORM queries, Pandas, and Matplotlib.
PS: The comments throughout the projects are based on the project requirements which were as below:
-
Use the SQLAlchemy create_engine() function to connect to your SQLite database.
-
Use the SQLAlchemy automap_base() function to reflect your tables into classes, and then save references to the classes named station and measurement.
-
Link Python to the database by creating a SQLAlchemy session.
-
Perform a precipitation analysis and then a station analysis by completing the steps in the following two subsections.
-
Find the most recent date in the dataset.
-
Using that date, get the previous 12 months of precipitation data by querying the previous 12 months of data.
-
Load the query results into a Pandas DataFrame, and set the index to the "date" column.
-
Sort the DataFrame values by "date".
-
Plot the results by using the DataFrame plot method
The second part of the project was focused on creating an app using the developed code. The app is available on below copied link: http://127.0.0.1:5000/