Skip to content

JohnnyNovaes/weatherAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1 Weather API ☀️ ☔ ☁️ ❄️

The Weather API is used to collect the weather data from multiple places. You'll have access to the humidity and temperature instantaneous of the places.

2 Quick Tour

alt text alt text alt text alt text alt text

This project uses the technologies above to make all work. For the database was used the TinyDB to manage a simple JSON file that saves the weather data for each request.

To make the API was using the FastAPI. A web framework for building fast and reliable APIs.

For the weather data was use the OpenWeather API.

In this project, since the API make requests for 168 cities was use the AIOHTTP for asynchronous HTTP requests.

In the end, to make it all very easy to work with as used the already known Docker to make isolated environments that can be executed in any machine!

2.1 POST and GET

This API has simple functionality. For the GET it receives the User ID for the POST request and returns the number of cities already completed. The POST request returns the JSON database file with the user ID and the weather data of the 168 cities.

3 How to run it

Follow the next steps very careful.

Clone the repository to your desktop.

git clone https://github.com/JohnnyNovaes/weatherAPI.git

Register into the OpenWeather API for the API KEY.

Put the API KEY from OpenWeather API into the file apiKEY.txt.

Build the docker image using the Dockerfile.

docker build -t myimage .

Run a container with the image created.

docker run -d --name mycontainer -p 80:80 myimage

Type into your browser: 0.0.0.0/docs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors