Skip to main content

Weather toolkit

Project description

PySky is a python weather toolkit that provides access into a number of publicly available weather databases. The goal of PySky is to provide a fast and easy-to-use interface to weather data in a pythonic way. The current implementation focuses on United States weather data from NOAA, although future weather systems will be incorporated. In particular, it provides hourly and daily forecast summaries.

Working with the module

The toolkit has several command-line scripts that return formatted weather data.

To obtain forecast data, forecast.py is used. For quick and dirty forecasts, forecast.py will use the NOAA XML web service to obtain forecast information. For more robust applications, users of forecast.py will want to use the grib2 option. The grib2 option downloads NOAA grib2 files which provide forecast elements for the entire United States. Querying grib2 data is much faster and efficient than querying the XML web service.

python bin/download (--grib2-dir=DIR) (--verbose)
python bin/forecast (--hourly) (--grib2-dir=DIR) (--verbose) LATITUDE LONGITUDE

Examples:

python bin/download # download to current directory
python bin/download --grib2-dir=/tmp # download data files to /tmp
python bin/forecast --grib2-dir=/tmp -- 38 -81 # get forecast for latitude 38 and longitude -81

Output for the forecast action are JSON encoded values of the following format:

{
    'daily' : [
        {
            'date' : *date*
            'high' : *high*,
            'low' : *low*,
            'humidity' : *humidity*,
            'precip_day' : *daytime % chance of precip*,
            'precip_night' : *night time % chance of precip*,
            'rain_amount' : *rain amount in inches*,
            'snow_amount' : *snow amount in inches*,
            'weather': *weather description*,
            'symbol': *weather symbol used by NOAA*,
            'wind_sustained': *sustained wind in MPH*,
            'wind_gust': *wind gusts in MPH*
        }, ...
    ],
    'hourly' : [
        {
            'date' : *date*,
            'time' : *time*,
            'temp' : *temperature*,
            'humidity' : *% humidity*,
            'precip' : *% chance of precipitation*,
            'rain_amount' : *rain amount in inches*,
            'snow_amount' : *snow amount in inches*,
            'sky' : *% cloud cover*:
            'weather: *weather description*,
            'wind_sustained': *sustained wind in MPH*,
            'wind_gust': *wind guests in MPH
        }, ...
    ]
 ]

Requirements

If using grib2 files (not web service), the NOAA degrib library must be installed http://www.nws.noaa.gov/mdl/degrib/ . In addition, the geodata directory included with the degrib source must be copied to the grib2 data directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySky-0.1.3dev.tar.gz (15.7 kB view details)

Uploaded Source

File details

Details for the file PySky-0.1.3dev.tar.gz.

File metadata

  • Download URL: PySky-0.1.3dev.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PySky-0.1.3dev.tar.gz
Algorithm Hash digest
SHA256 8e20a30b2b0a9abb280a437345dcd29602ce226f0259097a2af435ea0685e1a7
MD5 1dbb8f948a2e9af8a0d79594b1719cfe
BLAKE2b-256 e252759bc5007ff1c17eaa63c9d0eac08b448d59a5f9a5c249a4183e0cce5086

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page