<jupyter_start><jupyter_text>https://www.safaribooksonline.com/videos/working-with-big/9781788839068/9781788839068-video3_1<jupyter_code>import pymongo, requests, pprint, json, datetime, time
from pymongo import MongoClient

client=pymongo.MongoClient('this_mongo_1')
from secrets import *<jupyter_output><empty_output><jupyter_text>3.1 Acquiring Weather Datahttps://openweathermap.org/currentAPI call:api.openweathermap.org/data/2.5/weather?q={city name}<jupyter_code>city = 'london'
requestString = 'https://api.openweathermap.org/data/2.5/weather?q={}&APPID={}'.format(city, secrets.key)
res =  requests.get(requestString)
res.reason
pprint.pprint(res.json())
#fuction to get multiple cities
def getData(city):
    requestString = 'https://api.openweathermap.org/data/2.5/weather?q={}&APPID={}'.format(city, key)
    res = requests.get(requestString)
    return res
res = getData('La paz')
res.status_code
pprint.pprint(res.json())
bookmark: https://www.safaribooksonline.com/videos/working-with-big/9781788839068/9781788839068-video3_1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1449953227315248, 'fraction_numerical': 0.0608044901777362, 'mean_word_length': 7.1679389312977095, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '183910', 'license': 'MIT', 'n_tokens_mistral': 450, 'n_tokens_neox': 401, 'n_words': 50, 'path': 'notebooks/ptyhonVideoForBigDataFiles/WorkingWithBigDataInPython_ConnectingToWeatherAPI.ipynb', 'repo_name': 'dguardia/pyhtonForDataScience-David', 'size': '1069'}