Giter Site home page Giter Site logo

ekapope / worldweatheronline Goto Github PK

View Code? Open in Web Editor NEW
86.0 2.0 43.0 138 KB

WorldWeatherOnline historical weather data API Python wrapper

Home Page: https://towardsdatascience.com/obtain-historical-weather-forecast-data-in-csv-format-using-python-5a6c090fc828

Python 100.00%
weather weather-api worldweatheronline api api-wrapper historical-data historical historical-weather

worldweatheronline's People

Contributors

ekapope avatar evangoldconn avatar zack-kimble avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

worldweatheronline's Issues

the script

Hello i have a problem with the script than i used a small modification

from wwo_hist import retrieve_hist_data
import os
**import requests**

**os.chdir(os.getcwd())**

frequency = 3
start_date = '11-DEC-2018'
end_date = '11-MAR-2019'
api_key = '..........'
location_list = ['singapore', 'california']

hist_weather_data = retrieve_hist_data(api_key,
                                       location_list,
                                       start_date,
                                       end_date,
                                       frequency,
                                       location_label=False,
                                       export_csv=True,
                                       store_df=True)

tempC and maxtempC are the same

Hi, Thank you very much for this useful package. I've noticed that the scrapped tempC and maxtempC are the same. Is it a bug in the script or the data error from the WWO? Thank you.
Best,

Erica

longitude / latitude

How am I supposed a input a list of longitude and latitude, as the location parameter is required to be a string?

Error handling for invalid date (and potentially other errors)

It appears if you reach the historical limit for weather data (e.g. I was trying to scrape for a date in 2008), the API returns an error message:

{'error': [{'msg': 'There is no weather data available for the date provided.'}]}

However the library currently does not handle for this, and just errors with:

  File "/my/path/lib/python3.8/site-packages/wwo_hist/__init__.py", line 103, in retrieve_this_location
    data = json_data['data']['weather']
KeyError: 'weather'

Would it be desirable to at least provide this error message back to the user? I'm happy to make a pull request if you agree

how to save to a df?

The readme says this, but im too stupid to find the dataframes?

`store_df: bool, default = False

If True, retrieved dataframe(s) will be stored as list in the work space.`

period of 3-hour

Hi,
Thanks for your information. The problem I faced with this is that I need the historical data of each 15-minutes for a specific period of time. But it seems that this website just provides information regarding the 3-hours period of time. Even if I change the frequency to 1, it again retrieves the data for the 3-hour period of time.

Multiple Files

When I run the script through a loop from different Zip codes on different days the program overwrites the original file when same zips are processed. For instance, I have the same 5 zips on different days, the .csv file is overwritten each time.

How do I store all processed zips, with different dates, into one .csv file without overwrite?

urllib has no attribute "requests"

When I run the sample code, it told me that "module urllib has no attribute requests" I found the solution that you can change the "import urllib" to "import urllib.requests" at line 13 in file "init.py"

Invalid syntax of file_path

Hello,

Thank you very much for the work. It looks very helpful and easy to use but I got a SyntaxError in the function retrieve_this_location in the line
file_path = f'{response_cache_path}/{location}{start_d}{end_d}'

May you tell me how to solve it, please?

Thank you!

Monthly average

Thanks for the helpful wrapper. Is there a way to adjust the frequency to get a monthly average?

export_csv

Hello,

Is there any way to make the export_csv function append to a csv file? Right now, the export_csv just writes over the CSV file.

Thanks,
AN

Last Month comes two times

First of all: amazing work! You saved me a lot of time for trying out on my own. Thank you very much!

While using the package a behavior occured I could not understand. I collected historical weather data for complete year 2018 from 01-JAN-2018 to 31-DEC-2018. For some reason the december was retrieved two times. no problem at all - I just deleted one december afterwards but maybe you have an idea how to repair this.

best regards,
fabian

BUG

Error while Forecast with 2 days in the end of month

In the endo of month when trying to get forecasted data based on 2 days more precisely ,(30 Nov 2019 & 01 Dec 2019) it give reindex problem as trying to loop back whole November data.Can someone helps me in this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.