{"id":22325684,"url":"https://github.com/w7negreiros/sqlalchemy_challenge_2024","last_synced_at":"2025-03-26T05:45:07.545Z","repository":{"id":238557138,"uuid":"796809268","full_name":"w7negreiros/sqlalchemy_challenge_2024","owner":"w7negreiros","description":"SQL Alchemy Challenge - UofT Data Analytics - Bootcamp","archived":false,"fork":false,"pushed_at":"2024-05-07T02:14:39.000Z","size":531,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T07:30:48.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w7negreiros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T17:09:12.000Z","updated_at":"2024-05-15T18:49:48.000Z","dependencies_parsed_at":"2024-12-04T02:13:21.810Z","dependency_job_id":"04749447-c6b1-4bd8-9788-d40a07459a30","html_url":"https://github.com/w7negreiros/sqlalchemy_challenge_2024","commit_stats":null,"previous_names":["w7negreiros/sqlalchemy_challenge_2024"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w7negreiros%2Fsqlalchemy_challenge_2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w7negreiros%2Fsqlalchemy_challenge_2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w7negreiros%2Fsqlalchemy_challenge_2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w7negreiros%2Fsqlalchemy_challenge_2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w7negreiros","download_url":"https://codeload.github.com/w7negreiros/sqlalchemy_challenge_2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598305,"owners_count":20641884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T02:13:11.568Z","updated_at":"2025-03-26T05:45:07.522Z","avatar_url":"https://github.com/w7negreiros.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlalchemy_challenge_2024\n\n# Instructions\nCongratulations! You've decided to treat yourself to a long holiday vacation in Honolulu, Hawaii. To help with your trip planning, you decide to do a climate analysis about the area. The following sections outline the steps that you need to take to accomplish this task.\n\n# Part 1: Analyze and Explore the Climate Data\n\nIn this section, you’ll use Python and SQLAlchemy to do a basic climate analysis and data exploration of your climate database. \nSpecifically, you’ll use SQLAlchemy ORM queries, Pandas, and Matplotlib. To do so, complete the following steps:\n\n1- Note that you’ll use the provided files (climate_starter.ipynb and hawaii.sqlite) to complete your climate analysis and data exploration.\n\n2- Use the SQLAlchemy create_engine() function to connect to your SQLite database.\n\n3- Use the SQLAlchemy automap_base() function to reflect your tables into classes, and then save references to the classes named station and measurement.\n\n4- Link Python to the database by creating a SQLAlchemy session.\n\n# IMPORTANT\nRemember to close your session at the end of your notebook.\n\n5- Perform a precipitation analysis and then a station analysis by completing the steps in the following two subsections.\n\n\n# Precipitation Analysis\n\n1- Find the most recent date in the dataset.\n\n2- Using that date, get the previous 12 months of precipitation data by querying the previous 12 months of data.\n\n3- Select only the \"date\" and \"prcp\" values.\n\n4- Load the query results into a Pandas DataFrame. Explicitly set the column names.\n\n5- Sort the DataFrame values by \"date\".\n\n6- Plot the results by using the DataFrame plot method, as the following image shows:\n\n\u003cimg src=\"https://static.bc-edx.com/data/dl-1-2/m10/lms/img/precipitation.jpg\" alt=\"A screenshot depicts the plot.\" tabindex=\"0\" role=\"button\" aria-label=\"A screenshot depicts the plot.. Click to Enlarge.\"\u003e\n\n7- Use Pandas to print the summary statistics for the precipitation data.\n\n\n# Station Analysis\n\n1- Design a query to calculate the total number of stations in the dataset.\n\n2- Design a query to find the most-active stations (that is, the stations that have the most rows). To do so, complete the following steps:\n\n* List the stations and observation counts in descending order.\n* Answer the following question: which station id has the greatest number of observations?\n\n3- Design a query that calculates the lowest, highest, and average temperatures that filters on the most-active station id found in the previous query.\n\n4- Design a query to get the previous 12 months of temperature observation (TOBS) data. To do so, complete the following steps:\n\n* Filter by the station that has the greatest number of observations.\n* Query the previous 12 months of TOBS data for that station.\n* Plot the results as a histogram with bins=12, as the following image shows:\n\n\u003cimg src=\"https://static.bc-edx.com/data/dl-1-2/m10/lms/img/station-histogram.jpg\" alt=\"A screenshot depicts the histogram.\" tabindex=\"0\"\u003e\n\n5- Close your session.\n\n\n# Part 2: Design Your Climate App\nNow that you’ve completed your initial analysis, you’ll design a Flask API based on the queries that you just developed. To do so, use Flask to create your routes as follows:\n\n1- /\n\n* Start at the homepage.\n* List all the available routes.\n\n2- /api/v1.0/precipitation\n\n* Convert the query results from your precipitation analysis (i.e. retrieve only the last 12 months of data) to a dictionary using date as the key and prcp as the value.\n* Return the JSON representation of your dictionary.\n\n3- /api/v1.0/stations\n\n* Return a JSON list of stations from the dataset.\n\n4- /api/v1.0/tobs\n\n* Query the dates and temperature observations of the most-active station for the previous year of data.\n* Return a JSON list of temperature observations for the previous year.\n\n5- /api/v1.0/\u003c'start'\u003e and /api/v1.0/\u003c'start'\u003e/\u003c'end'\u003e\n\n* Return a JSON list of the minimum temperature, the average temperature, and the maximum temperature for a specified start or start-end range.\n* For a specified start, calculate TMIN, TAVG, and TMAX for all the dates greater than or equal to the start date.\n* For a specified start date and end date, calculate TMIN, TAVG, and TMAX for the dates from the start date to the end date, inclusive.\n\n# Hints\n\n* Join the station and measurement tables for some of the queries.\n\n* Use the Flask jsonify function to convert your API data to a valid JSON response object.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw7negreiros%2Fsqlalchemy_challenge_2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw7negreiros%2Fsqlalchemy_challenge_2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw7negreiros%2Fsqlalchemy_challenge_2024/lists"}