Professional Documents
Culture Documents
Weather Forecasting Projectdocx
Weather Forecasting Projectdocx
(Session: 2016-2020)
I hereby agree to indemnify UIET and its Teaching Staff against any and all
losses incurred in connection with any claim or proceeding assert
plagiarism and/or copyright infringement if the investigation carried out to
determines that my work is the plagiarizing or infringing work.
S. Topic
No.
1. certificate
2. Abstract
3. History of python
4. Why python?
10. Conclusion
Abstract
Python program to create a Weather Forecast Application using Python
Programming concepts And Tkinter GUI to develop Application .
This is a project report on “WEATHER FORECAST”’ using openweathermap
API.It is a service that provides weather data,including current weather
data,forecasts,and historical data to the developer of web services and
mobile application.It provides an API with JSON,XML and HTML formats.
To use this current weather data API,one must need the API key,User need
to create an account on openweathermap.org then only can use the
APIs.we use two modules in the program requests And Json.
LISTS-
Ordered collection of data.
Supports similar slicing and indexing functionalities as in the case of
Strings.
They are mutable.
Advantage of a list over a conventional array
• Lists have no size or type constraints(no setting restrictions
beforehand).
• They can contain different object types.
• We can delete elements from a list by using Del
list_name[index_val]
Example-
• my_list = ['one', 'two','three',4,5]
• len(my_list) would output 5.
Dictionary-
Lists are sequences but the dictionaries are mappings.
They are mappings between a unique key and a value pair.
These mappings may not retain order.
Constructing a dictionary.
Accessing object from a dictionary.
Nesting Dictionaries.
Basic Dictionary Methods.
Basic Syntax :
o d={} empty dictionary will be generated and assign keys
and values to it, like d[‘animal’] = ‘Dog’
o d = {'K1':'V1', 'K2’:’V2'}
o d['K1'] outputs 'V1
Tuples-
Immutable in nature, i.e they cannot be changed.
No type restriction .
Indexing and slicing, everything's same like that in strings and lists.
Constructing tuples.
Basic tuple methods.
Immutability.
When to use tuples?
We can use tuples to present things that shouldn’t change, such as
days of the week, or dates on a calendar, etc.
Sets-
A set contains unique and unordered elements and we can
construct them by using a set() function.
Convert a list into Set-
l=[1,2,3,4,1,1,2,3,6,7]
k = set(l)
k becomes {1,2,3,4,6,7}
Basic Syntax-
x=set()
x.add(1)
x = {1}
x.add(1)
This would make no change in x now
Use of Numpy
NumPy is a Python package. It stands for 'Numerical Python'. It is a library
consisting of multidimensional array objects and a collection of routines for
processing of array.
Numeric, the ancestor of NumPy, was developed by Jim Hugunin. Another
package Numarray was also developed, having some additional
functionalities. In 2005, Travis Oliphant created NumPy package by
incorporating the features of Numarray into Numeric package. There are
many contributors to this open source project.
Operations using NumPy Using NumPy, a developer can perform the
following operations −
Mathematical and logical operations on arrays.
Fourier transforms and routines for shape manipulation.
Operations related to linear algebra. NumPy has in-built
functions for linear algebra and random number generation.
Simple program to create a matrix-
First of all we import numpy package then using this we take input in numpy
function as a list then we create a matrix
There is many more function can be perform by using this like that take sin
value of the given value ,print a zero matrix etc. we also take any image in
the form of array.
Use of Pandas
Pandas is an open-source, BSD-licensed Python library providing
highperformance, easy-to-use data structures and data analysis tools for the
Python programming language. Python with Pandas is used in a wide range
of fields including academic and commercial domains including finance,
economics, Statistics, analytics, etc.
Pandas is an open-source Python Library providing high-performance data
manipulation and analysis tool using its powerful data structures. The name
Pandas is derived from the word Panel Data – an Econometrics from
Multidimensional data.
Key Features of Pandas-
• Fast and efficient DataFrame object with default and
Customized indexing.
Tools for loading data into in-memory data objects from different
file formats.
Data alignment and integrated handling of missing data.
Reshaping and pivoting of date sets.
Label-based slicing, indexing and subsetting of large data sets.
Columns from a data structure can be deleted or inserted.
Group by data for aggregation and transformations.
Pandas deals with the following three data structures –
Series
DataFrame
Panel
These data structures are built on top of Numpy array, which means they
are fast.
Tkinter – GUI in Python
Python offers multiple options for developing GUI (Graphical User Interface).
Out of all the GUI methods, tkinter is most commonly used method. It is a
standard Python interface to the Tk GUI toolkit shipped with Python. Python
with tkinter outputs the fastest and easiest way to create the GUI
applications. Creating a GUI using tkinter is an easy task.
To create a tkinter:
1. Importing the module – tkinter
2. Create the main window (container)
3. Add any number of widgets to the main window
4. Apply the event Trigger on the widgets.
Importing tkinter is same as importing any other module in the python code.
Note that the name of the module in Python 2.x is ‘Tkinter’ and in Python 3.x
is ‘tkinter’.
*Import tkinter
There are two main methods used you the user need to remember while
creating the Python application with GUI.
1. Tk(screenName=None, baseName=None, className=’Tk’, useTk=1:
To create a main window, tkinter offer a
methodTk(screenName=None, baseName=None, className=’Tk’, useTk
=1). To change the name of the window, you can change the className to
the desired one. The basic code used to create the main window of the
application is:
m=tkinter.Tk() where m is the name of the main window object
2.mainloop(): There is a method known by the name mainloop() is used
when you are ready for the application to run. mainloop() is an infinite
loop used to run the application, wait for an event to occur and process
the event till the window is not closed.
m.mainloop()
import tkinter
m = tkinter.Tk()
'''
widgets are added here
'''
m.mainloop()
tkinter also offers access to the geometric configuration of the widgets
which can organize the widgets in the parent windows. There are mainly
three geometry manager classes class.
1. pack() method:It organizes the widgets in blocks before placing in the
parent widget.
2. grid() method:It organizes the widgets in grid (table-like structure)
before placing in the parent widget.
3. place() method:It organizes the widgets by placing them on specific
positions directed by the programmer.
There are a number of widgets which you can put in your tkinter
application. Some of the major widgets are explained below:
1. Button
2. Canvas
3. Checkbutton
4. Entry
5. Frame
6. Label
7. Listbox
8. MenuButton
Requirement And Specification
Hardware Requirements:
Software Requirements:
Operating System :
Windows Technology :
PYTHON
IDE Used : Pycharm Community 2019.1.3x64
Weather Forecasting App Working
How to start:
It is quite easy to work with Openweather API. Just sign up to get your API
key and then call any weather API. And mind using API key in every API call
whatever account you choose from Free to Enterprise.
How to start in 3 simple steps
1 Open Openweathermap website: https://openweathermap.org/appid
2 Sign up and get an API key (APPID) on your account page.
After registration, we will send you a welcome email that contain your API
key and additional information on how to get started with our weather
APIs. Within the next couple of hours, it will be activated and ready to use.
3 Start using API for free.
Find the complete description of API calls with a list of parameters and
examples of responses in API documentation.
Please, use API key in each API call.
Parameters:
APPID {APIKEY} is your unique API key
Application GUI:
Conclusion
The Project has been successfully completed by having established the
user friendly interface with the help of python tkinter library. At the
same time there is some scope for improvements in the future. It can
be possible to make it more Attractive by adding more variety of
functions . This application may helpful for the humans as it show the
weather details of a city.
I believe the trial has shown conclusively that it is both possible and
desirable to use Python as the principal teaching language:
• It is Free (as in both cost and source code).
• It is trivial to install on a Windows PC allowing students to take their
interest further. For many the hurdle of installing a Pascal or C
compiler on a Windows machine is either too expensive or too
complicated;
Future Scope:
The Complicated equation which govern how the state of fluid
changes with time require super computer to solve them.
The numerical weather prediction model are computer
similuation of the atmosphere .
The output from the model provides the basis of the weather
forecast.
Location and voice handling can be integrated with the weather
API.
The training program having three destination was a lot more useful
than staying at one place throughout the whole 6 weeks. In my
opinion. I have gained lots of knowledge and experience needed to be
successful in great engineering challenge as in my opinion, Engineering
is after all a Challenge ,and not a job .
Thankyou