Skip to content

Standard Python Weather App, with Pytest, SQLite, OpenAPI spec

Notifications You must be signed in to change notification settings

wwwstephen/Python-Weather-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Random Repo

N.B. Sensor requires https://www.weatherapi.com/ API key to work, reach out to me if needed. App will work fine without this, as it will load 1 month of Galway weather data from CSV. 30 days of Galway weather data for May 2024, will be preloaded into the app on start up, this is for testing purposes and also to play around with the app.

Installation

  1. Clone the repository:
git clone https://github.com/ennisstephen/My_Random_Repo.git
  1. Start virtual env and download dependencies
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Run App
python run.py
  1. Run tests
pytest3 --verbose
  1. Example queries
http://localhost:5000/v1/weather?stat=AVG&metric=TEMPERATURE&city=Galway&start_date=2024-05-01&end_date=2025-05-31

{
  "AVG": "17.02",
  "city": "GALWAY",
  "end_date": "2025-05-31",
  "metric": "TEMPERATURE",
  "start_date": "2024-05-01"
}

http://localhost:5000/v1/weather?stat=MAX&metric=HUMIDITY&city=Galway&start_date=2024-05-01&end_date=2025-05-31

{
  "MAX": "85",
  "city": "GALWAY",
  "end_date": "2025-05-31",
  "metric": "HUMIDITY",
  "start_date": "2024-05-01"
}

http://localhost:5000/v1/weather?stat=AVG&metric=WIND_KPH&city=Galway&start_date=2024-05-01&end_date=2025-05-31

{
  "AVG": "4.42",
  "city": "GALWAY",
  "end_date": "2025-05-31",
  "metric": "WIND_KPH",
  "start_date": "2024-05-01"
}

I have included an OpenAPI spec if you need more comprehensive documentation

  1. Happy Hacking!

About

Standard Python Weather App, with Pytest, SQLite, OpenAPI spec

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published