Coder Social home page Coder Social logo

the-weather-scraper's Introduction

The Weather Scraper (๐ŸŒฉโ›ˆ๐ŸŒค๐ŸŒž๐ŸŒจ)

Need High-resolution Weather Data for Analytics or Machine-learning ? Seek no more.

Overview

The Weather Scraper downloads high-resolution weather data (often 5 min. intervals) from Wunderground's public weather stations around the world for you.

Install dependencies (use Python3)

pip install -r requirements.txt

TLDR

python weather_scraper.py

How to run TWS?

First, find the weather stations you are looking for.
Then you just have to update 2 config files before running TWS.

  1. Go to https://www.wunderground.com/wundermap and zoom in to your location
    ๐ŸŒž Click on a weather station and then click on the Station ID (the Station Summary page will open)
    ๐ŸŒž Open and copy all Station ID URLs you need

  2. Set the weather_station urls inside stations.txt
    ๐ŸŒž one url per line!

  3. Inside config.py
    ๐ŸŒž Set the date-range you want to download your data from
    ๐ŸŒž Set the unit system you need (metric / imperial)
    ๐ŸŒž Set FIND_FIRST_DATE to true if you want the weather scraper to use binary search to search for the first date with data, starting from START_DATE

If you want to download data from 2020/5/1 to 2020/6/1 in metric units your config.py will look like this:

from datetime import date

# Set Date format like: YYYY, MM, DD
START_DATE = date(2020, 5, 1)
END_DATE = date(2020, 6, 1)
# set to "metric" or "imperial"
UNIT_SYSTEM = "metric"

# Automatically find first date where data is logged
FIND_FIRST_DATE = False

Now you are read to run your downloads:

$ python weather_scraper.py

Wait until TWS finishes writing your data to files with this naming pattern station_name.csv!

You resulting CSV file will look something like this (if you give it a nice format)

CSV example

the-weather-scraper's People

Contributors

karlheinzniebuhr avatar

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.