Professional Documents
Culture Documents
Project-Weather App
Project-Weather App
HTTP VERBS :
1. POST : create a new resource Ex : if we want to create a message
2. GET : read a resource EX: if iam supposing to read a message or wtch a video
3. PUT : update a resource ex : updating entire thing in the email .
4. PATCH : update parts of resource ex : updating a name in already existing
email account not creating email ,but updating na5. DELETE : delete a resource
ex : deleting a part of resource is called as delete.
JSON (java script object notation ) is format of most of the API’s.
In this project,we are using get due to we want to get the inputs that are
required for the project.
JSON used that while using mobile application or web app we
will be having a server up somewhere in cloud or central server.
To talk to that servers we need a uniform format across all the
platforms we have JSON. (ios or windows or chrome).
We have JSON in the format of key-valued dictionary ,which is
having unique key in them.it is to be that it should be
converted in to a string and then into a dictionary.
SERIALIZATION : It convert into dictionary into a string .
How to do :
1.import json
2. define a dictionary
3. ex : we use syntax json_string=dumps(data , indent=4).
DESERIALIZATION : Taking a string and converting back into a
dictionary.
How to do :
Decoded = json.loads (json_string)
Print(decoded).
Json.dumps : convert dictionary to string
Json.loads : convert JSON string to dictionary
Json .dump : converts dictionary to json and writes to a file.
Json.load : reads data from json file and returns a dictionary.
Requests library to get or acquire data.
Pandas is another powerful library which helps to deal with
tabular format with in python.
Import pandas as pd
Df= pd.dataframe(marks). To get mean of marks
Df[‘chem’].mean().
Python does not have json ,but it is having the dictionary
and the requests format will convert it into a json string .