Hello reader! is the mix of events happening each day in our atmosphere and is different in different parts of the world and changes over minutes, hours, days, and weeks. Rain and dull clouds, windy blue skies, cold snow, and sticky heat are very different conditions, yet they are all-weather. According to the Wikipedia: Weather Weather is the state of the atmosphere. In this blog post, we will learn how to forecast weather details. We will see the implementation in Python with hardly a few lines of code. What is ? wttr What is the ? requests Module How to forecast the weather using ? Python Let's get started! What is wttr? wttr — the right way to check the weather! is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers. wttr.in wttr.in uses for visualization and various data sources for weather forecast information. wego If you wish to know more about it, you can refer to . GitHub Repo wttr's Module Used: requests Module: is a simple, yet elegant HTTP library. It allows you to send HTTP/1.1 requests extremely easily. Requests officially support Python 2.7 & 3.5+. Requests If you wish to know more about it, you can refer to . Documentation Requests Module Now that you are familiar with basics and have acquired basic knowledge of we can move forward to Requests Module wttr, the coding section. Time to Code! You can find all the code in my . if you find it useful. GitHub Repository Drop a star In order to access the Python library, you need to install it into your Python environment. pip install requests Now, we need to import the package into our Python script. Use the following command to do so. requests import Now that we have imported the library using the command import requests, let's proceed. Let's ask the user to input the city name for which he/she wishes to fetch the weather details. city = input( ) print(city) 'input the city name' You can also hard-code the value if you will only check for yourself. city = 'bhopal' Now, let's display a simple message. print( + city) Displaying Weather report : bhopal 'Displaying Weather report for: ' #output: for Let's define the URL, we will make use of the format to pass city as a parameter here. = .format(city) url 'https://wttr.in/{}' It's time to make use of the requests module. res = requests.get(url) Our resultant data is stored in res. We use the text method to extract our desired weather details, and let's display the result. print(res.text) This is how the Weather Forecast will look like: Isn't it beautiful? And with that, it's a wrap! I hope you found the article useful! Share in the comments below. I create content about If this is something that interests you, please share the article with your friends and connections. Careers, Blogging, Programming, and Productivity. Thank you for reading. If you have reached it so far, please like the article. It will encourage me to write more such articles. Do share your valuable suggestions. I appreciate your honest feedback! I would strongly recommend you to check out the of the same and . YouTube video don't forget to subscribe to my Channel You can refer to my to see a working tutorial for better understanding and a step-by-step guide. YouTube video Tutorial See you again. Take care! Resources: https://scied.ucar.edu/learning-zone/how-weather-works/weather en.wikipedia.org/wiki/Weather github.com/chubin/wttr.in pypi.org/project/requests docs.python-requests.org/en/master I would love to connect with you on & . Twitter LinkedIn Also published on https://ayushirawat.com/forecast-weather-using-python.