{"id":24562678,"url":"https://github.com/wrighang/10_sqlalchemy-challenge","last_synced_at":"2025-10-09T17:05:41.878Z","repository":{"id":267024149,"uuid":"892722319","full_name":"wrighang/10_sqlalchemy-challenge","owner":"wrighang","description":"Module 10: Advanced Data Storage and Retrieval","archived":false,"fork":false,"pushed_at":"2025-01-04T18:58:39.000Z","size":389,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T17:05:41.052Z","etag":null,"topics":["apiendpoints","jsonify","python-classes","python-objects","query","sqlalchemy-orm","sqlalchemy-python"],"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/wrighang.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-22T16:44:31.000Z","updated_at":"2025-01-04T18:58:42.000Z","dependencies_parsed_at":"2024-12-07T19:27:41.714Z","dependency_job_id":"30dd59fa-2464-4c32-b2f9-77614a648c90","html_url":"https://github.com/wrighang/10_sqlalchemy-challenge","commit_stats":null,"previous_names":["wrighang/10_sqlalchemy-challenge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wrighang/10_sqlalchemy-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrighang%2F10_sqlalchemy-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrighang%2F10_sqlalchemy-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrighang%2F10_sqlalchemy-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrighang%2F10_sqlalchemy-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrighang","download_url":"https://codeload.github.com/wrighang/10_sqlalchemy-challenge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrighang%2F10_sqlalchemy-challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001890,"owners_count":26083197,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apiendpoints","jsonify","python-classes","python-objects","query","sqlalchemy-orm","sqlalchemy-python"],"created_at":"2025-01-23T09:16:57.930Z","updated_at":"2025-10-09T17:05:41.863Z","avatar_url":"https://github.com/wrighang.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 10_sqlalchemy-challenge\n\n# Deliverable(s)\n[Climate Analysis.ipynb](https://github.com/wrighang/10_sqlalchemy-challenge/blob/main/surfsup/climate_analysis.ipynb)\n\n[Climate App.py](https://github.com/wrighang/10_sqlalchemy-challenge/blob/main/surfsup/climate_app.py)\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 outlines the requirements for this assignment.\n\n## Requirements\n\n### Jupyter Notebook Database Connection\nTo receive full credit, you must:\n- Use the SQLAlchemy `create_engine()` function to connect to your SQLite database.\n- Use the SQLAlchemy `automap_base()` function to reflect your tables into classes.\n- Save references to the classes named `station` and `measurement`.\n- Link Python to the database by creating a SQLAlchemy session.\n- Close your session at the end of your notebook.\n\n### Precipitation Analysis\nTo receive full credit, you must:\n- Create a query that finds the most recent date in the dataset (`8/23/2017`).\n- Create a query that collects only the date and precipitation for the last year of data without passing the date as a variable.\n- Save the query results to a Pandas DataFrame to create `date` and `precipitation` columns.\n- Sort the DataFrame by date.\n- Plot the results by using the DataFrame plot method with `date` as the x and `precipitation` as the y variables.\n- Use Pandas to print the summary statistics for the precipitation data.\n\n### Station Analysis\nTo receive full credit, you must:\n- Design a query that correctly finds the number of stations in the dataset.\n- Design a query that correctly lists the stations and observation counts in descending order and finds the most active station (`USC00519281`).\n- Design a query that correctly finds the min, max, and average temperatures for the most active station (`USC00519281`).\n- Design a query to get the previous 12 months of temperature observation (`TOBS`) data that filters by the station that has the greatest number of observations.\n- Save the query results to a Pandas DataFrame.\n- Correctly plot a histogram with `bins=12` for the last year of data using `tobs` as the column to count.\n\n### API SQLite Connection \u0026 Landing Page\nTo receive full credit, your Flask application must:\n- Correctly generate the engine to the correct sqlite file.\n- Use `automap_base()` and reflect the database schema.\n- Correctly save references to the tables in the sqlite file (`measurement` and `station`).\n- Correctly create and bind the session between the Python app and database.\n- Display the available routes on the landing page.\n\n### API Static Routes\nTo receive full credit, your Flask application must include:\n- A precipitation route that:\n  - Returns JSON with the date as the key and the value as the precipitation.\n  - Only returns the JSONified precipitation data for the last year in the database.\n- A stations route that:\n  - Returns JSONified data of all of the stations in the database.\n- A tobs route that:\n  - Returns JSONified data for the most active station (`USC00519281`).\n  - Only returns the JSONified data for the last year of data.\n\n### API Dynamic Route\nTo receive full credit, your Flask application must include:\n- A start route that:\n  - Accepts the start date as a parameter from the URL.\n  - Returns the min, max, and average temperatures calculated from the given start date to the end of the dataset.\n- A start/end route that:\n  - Accepts the start and end dates as parameters from the URL.\n  - Returns the min, max, and average temperatures calculated from the given start date to the given end date.\n\n### Coding Conventions and Formatting\nTo receive full credit, your code must:\n- Place imports at the top of the file, just after any module comments and docstrings, and before module globals and constants.\n- Name functions and variables with lowercase characters, with words separated by underscores.\n- Follow DRY (Don't Repeat Yourself) principles, creating maintainable and reusable code.\n- Use concise logic and creative engineering where possible.\n\n### Deployment and Submission\nTo receive full credit, you must:\n- Submit a link to a GitHub repository that’s cloned to your local machine and contains your files.\n- Use the command line to add your files to the repository.\n- Include appropriate commit messages in your files.\n\n### Comments\nTo receive full credit, your code must:\n- Be well commented with concise, relevant notes that other developers can understand.\n\n====================================================================\n## CODING_PROCESS\n\n- Referenced activity assignments and Xpert Learning Assistant for guidance throughout the challenge, paying close attention to proper indentation in the Climate App code. Some areas of guidance listed below:\n\n### Climate Analysis\n\n* Looked up how to convert strings to datetime objects for date calculations, ensuring accurate implementation of code. For example, \none_year_ago = dt.datetime.strptime(most_recent_date, \"%Y-%m-%d\") - dt.timedelta(days=365)\n\n* Used SQL queries with Pandas to inspect database tables. For example: data = pd.read_sql(\"SELECT * FROM measurement\", engine)\n\n* Referenced activities to calculate min, max, and average temperatures and reviewed histogram plotting for visualizations.\n\n* Looked up how to create the temperate symbol (option + shift + 8 = °)\n\n### Climate App\n\n* Researched how to structure 404 error messages. For example:    \n    if most_recent_date is None:\n                return jsonify({\"error\": \"No data available.\"}), 404\n\n* The wording for the /start and /start_end routes was initially confusing, so I clarified these requirements using Xpert Learning Assistant. I provided examples in the landing page response to guide users. For example: /api/v1.0/start_end/2010-10-10_2010-12-24\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrighang%2F10_sqlalchemy-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrighang%2F10_sqlalchemy-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrighang%2F10_sqlalchemy-challenge/lists"}