Skip to content

boazikum/weather-api-project-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

open-weather-map-api-project-code

  • the project consist of two scripts a database and 2 json files, the first python script is called Weather_api_test and is responsible for laying the ground work for communication with the api, in it there are 4 classes, one of them is the interface, one for contacting the api, one that acts as a mock api and doesn't make calls to the api but the two json fiels that represent a response from the api and are used in order to not exsid the api max calls per day, and a third one that selects which one to use according to what you select.
  • the api has several parameters: city name is the city that you want to search for, count is the amount of instances of cities named that way that you want, mode has 3 options If left blank will default to JSON output, Ability to retrieve data in XML or HTML, lon stands for longitude and allows for more accurate selection of cities, type is used to setup accuracy level please use type parameter that have two values - accurate and like, lat stands for latitude and allows for more accurate selection of cities, and units allows to select which system you want to use matric or imperial.
  • the second python script is called data gathering, this script uses the classes from the priveus script in order to make a call to ither the api or mock database and then takes the information and puts it into the database using sqlite, in a case where the count is greater then 1 the script will enter each instance independently to the database, with each new line of data that enters the datbase a timedate stamp is add for future use.
  • the database has 5 collums: reqcity text, responsecity text, date datetime text, tamp numeric, and info blob, reqcity is the requested city, response city is the name of the city that the api returned, date is the time and date when the data was added, temp is the temperature in the response city, and info is all the information that the api returned.

About

the code for the rapid api project

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages