Imported from archive.

* Release 2.0: Heavy rewrite with too many new features to enumerate
here in the ChangeLog file.

* NEWS: List of important changes since 1.x releases.

* weather, weather.py: Implemented support for Python 3000 as
requested by ptchinster on behalf of Arch Linux, conditions/forecast
searches by latitude/longitude requested by Brandt Daniels, support
for newer NOAA forecasts pointed out by Darryl Mouck and Richard
Dooling, custom URIs requested by Michel Pelzer, international
weather stations requested by Milton Hubsher, and fixed a metric
conversion issue with negative values reported by Jochen Keil,
Michiel Appelman and Stefan Metzlaff. Thanks to everyone for your
input and assistance!
This commit is contained in:
Jeremy Stanley
2012-06-26 00:48:37 +00:00
parent 4d25a49d5a
commit 93f58b4538
20 changed files with 728634 additions and 1959 deletions

76
FAQ
View File

@@ -2,67 +2,55 @@
Frequently Asked Questions About the Weather Utility
======================================================
:Copyright: (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
use, copy, modify, and distribute this software is granted under
terms provided in the LICENSE file distributed with this software.
:Copyright: (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission
to use, copy, modify, and distribute this software is
granted under terms provided in the LICENSE file distributed
with this software.
.. contents::
1. Can I help?
--------------
Sure! Bug reports and feature suggestions are always welcome, but fixes and
patches are of course preferred. Contact fungi@yuggoth.org if desired, but
please read this FAQ and the included manuals for weather(1) and weatherrc(5)
before asking questions that might be answered therein. One big way anyone can
help is to provide me with some additional mappings of METAR station ID, city
name and state abbreviation for inclusion in the default /etc/weatherrc file.
Sure! Bug reports and feature suggestions are always welcome, but fixes
and patches are of course preferred. Contact fungi@yuggoth.org if
desired, but please read this FAQ and the included manuals for
weather(1) and weatherrc(5) before asking questions that might be
answered therein.
2. How do I figure out my local METAR station ID?
-------------------------------------------------
The list of stations is found at http://weather.noaa.gov/data/nsd_cccc.gz (it's
thousands of lines long, so I recommend keyword searching in your browser or
using grep(1) to find what you're looking for). From time to time, the
compression on their site seems to be failing, resulting in zero-byte files. If
you run into this issue, you can get uncompressed and zip-compressed versions
by replacing the "gz" suffix in the URL with "txt" or "zip" respectively. The
list can also be obtained from the following URLs in a pinch, though they are
not guaranteed to be up to date (thanks Celejar!):
* http://www.rap.ucar.edu/weather/surface/stations.txt
* http://aviationweather.gov/adds/metars/stations.txt
The list of stations included in the "stations" file is comprised of
thousands of entries, so if you're within the USA it's recommended to
use weather's built-in Census place name and ZCTA (postal ZIP code)
searching capabilities. Otherwise, using its latitude,longitude
coordinate search feature is probably your best bet. See the weather(1)
manual for examples.
3. How do I figure out my local city name and state abbreviation?
-----------------------------------------------------------------
The forecasts can be located starting from
http://weather.noaa.gov/pub/data/forecasts/city/ (choose the state abbreviation
to get to a list of cities in that state).
As of the 2.0 release, this is no longer necessary. In Spring of 2011
the NWS switched away from city-named forecast zone IDs to the numeric
state zone IDs also used for alerts. As a result, weather now comes with
pregenerated correlations between airports/stations and zones along with
USA Census (FIPS and ZCTA/ZIP code) and global latitude,longitude
coordinates and can search among them in a flexible and intuitive
manner. See the weather(1) manual for examples.
4. I live outside the USA--can this be made to work for me anyway?
------------------------------------------------------------------
METAR station IDs can be found for cities and airports worldwide, but forecast
data is harder to come by. If you have any recommendations of forecast data for
other countries available in a format like NOAA's, I will be happy to try and
find a way to integrate it into the weather utility, but I suspect that some
serious modification would be necessary given that the data is likely to be
published in a non-English language, requiring some additional input from
speakers of that language for how to handle filtering and formatting of the
text.
ICAO codes for METAR stations can be found for cities and airports
worldwide, but forecast and alert data is harder to come by. If you have
any recommendations of plaintext data for other countries available in a
format like NOAA's, I will be happy to start incorporating it into the
weather utility. If the data is published in a non-English language,
I'll require some additional input from speakers of that language for
how to handle filtering and formatting of the text.
5. Why do I get the wrong forecast when specifying -i or --id?
--------------------------------------------------------------
The -i or --id switch (or the id parameter in an alias definition), only tells
weather(1) what current conditions to retrieve. If you specify -f or --forecast
on the command line (or forecast=True in an alias) without providing a city
name and state abbreviation (-c/--city and -s/--st, or city and st in an alias)
and are seeing an actual forecast, then you probably have a default city and
state abbreviation set in your config. See question 3 above for information on
figuring out what city name and state abbreviation to use, and the manual for
weatherrc(5) for information on defining aliases.
As of the 2.0 release, this question is no longer relevant.
6. Where can I get a list of the NWS advisory zones for alerts?
---------------------------------------------------------------
The lists of advisory zones by region are found aggregated at
http://weather.noaa.gov/pub/data/zonecatalog.curr.tar (it's several thousand
files totalling well over a hundred thousand lines of text, so I recommend
downloading, unpacking and using a recursive grep(1) to find what you're
looking for).
As of the 2.0 release, this is no longer necessary. See FAQ entries #2
and #3 for more detail.

62
INSTALL
View File

@@ -2,24 +2,29 @@
Basic Unix Installation Instructions for the Weather Utility
==============================================================
:Copyright: (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
use, copy, modify, and distribute this software is granted under
terms provided in the LICENSE file distributed with this software.
:Copyright: (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission
to use, copy, modify, and distribute this software is
granted under terms provided in the LICENSE file distributed
with this software.
.. contents::
Prerequisites
-------------
You need the Python interpreter installed somewhere in your path (most modern
UNIX derivatives come with one already). If you need to get Python, it can be
obtained from http://www.python.org/ (but chances are your operating system at
least provides some sort of native package for it, which you should probably
install in whatever means is recommended by your OS vendor/distributor).
You need the Python interpreter installed somewhere in your path (most
modern UNIX derivatives come with one already). If you need to get
Python, it can be obtained from http://www.python.org/ but chances are
your operating system at least provides some sort of native package for
it, which you should probably install in whatever means is recommended
by your OS vendor/distributor. The script is tested with recent 2.x and
3.x Python versions, attempting to maintain forward/backward
compatability with the interpreter, so bug reports or patches to ensure
this continues to be the case are most welcome.
Running in Place
----------------
An easy way to try it out is to unpack the tarball and change to the resulting
directory::
An easy way to try it out is to unpack the tarball and change to the
resulting directory::
tar xzf weather-*.tar.gz
cd weather-*
@@ -27,30 +32,37 @@ directory::
./weather --help
man ./weather.1
man ./weatherrc.5
./weather --forecast --no-conditions --city=charlotte --st=nc
./weather ord sea
./weather --forecast rdu
./weather clt gso
...and so on. The weather utility, included Python module and documentation are
all fully functional when kept together in one directory, if somewhat
inconvenient.
...and so on. The weather utility, included Python module and
documentation are all fully functional when kept together in one
directory, without needing to install these components to other
locations within the filesystem hierarchy.
Installing the Utility
----------------------
The file named weather should be made executable and put somewhere in your path
(/usr/local/bin/ or ~/bin/ for example). Similarly, weather.py needs to be
somewhere in Python's include path. You can see your Python interpreter's
default include path by running::
The file named weather should be made executable and put somewhere in
your path (/usr/local/bin/ or ~/bin/ for example). Similarly, weather.py
needs to be somewhere in Python's include path. You can see your Python
interpreter's default include path by running::
python -c "import sys ; print sys.path"
If the correlation data files are to be used (airports, places,
stations, zctas, zones), they need to be in your current working
directory or a directory mentioned within the "default" section's
"datapath" option of the weatherrc file.
Configuration
-------------
The weatherrc file should go in /etc/ or you can save it in your home directory
as a dotfile (~/.weatherrc) to support user-specific alias configuration and
overrides of the global /etc/weatherrc file.
The weatherrc file should go in /etc/ or /etc/weather/ for global
configuration. You can save it in your home directory as a dotfile
(~/.weather/weatherrc or ~/.weatherrc) to support user-specific alias
configuration and overrides of the global weatherrc file.
Manuals
-------
Optionally, the weather.1 and weatherrc.5 files can be placed in sane locations
for TROFF/NROFF manual files on your system (for example, /usr/local/share/man/
or ~/man/).
Optionally, the weather.1 and weatherrc.5 files can be placed in sane
locations for TROFF/NROFF manual files on your system (for example,
/usr/local/share/man/ or ~/man/).

42
LICENSE
View File

@@ -2,27 +2,39 @@
Weather License
=================
The weather project employs the ISC license, a permissive free software license
written by the Internet Systems Consortium and functionally equivalent to the
2-clause BSD license. Initially used for the ISC's own software releases, it
has since become the preferred license of many projects (OpenBSD, for example).
The weather project employs the ISC license, a permissive free software
license written by the Internet Systems Consortium and functionally
equivalent to the 2-clause BSD license. Initially used for the ISC's own
software releases, it has since become the preferred license of many
other projects.
The correlation data provided is augmented by manual research but built
primarily by aggregating sources within the USA Public Domain (U.S.
Census Bureau Gazetteer and publications of the National Oceanic and
Atmospheric Administration's National Climatic Data Center and National
Weather Service including its National Centers for Environmental
Prediction and Office of Science and Technology/Systems Engineering
Center Geographic Information Systems Map Group). Copies of the original
external data sources have been provided with this software for
reference, but are not covered by the copyright or permission notices
which follow.
Copyright Notice
----------------
Copyright (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>
Copyright (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>
Permission Notice
-----------------
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
Disclaimer
----------
The software is provided "as is" and the author disclaims all warranties with
regard to this software including all implied warranties of merchantability and
fitness. In no event shall the author be liable for any special, direct,
indirect, or consequential damages or any damages whatsoever resulting from
loss of use, data or profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection with the use or
performance of this software.
The software is provided "as is" and the author disclaims all warranties
with regard to this software including all implied warranties of
merchantability and fitness. In no event shall the author be liable for
any special, direct, indirect, or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an
action of contract, negligence or other tortious action, arising out of
or in connection with the use or performance of this software.

51
NEWS Normal file
View File

@@ -0,0 +1,51 @@
=================================================
New Version Information for the Weather Utility
=================================================
:Copyright: (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission
to use, copy, modify, and distribute this software is
granted under terms provided in the LICENSE file distributed
with this software.
.. contents::
2.0 Release
-----------
The 2.0 release involves a major rewrite of the underlying code and
addition of large volumes of previously-unneeded location correlation
data. In the Spring of 2011 the USA NOAA/NWS made significant changes to
the way they organized and published forecast data such that it could
no longer be supported by design assumptions inherent within this
utility. Attempts were made to preserve backward compatability with 1.x
command-line usage and configuration file formats where possible, but
some regressions are unfortunately unavoidable. The aurl, city, flines,
furl, id, murl, st and zones options have been removed. Minimal logic
was retained to recognize and continue supporting limited use of city,
id and st in configuration files, though these are deprecated for
eventual removal in a future release.
On a positive note, this provided an opportunity to design out
some reported bugs and add in numerous requested features. Highlights
include:
* Because NOAA/NWS now treats forecast data in the same way as alerts,
the alert reporting features are now much better integrated and no
longer considered a beta test.
* The lack of memorable alert/forecast zone coding in the new scheme
drove development of intelligent search functionality, allowing users
to find stations and zones through a variety of methods like place
names, IATA/FAA/ICAO/FIPS/ZIP codes and even raw coordinates.
* To reduce unnecessary load on NOAA/NWS servers, the utility now
caches retrieved data for a configurable period of time.
* Airport code lists are no longer maintained in configuration (though
they are still easily overridden through configuration), and are
instead now separately managed in a manner similar to the other
pregenerated correlation data.
Worth noting, however, is that the new forecast data publication format
(now essentially identical to the alert format) is all-caps freeform
prose, and not easily parsed as a result. Due to the lengthy nature of
this output, piping it through a pager is highly recommended.

48
README
View File

@@ -2,35 +2,38 @@
General Information About the Weather Utility
===============================================
:Copyright: (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
use, copy, modify, and distribute this software is granted under
terms provided in the LICENSE file distributed with this software.
:Copyright: (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission
to use, copy, modify, and distribute this software is
granted under terms provided in the LICENSE file distributed
with this software.
.. contents::
What?
-----
This command-line utility is intended to provide quick access to current
weather conditions and forecasts. Presently, it is capable of returning data
for localities throughout the USA by retrieving and formatting decoded METARs
(Meteorological Aerodrome Reports) from NOAA (the USA National Oceanic and
Atmospheric Administration) and forecasts from NWS (the USA National Weather
weather conditions and forecasts. Presently, it is capable of returning
data for localities throughout the USA and some select locations
globally by retrieving and formatting decoded METARs (Meteorological
Aerodrome Reports) from NOAA (the USA National Oceanic and Atmospheric
Administration) and forecasts/alerts from NWS (the USA National Weather
Service). The tool is written to function in the same spirit as other
command-line informational utilities like cal(1), calendar(1) and dict(1). It
can retrieve arbitrary weather data via specific command-line switches (station
ID, city, state), or aliases can be configured system wide and on a per-user
basis. It can be freely used and redistributed under the terms of a BSD-like
License.
command-line informational utilities like cal(1), calendar(1) and
dict(1). It retrieves arbitrary weather data via precompiled
correlations or custom-tailored aliases (system-wide or on a per-user
basis). It can be freely used and redistributed under the terms of a
BSD-like License.
Why?
----
My girlfriend had a long commute to/from work and school, and often wanted to
check the weather both for home and her office. Unfortunately, starting a Web
browser, pulling up a weather site, entering multiple ZIP codes and waiting for
them to load is time-consuming for the marginally-impatient. Since she tended
to stay logged into a shell server most of the time, I figured I'd install a
quick command-line tool to retrieve weather info for her commute, but to my
surprise, a quick search turned up little that met my basic requirements:
My girlfriend had a long commute to/from work and school, and often
wanted to check the weather both for home and her office. Unfortunately,
starting a Web browser, pulling up a weather site, entering multiple ZIP
codes and waiting for them to load is time-consuming for the
marginally-impatient. Since she tended to stay logged into a shell
server most of the time, I figured I'd install a quick command-line tool
to retrieve weather info for her commute. To my surprise, a quick search
turned up little that met my basic requirements:
* retrieve current data on-demand
* provide both current conditions and short-term forecasts
@@ -40,9 +43,10 @@ surprise, a quick search turned up little that met my basic requirements:
Where?
------
A tarball for the most recent version of the weather utility can be had here:
A tarball for the most recent version of the weather utility can be had
here:
* http://fungi.yuggoth.org/weather/src/
Alternatively, Debian and Ubuntu users can install the weather-util package
from any mirror.
Alternatively, Debian and Ubuntu users can install the weather-util
package from any mirror.

2359
airports Normal file

File diff suppressed because it is too large Load Diff

7101
overrides.conf Normal file

File diff suppressed because it is too large Load Diff

683
overrides.log Normal file
View File

@@ -0,0 +1,683 @@
added airport abs (+1 options)
added airport aby (+1 options)
added airport agh (+1 options)
added airport ajr (+1 options)
added airport amv (+1 options)
added airport ane (+1 options)
added airport ang (+1 options)
added airport aor (+1 options)
added airport aqa (+1 options)
added airport aru (+1 options)
added airport atk (+1 options)
added airport avn (+1 options)
added airport azs (+1 options)
added airport bdj (+1 options)
added airport bfv (+1 options)
added airport bgw (+1 options)
added airport bhk (+1 options)
added airport bji (+1 options)
added airport bjn (+1 options)
added airport bkd (+1 options)
added airport bkg (+1 options)
added airport bkl (+1 options)
added airport bld (+1 options)
added airport blr (+1 options)
added airport bml (+1 options)
added airport bpn (+1 options)
added airport bqs (+1 options)
added airport bsg (+1 options)
added airport bsr (+1 options)
added airport bth (+1 options)
added airport bus (+1 options)
added airport bvc (+1 options)
added airport bxk (+1 options)
added airport cac (+1 options)
added airport caj (+1 options)
added airport ccj (+1 options)
added airport ccm (+1 options)
added airport cei (+1 options)
added airport cfb (+1 options)
added airport ciw (+1 options)
added airport cjc (+1 options)
added airport ckh (+1 options)
added airport cmx (+1 options)
added airport cni (+1 options)
added airport cnw (+1 options)
added airport cod (+1 options)
added airport cok (+1 options)
added airport cso (+1 options)
added airport csy (+1 options)
added airport ctj (+1 options)
added airport cty (+1 options)
added airport cxj (+1 options)
added airport dgw (+1 options)
added airport dol (+1 options)
added airport dps (+1 options)
added airport dsa (+1 options)
added airport dwc (+1 options)
added airport dzn (+1 options)
added airport ebl (+1 options)
added airport ego (+1 options)
added airport eps (+1 options)
added airport esc (+1 options)
added airport evn (+1 options)
added airport fmm (+1 options)
added airport fod (+1 options)
added airport fog (+1 options)
added airport fsz (+1 options)
added airport gai (+1 options)
added airport gcc (+1 options)
added airport gcj (+1 options)
added airport gdt (+1 options)
added airport gel (+1 options)
added airport get (+1 options)
added airport ghg (+1 options)
added airport gmz (+1 options)
added airport gov (+1 options)
added airport gpb (+1 options)
added airport gur (+1 options)
added airport guw (+1 options)
added airport hak (+1 options)
added airport hcr (+1 options)
added airport hgu (+1 options)
added airport hid (+1 options)
added airport hlp (+1 options)
added airport hmv (+1 options)
added airport hsk (+1 options)
added airport htg (+1 options)
added airport hti (+1 options)
added airport hua (+1 options)
added airport huf (+1 options)
added airport iaa (+1 options)
added airport ifj (+1 options)
added airport igg (+1 options)
added airport ild (+1 options)
added airport ioa (+1 options)
added airport iph (+1 options)
added airport isu (+1 options)
added airport iwa (+1 options)
added airport jad (+1 options)
added airport jbq (+1 options)
added airport jct (+1 options)
added airport jhs (+1 options)
added airport joi (+1 options)
added airport jqa (+1 options)
added airport jsu (+1 options)
added airport juv (+1 options)
added airport kbv (+1 options)
added airport kdh (+1 options)
added airport kfp (+1 options)
added airport kgk (+1 options)
added airport kgp (+1 options)
added airport kja (+1 options)
added airport klg (+1 options)
added airport kmo (+1 options)
added airport knw (+1 options)
added airport koe (+1 options)
added airport kop (+1 options)
added airport krw (+1 options)
added airport ksz (+1 options)
added airport kut (+1 options)
added airport kvc (+1 options)
added airport lae (+1 options)
added airport lbd (+1 options)
added airport lcj (+1 options)
added airport ldk (+1 options)
added airport lop (+1 options)
added airport lrd (+1 options)
added airport lsq (+1 options)
added airport lwn (+1 options)
added airport mcx (+1 options)
added airport mdl (+1 options)
added airport mdw (+1 options)
added airport mgc (+1 options)
added airport mii (+1 options)
added airport mji (+1 options)
added airport mll (+1 options)
added airport mni (+1 options)
added airport mou (+1 options)
added airport mpw (+1 options)
added airport mqf (+1 options)
added airport mqp (+1 options)
added airport mqs (+1 options)
added airport mrf (+1 options)
added airport mvq (+1 options)
added airport mwx (+1 options)
added airport myp (+1 options)
added airport mzl (+1 options)
added airport naj (+1 options)
added airport naq (+1 options)
added airport naw (+1 options)
added airport nbw (+1 options)
added airport ncy (+1 options)
added airport ngb (+1 options)
added airport nib (+1 options)
added airport nkx (+1 options)
added airport nlg (+1 options)
added airport nsk (+1 options)
added airport nst (+1 options)
added airport ntl (+1 options)
added airport ntq (+1 options)
added airport nty (+1 options)
added airport nux (+1 options)
added airport nvi (+1 options)
added airport nvt (+1 options)
added airport nym (+1 options)
added airport nza (+1 options)
added airport obn (+1 options)
added airport ook (+1 options)
added airport org (+1 options)
added airport orv (+1 options)
added airport osd (+1 options)
added airport oss (+1 options)
added airport osw (+1 options)
added airport ovb (+1 options)
added airport oza (+1 options)
added airport pao (+1 options)
added airport pbh (+1 options)
added airport ped (+1 options)
added airport pes (+1 options)
added airport pga (+1 options)
added airport pgu (+1 options)
added airport phs (+1 options)
added airport pie (+1 options)
added airport pip (+1 options)
added airport pkv (+1 options)
added airport pmw (+1 options)
added airport pnt (+1 options)
added airport ppk (+1 options)
added airport pqi (+1 options)
added airport prv (+1 options)
added airport pwq (+1 options)
added airport pze (+1 options)
added airport qgy (+1 options)
added airport rai (+1 options)
added airport rby (+1 options)
added airport riw (+1 options)
added airport riy (+1 options)
added airport rmf (+1 options)
added airport rmg (+1 options)
added airport roi (+1 options)
added airport rsh (+1 options)
added airport rue (+1 options)
added airport sbo (+1 options)
added airport scm (+1 options)
added airport shg (+1 options)
added airport sig (+1 options)
added airport sjc (+1 options)
added airport sjw (+1 options)
added airport skk (+1 options)
added airport skt (+1 options)
added airport sku (+1 options)
added airport skv (+1 options)
added airport slo (+1 options)
added airport sly (+1 options)
added airport smk (+1 options)
added airport smv (+1 options)
added airport sno (+1 options)
added airport snu (+1 options)
added airport sny (+1 options)
added airport sob (+1 options)
added airport sqo (+1 options)
added airport sry (+1 options)
added airport stk (+1 options)
added airport sub (+1 options)
added airport sus (+1 options)
added airport taz (+1 options)
added airport tbs (+1 options)
added airport tca (+1 options)
added airport tdx (+1 options)
added airport tef (+1 options)
added airport tgg (+1 options)
added airport ths (+1 options)
added airport tjm (+1 options)
added airport tro (+1 options)
added airport ukb (+1 options)
added airport ukk (+1 options)
added airport ulh (+1 options)
added airport ulv (+1 options)
added airport und (+1 options)
added airport urs (+1 options)
added airport usm (+1 options)
added airport vai (+1 options)
added airport vak (+1 options)
added airport vav (+1 options)
added airport vil (+1 options)
added airport vkt (+1 options)
added airport vsg (+1 options)
added airport vts (+1 options)
added airport wmo (+1 options)
added airport wwr (+1 options)
added airport wya (+1 options)
added airport xfl (+1 options)
added airport xsp (+1 options)
added airport xtl (+1 options)
added airport yny (+1 options)
added airport yoo (+1 options)
added airport yra (+1 options)
added airport ysp (+1 options)
added airport zmt (+1 options)
added airport zos (+1 options)
changed station cyab (+2 options)
changed station cybq (+2 options)
changed station daef (+2 options)
changed station daen (+2 options)
changed station egno (+2 options)
changed station ehak (+2 options)
changed station ehdv (+2 options)
changed station ehfd (+2 options)
changed station ehfz (+2 options)
changed station ehja (+2 options)
changed station ehjr (+2 options)
changed station ehkv (+2 options)
changed station ehma (+2 options)
changed station ehmg (+2 options)
changed station ehpg (+2 options)
changed station ehqe (+2 options)
changed station ehsa (+2 options)
changed station ehsc (+2 options)
changed station fdjr (+2 options)
changed station fdmy (+2 options)
changed station fdnd (+2 options)
changed station fdny (+2 options)
changed station fdot (+2 options)
changed station fdpp (+2 options)
changed station fdvv (+2 options)
changed station fyab (+2 options)
changed station fyan (+2 options)
changed station fybg (+2 options)
changed station fybp (+2 options)
changed station fyen (+2 options)
changed station fyhd (+2 options)
changed station fykb (+2 options)
changed station fymh (+2 options)
changed station fymp (+2 options)
changed station fynd (+2 options)
changed station fyoh (+2 options)
changed station fyom (+2 options)
changed station fyos (+2 options)
changed station fyot (+2 options)
changed station fyoy (+2 options)
changed station fyrh (+2 options)
changed station fyrn (+2 options)
changed station fytm (+2 options)
changed station gmae (+2 options)
changed station gmmo (+2 options)
changed station gmto (+2 options)
changed station gqno (+2 options)
changed station gqon (+2 options)
changed station gqqp (+2 options)
changed station hkms (+2 options)
changed station hknh (+2 options)
changed station huak (+2 options)
changed station huka (+2 options)
changed station huwn (+2 options)
changed station k05u (+2 options)
changed station k19a (+2 options)
changed station k2i0 (+2 options)
changed station k3r7 (+2 options)
changed station k5w8 (+2 options)
changed station k6a2 (+2 options)
changed station kajz (+2 options)
changed station kbgf (+2 options)
changed station kcni (+2 options)
changed station kd25 (+2 options)
changed station kd95 (+2 options)
changed station kded (+2 options)
changed station ke11 (+2 options)
changed station ke16 (+2 options)
changed station kedj (+2 options)
changed station kfot (+2 options)
changed station kfwz (+2 options)
changed station kfyg (+2 options)
changed station kggp (+2 options)
changed station kgic (+2 options)
changed station kgoo (+2 options)
changed station kgxa (+2 options)
changed station khhw (+2 options)
changed station khzr (+2 options)
changed station ki35 (+2 options)
changed station kinf (+2 options)
changed station kiob (+2 options)
changed station kiya (+2 options)
changed station kjpd (+2 options)
changed station kjvw (+2 options)
changed station kk22 (+2 options)
changed station klsb (+2 options)
changed station klua (+2 options)
changed station km40 (+2 options)
changed station km63 (+2 options)
changed station kmgc (+2 options)
changed station ko86 (+2 options)
changed station kqbu (+2 options)
changed station kqea (+2 options)
changed station kqeb (+2 options)
changed station kqei (+2 options)
changed station kqej (+2 options)
changed station kqel (+2 options)
changed station kqen (+2 options)
changed station kqep (+2 options)
changed station kqeq (+2 options)
changed station kqer (+2 options)
changed station kqes (+2 options)
changed station kqev (+2 options)
changed station kqew (+2 options)
changed station kqex (+2 options)
changed station kqey (+2 options)
changed station kqfb (+2 options)
changed station kqft (+2 options)
changed station kqfu (+2 options)
changed station kqfv (+2 options)
changed station kqfw (+2 options)
changed station kqfx (+2 options)
changed station kqka (+2 options)
changed station kqms (+2 options)
changed station kqsn (+2 options)
changed station kqth (+2 options)
changed station kqts (+2 options)
changed station kqvp (+2 options)
changed station kqz4 (+2 options)
changed station krts (+2 options)
changed station ksrb (+2 options)
changed station ksyf (+2 options)
changed station kt35 (+2 options)
changed station ktbx (+2 options)
changed station ktdr (+2 options)
changed station ktha (+2 options)
changed station ktoc (+2 options)
changed station lebt (+2 options)
changed station leec (+2 options)
changed station lszl (+2 options)
changed station lubm (+2 options)
changed station mdab (+2 options)
changed station mgmm (+2 options)
changed station mgmt (+2 options)
changed station mgpc (+2 options)
changed station mgtu (+2 options)
changed station mhcl (+2 options)
changed station mlrm (+2 options)
changed station mppa (+2 options)
changed station nmmg (+2 options)
changed station oihs (+2 options)
changed station oimq (+2 options)
changed station oine (+2 options)
changed station omam (+2 options)
changed station omdl (+2 options)
changed station omdm (+2 options)
changed station omlw (+2 options)
changed station ommz (+2 options)
changed station omsn (+2 options)
changed station omth (+2 options)
changed station opfa (+2 options)
changed station ormb (+2 options)
changed station orn1 (+2 options)
changed station orni (+2 options)
changed station oysd (+2 options)
changed station pawm (+2 options)
changed station prni (+2 options)
changed station scir (+2 options)
changed station sgaj (+2 options)
changed station sgbn (+2 options)
changed station sggr (+2 options)
changed station sglv (+2 options)
changed station sgpc (+2 options)
changed station sgpg (+2 options)
changed station sgpi (+2 options)
changed station sgpj (+2 options)
changed station sgsj (+2 options)
changed station sgsp (+2 options)
changed station sgvr (+2 options)
changed station slbj (+2 options)
changed station slsr (+2 options)
changed station slti (+2 options)
changed station spwt (+2 options)
changed station svs0 (+2 options)
changed station tcna (+2 options)
changed station tnnc (+2 options)
changed station tpdp (+2 options)
changed station tvsc (+2 options)
changed station ubbq (+2 options)
changed station ugms (+2 options)
changed station urmo (+2 options)
changed station utfa (+2 options)
changed station utff (+2 options)
changed station uudl (+2 options)
changed station vapr (+2 options)
changed station vqpr (+2 options)
changed station wadl (+2 options)
changed station yrmd (+2 options)
changed station zswz (+2 options)
changed zone akz017 (+1 options)
changed zone akz018 (+1 options)
changed zone akz019 (+1 options)
changed zone akz020 (+1 options)
changed zone akz021 (+1 options)
changed zone akz022 (+1 options)
changed zone akz023 (+1 options)
changed zone akz152 (+23 options)
changed zone akz227 (+23 options)
changed zone asz001 (+23 options)
changed zone asz002 (+23 options)
changed zone asz003 (+24 options)
changed zone azz501 (+23 options)
changed zone azz502 (+23 options)
changed zone azz503 (+23 options)
changed zone azz504 (+23 options)
changed zone azz505 (+23 options)
changed zone azz506 (+23 options)
changed zone azz507 (+23 options)
changed zone azz508 (+23 options)
changed zone azz509 (+23 options)
changed zone azz510 (+23 options)
changed zone azz511 (+23 options)
changed zone azz512 (+23 options)
changed zone azz513 (+23 options)
changed zone azz514 (+23 options)
changed zone azz515 (+23 options)
changed zone caz093 (+1 options)
changed zone caz519 (+23 options)
changed zone caz520 (+23 options)
changed zone caz521 (+23 options)
changed zone caz522 (+23 options)
changed zone caz523 (+23 options)
changed zone caz524 (+24 options)
changed zone caz525 (+23 options)
changed zone caz526 (+23 options)
changed zone caz527 (+23 options)
changed zone caz528 (+23 options)
changed zone caz529 (+23 options)
changed zone caz530 (+23 options)
changed zone caz547 (+23 options)
changed zone caz548 (+23 options)
changed zone flz051 (+1 options)
changed zone flz108 (+23 options)
changed zone flz112 (+23 options)
changed zone flz114 (+23 options)
changed zone flz115 (+23 options)
changed zone flz118 (+23 options)
changed zone flz127 (+23 options)
changed zone flz128 (+23 options)
changed zone flz134 (+23 options)
changed zone flz168 (+23 options)
changed zone flz172 (+23 options)
changed zone flz173 (+23 options)
changed zone flz174 (+23 options)
changed zone gaz047 (!1 options)
changed zone idz001 (!1 options)
changed zone idz033 (+23 options)
changed zone laz069 (+1 options)
changed zone laz071 (+23 options)
changed zone laz072 (+23 options)
changed zone laz073 (+23/!1 options)
changed zone laz074 (+23/!1 options)
changed zone mdz501 (+23 options)
changed zone mdz502 (+23 options)
changed zone mtz001 (!1 options)
changed zone ncz105 (+23 options)
changed zone ncz106 (+23 options)
changed zone ncz107 (+23 options)
changed zone ncz108 (+23 options)
changed zone ncz109 (+23 options)
changed zone ncz110 (+23 options)
changed zone ncz501 (+23 options)
changed zone ncz502 (+23 options)
changed zone ncz503 (+23 options)
changed zone ncz504 (+23 options)
changed zone ncz505 (+23 options)
changed zone ncz506 (+23 options)
changed zone ncz507 (+23 options)
changed zone ncz508 (+23 options)
changed zone ncz509 (+23 options)
changed zone ncz510 (+23 options)
changed zone nez095 (+23 options)
changed zone nez096 (+23 options)
changed zone nhz004 (!1 options)
changed zone njz103 (+23 options)
changed zone njz104 (+23 options)
changed zone njz105 (+23 options)
changed zone njz106 (+23 options)
changed zone njz107 (+23 options)
changed zone njz108 (+23 options)
changed zone nmz401 (+24 options)
changed zone nmz402 (+24 options)
changed zone nmz403 (+24 options)
changed zone nmz404 (+24 options)
changed zone nmz405 (+24 options)
changed zone nmz406 (+24 options)
changed zone nmz407 (+24 options)
changed zone nmz408 (+24 options)
changed zone nmz409 (+24 options)
changed zone nmz410 (+24 options)
changed zone nmz411 (+24 options)
changed zone nmz412 (+24 options)
changed zone nmz413 (+24 options)
changed zone nmz414 (+24 options)
changed zone nmz415 (+24 options)
changed zone nmz416 (+24 options)
changed zone nmz417 (+24 options)
changed zone nmz501 (+23 options)
changed zone nmz502 (+23 options)
changed zone nmz503 (+23 options)
changed zone nmz504 (+23 options)
changed zone nmz505 (+23 options)
changed zone nmz506 (+23 options)
changed zone nmz507 (+23 options)
changed zone nmz508 (+23 options)
changed zone nmz509 (+23 options)
changed zone nmz510 (+23 options)
changed zone nmz511 (+23 options)
changed zone nmz512 (+23 options)
changed zone nmz513 (+23 options)
changed zone nmz514 (+23 options)
changed zone nmz515 (+23 options)
changed zone nmz516 (+23 options)
changed zone nmz517 (+23 options)
changed zone nmz518 (+23 options)
changed zone nmz519 (+23 options)
changed zone nmz520 (+23 options)
changed zone nmz521 (+23 options)
changed zone nmz522 (+23 options)
changed zone nmz523 (+23 options)
changed zone nmz524 (+23 options)
changed zone nmz525 (+23 options)
changed zone nmz526 (+23 options)
changed zone nmz527 (+23 options)
changed zone nmz528 (+23 options)
changed zone nmz529 (+23 options)
changed zone nmz530 (+23 options)
changed zone nmz531 (+23 options)
changed zone nmz532 (+23 options)
changed zone nmz533 (+23 options)
changed zone nmz534 (+23 options)
changed zone nmz535 (+23 options)
changed zone nmz536 (+23 options)
changed zone nmz537 (+23 options)
changed zone nmz538 (+23 options)
changed zone nmz539 (+23 options)
changed zone nmz540 (+23 options)
changed zone nvz038 (+23 options)
changed zone nvz039 (+23/!1 options)
changed zone nvz040 (+23 options)
changed zone nvz041 (+23 options)
changed zone nyz176 (+23 options)
changed zone nyz177 (+23 options)
changed zone nyz178 (+23 options)
changed zone nyz179 (+23 options)
changed zone orz014 (+23 options)
changed zone orz507 (+23 options)
changed zone orz508 (+23 options)
changed zone orz509 (+23 options)
changed zone paz073 (+23 options)
changed zone paz074 (+23 options)
changed zone paz075 (+23 options)
changed zone paz076 (+23 options)
changed zone scz047 (!1 options)
changed zone scz052 (+23 options)
changed zone scz053 (+23 options)
changed zone scz054 (+23 options)
changed zone scz055 (+23 options)
changed zone scz056 (+23 options)
changed zone txz246 (+1 options)
changed zone txz259 (+23 options)
changed zone txz260 (+23 options)
changed zone txz261 (+23 options)
changed zone txz262 (+23 options)
changed zone txz418 (+24 options)
changed zone txz419 (+24 options)
changed zone txz420 (+24 options)
changed zone txz421 (+24 options)
changed zone txz422 (+24 options)
changed zone txz423 (+24 options)
changed zone txz424 (+24 options)
changed zone utz517 (+23 options)
changed zone utz518 (+23 options)
changed zone vaz501 (+23 options)
changed zone vaz502 (+23 options)
changed zone vaz503 (+23 options)
changed zone vaz504 (+23 options)
changed zone vtz004 (+1 options)
changed zone waz503 (+23 options)
changed zone waz504 (+23 options)
changed zone waz505 (+23 options)
changed zone waz506 (+23 options)
changed zone waz507 (+23 options)
changed zone waz508 (+23 options)
changed zone waz509 (+23 options)
changed zone waz510 (+23 options)
changed zone waz511 (+23 options)
changed zone waz512 (+23 options)
changed zone waz513 (+23 options)
changed zone waz514 (+23 options)
changed zone waz515 (+23 options)
changed zone waz516 (+23 options)
changed zone waz517 (+23 options)
changed zone waz518 (+23 options)
changed zone waz519 (+23 options)
changed zone waz520 (+23 options)
changed zone waz521 (+23 options)
changed zone wvz501 (+23 options)
changed zone wvz502 (+23 options)
changed zone wvz503 (+23 options)
changed zone wvz504 (+23 options)
changed zone wvz505 (+23 options)
changed zone wvz506 (+23 options)
changed zone wyz001 (!1 options)
changed zone wyz101 (+23 options)
changed zone wyz102 (+23 options)
changed zone wyz103 (+23 options)
changed zone wyz104 (+23 options)
changed zone wyz105 (+23 options)
changed zone wyz106 (+23 options)
changed zone wyz107 (+23 options)
changed zone wyz108 (+23 options)
changed zone wyz109 (+23 options)
changed zone wyz110 (+23 options)
changed zone wyz111 (+23 options)
changed zone wyz112 (+23 options)
changed zone wyz113 (+23 options)
changed zone wyz114 (+23 options)
changed zone wyz115 (+23 options)
changed zone wyz116 (+23 options)
changed zone wyz117 (+23 options)
changed zone wyz118 (+23 options)
changed zone wyz119 (+23 options)

416289
places Normal file

File diff suppressed because it is too large Load Diff

0
qa.log Normal file
View File

5274
slist Normal file

File diff suppressed because it is too large Load Diff

28972
stations Normal file

File diff suppressed because it is too large Load Diff

148
weather
View File

@@ -2,7 +2,7 @@
# distributions may wish to edit the above to refer to a specific interpreter
# path, such as #!/usr/bin/python
# Copyright (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
# Copyright (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission to
# use, copy, modify, and distribute this software is granted under terms
# provided in the LICENSE file distributed with this software.
@@ -11,67 +11,105 @@
# added so distributors can consistently specify a private module location
private_module_path = None
if private_module_path:
import sys
sys.path.insert(1, private_module_path)
import sys
sys.path.insert(1, private_module_path)
import weather
# initialize options and configs
selections = weather.Selections()
get = selections.get
get_bool = selections.get_bool
# this mode just lists the aliases defined in the config
if get_bool("list"): print weather.list_aliases(selections.config)
if selections.get_bool("list"):
print( weather.list_aliases(selections.config) )
# this mode lists details of aliases defined in the config
elif selections.get_bool("longlist"):
print( weather.list_aliases(selections.config, detail=True) )
# this mode builds the correlation data files
elif selections.get_bool("build_sets"):
weather.correlate()
# if no arguments were provided
elif not selections.arguments:
import sys
# substitute defaults if we have any
if selections.config.has_option("default", "defargs"):
sys.argv += selections.config.get("default", "defargs").split(",")
selections = weather.Selections()
# otherwise be helpful
else:
sys.argv += ("--help",)
selections = weather.Selections()
# these modes analyze correlations
if selections.get_bool("info"):
weather.guess(
selections.arguments[0],
path=selections.get("setpath"),
info=selections.get_bool("info"),
cache_search=(
selections.get_bool("cache") \
and selections.get_bool("cache_search")
),
cacheage=selections.getint("cacheage"),
cachedir=selections.get("cachedir")
)
# normal operation
else:
output = ""
for argument in selections.arguments:
if get_bool("conditions", argument) or not (
get_bool("alert", argument) or get_bool("forecast", argument)
):
partial = weather.get_metar(
id=get("id", argument),
verbose=get_bool("verbose", argument),
quiet=get_bool("quiet", argument),
headers=get("headers", argument),
murl=get("murl", argument),
imperial=get_bool("imperial", argument),
metric=get_bool("metric", argument)
)
if partial: output += partial + "\n"
if get_bool("forecast", argument) or not (
get_bool("alert", argument) or get_bool("conditions", argument)
):
partial = weather.get_forecast(
city=get("city", argument),
st=get("st", argument),
verbose=get_bool("verbose", argument),
quiet=get_bool("quiet", argument),
flines=get("flines", argument),
furl=get("furl", argument),
imperial=get_bool("imperial", argument),
metric=get_bool("metric", argument)
)
if partial: output += partial + "\n"
if get_bool("alert", argument) or not (
get_bool("conditions", argument) or get_bool("forecast", argument)
):
alert_text = ""
for atype in get("atypes", argument).split(","):
for zone in get("zones", argument).split(","):
partial = weather.get_alert(
zone=zone,
verbose=get_bool("verbose", argument),
quiet=get_bool("quiet", argument),
atype=atype,
aurl=get("aurl", argument),
imperial=get_bool("imperial", argument),
metric=get_bool("metric", argument)
)
if partial: alert_text += partial + "\n"
if not alert_text: alert_text = "(no current alerts for your zones)\n"
output += alert_text
output = output.strip()
if output: print( output )
output = ""
for argument in selections.arguments:
if selections.get_bool("conditions", argument) or not (
selections.get_bool("alert", argument) \
or selections.get_bool("forecast", argument)
):
partial = weather.get_metar(
uri=selections.get("metar", argument),
verbose=selections.get_bool("verbose", argument),
quiet=selections.get_bool("quiet", argument),
headers=selections.get("headers", argument),
imperial=selections.get_bool("imperial", argument),
metric=selections.get_bool("metric", argument),
cache_data=(
selections.get_bool("cache") \
and selections.get_bool("cache_data")
),
cacheage=selections.getint("cacheage"),
cachedir=selections.get("cachedir")
)
if partial: output += partial + "\n"
if selections.get_bool("forecast", argument) \
or selections.get_bool("alert", argument):
alert_text = ""
if selections.get_bool("alert", argument):
atypes = selections.get("atypes", argument).split(",")
else:
atypes = []
if selections.get_bool("forecast", argument):
atypes = ["zone_forecast"] + atypes
for atype in atypes:
partial = weather.get_alert(
uri=selections.get(atype, argument),
verbose=selections.get_bool("verbose", argument),
quiet=selections.get_bool("quiet", argument),
cache_data=(
selections.get_bool("cache") \
and selections.get_bool("cache_data")
),
cacheage=selections.getint("cacheage"),
cachedir=selections.get("cachedir")
)
if partial:
alert_text += "***** %s *****\n%s\n" % (
atype.replace("_", " ").title(),
partial
)
if not alert_text:
alert_text = "(no current alerts for this zone)\n"
output += alert_text
output = output.strip()
if output: print( output )

258
weather.1
View File

@@ -1,127 +1,215 @@
.TH WEATHER 1 "March 15, 2010" "" \" -*- nroff -*-
\" Copyright (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>.
.TH weather 1 "2012\-06\-24" "2.0" \" -*- nroff -*-
\" Copyright (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>.
\" Permission to use, copy, modify, and distribute this software is
\" granted under terms provided in the LICENSE file distributed with
\" this software.
.SH NAME
weather \- command\-line tool to obtain weather conditions and forecasts
weather \- command-line tool to obtain weather conditions and forecasts
.SH SYNOPSIS
.B weather [ options ] [ alias [ alias [...] ] ]
.B weather
[
.I options
] [
.I alias1
|
.I search1
[
.I alias2
|
.I search2
[...]]]
.SH DESCRIPTION
This utility is intended to provide quick access to current weather
conditions and forecasts. Presently, it is capable of providing data for
localities throughout the United States of America by retrieving and
processing METAR data from the National Oceanic and Atmospheric
Administration and forecasts from the National Weather Service. Behavior
can be determined by command\-line options and specification of zero or
more aliases. Aliases are defined in weatherrc files, as a convenient
means of grouping option combinations together using a short name.
Specifying multiple aliases on the command line causes the utility to
output data for each, as if it had been invoked multiple times. If no
alias is specified, then an alias of "default" is used (assuming it has
been defined) or the built\-in default values are chosen (if it has not).
.
This command-line utility is intended to provide quick access to current
weather conditions and forecasts.
.
Presently, it is capable of returning data for localities throughout the
USA and some select locations globally by retrieving and formatting
decoded METARs (Meteorological Aerodrome Reports) from NOAA (the USA
National Oceanic and Atmospheric Administration) and forecasts/alerts
from NWS (the USA National Weather Service).
.
The tool is written to function in the same spirit as other command-line
informational utilities like \fIcal\fR(1), \fIcalendar\fR(1) and
\fIdict\fR(1).
.
It retrieves arbitrary weather data via precompiled correlations or
custom-tailored aliases (system-wide or on a per-user basis).
Behavior can be determined by command-line options and specification of
zero or more location aliases and search terms.
Aliases are defined in \fIweatherrc\fR(5) files, as a convenient means
of grouping URIs together using a short name.
.
Specifying multiple aliases or location search terms on the command line
causes the utility to output data for each, as if it had been invoked
multiple times.
.
If none are specified, then an alias of \fIdefault\fR is checked for a
\fIdefargs\fR option and any alias names listed within it
(comma-separated) are applied instead.
Searches utilize location correlation sets in INI-style text files named
\fIairports\fR, \fIplaces\fR, \fIstations\fR, \fIzctas\fR and
\fIzones\fR.
.
A precomputed copy is distributed with the source, but can be rebuilt
from updated data sources as needed by placing them in the current
working directory and running with the \fI\-\-build\-sets\fR option (see
the comments at the top of any location correlation set file for
instructions on where to find updated data sources).
.
Positive search results are cached and sourced as aliases on subsequent
runs for as long as the correlation sets remain unchanged, and are
cleared automatically once the correlation sets are updated.
Retrieved data is also cached automatically for a short period of time,
adjustable with the \fIcacheage\fR configuration option or
\fI\-\-cacheage\fR command-line option.
.
This helps throttle load against NOAA/NWS servers in case the utility is
repeatedly re-run requesting the same data, but can be overridden with
the \fIcache_data\fR configuration option or \fI\-\-no\-cache\-data\fR
command-line option.
.
.SH OPTIONS
A summary of options is included below.
.TP
.B \-\-version
.BR \-\-version
show program's version number and exit
.TP
.B \-h, \-\-help
.BR \-h ", " \-\-help
show a help message and exit
.TP
.B \-a, \-\-alert
.BR \-a ", " \-\-alert
include local alert notices
.TP
.B \-\-atypes=ATYPES
alert notification types to display
.BR \-\-atypes =\fIATYPES\fR
list of alert notification types to display (ex:
.BR tornado_warning,urgent_weather_message )
.TP
.B \-\-aurl=AURL
alert URL (including %atype% and %zone%)
.BR \-\-build\-sets
(re)build location correlation sets
.TP
.B \-c CITY, \-\-city=CITY
the city name (ex: "Raleigh Durham")
.BR \-\-cacheage =\fICACHEAGE\fR
duration in seconds to refresh cached data (ex:
.BR 900 )
.TP
.B \-\-flines=FLINES
maximum number of forecast lines to show
.BR \-\-cachedir =\fICACHEDIR\fR
directory for storing cached searches and data (ex:
.BR ~/.weather )
.TP
.B \-f, \-\-forecast
.BR \-f ", " \-\-forecast
include a local forecast
.TP
.B \-\-furl=FURL
forecast URL (including %city% and %st%)
.BR \-\-headers =\fIHEADERS\fR
list of conditions headers to display (ex:
.BR temperature,wind )
.TP
.B \-\-headers=HEADERS
the conditions headers to display
.BR \-\-imperial
filter/convert conditions for US/UK units
.TP
.B \-i ID, \-\-id=ID
the METAR station ID (ex: KRDU)
.BR \-\-info
output detailed information for your search
.TP
.B \-\-imperial
filter/convert for US/UK units
.BR \-l ", " \-\-list
list all configured aliases and cached searches
.TP
.B \-l, \-\-list
print a list of configured aliases
.BR \-\-longlist
display details of all configured aliases
.TP
.B \-m, \-\-metric
filter/convert for metric units
.BR \-m ", " \-\-metric
filter/convert conditions for metric units
.TP
.B \-\-murl=MURL
METAR URL (including %id%)
.BR \-n ", " \-\-no\-conditions
disable output of current conditions
.TP
.B \-n, \-\-no\-conditions
disable output of current conditions (forces \-f)
.BR \-\-no\-cache
disable all caching (searches and data)
.TP
.B \-o, \-\-omit\-forecast
omit the local forecast (cancels \-f)
.BR \-\-no\-cache\-data
disable retrieved data caching
.TP
.B \-\-quiet
.BR \-\-no\-cache\-search
disable search result caching
.TP
.BR \-q ", " \-\-quiet
skip preambles and don't indent
.TP
.B \-s ST, \-\-st=ST
the state abbreviation (ex: NC)
.BR \-\-setpath =\fISETPATH\fR
directory search path for correlation sets (ex:
.BR .:~/.weather )
.TP
.B \-v, \-\-verbose
show full decoded feeds (cancels \-q)
.TP
.B \-z ZONES, \-\-zones=ZONES
alert zones (ex: nc/ncc183,nc/ncz041)
.SH FILES
.B weather
may additionally obtain configuration data from a system\-wide
configuration file, a per\-user configuration file, and a local
directory configuration file. The file format and configuration options
are described in
.BR weatherrc (5) .
They are aggregated in the following order:
.TP
.B /etc/weatherrc
the system\-wide configuration
.TP
.B ~/.weatherrc
the per\-user configuration (can be used to override the above)
.TP
.B ./weatherrc
the local directory configuration (can be used to override the above)
.BR \-v ", " \-\-verbose
show full decoded feeds
.SH EXAMPLES
.TP
.B weather
View output for the defined default alias, or the built-in default values
if there is no default alias defined in the configuration files.
View output for the default alias, if one has been defined (otherwise
display usage/syntax similar to \-\-help)
.TP
.B weather -i kavl
Display current conditions at the KAVL METAR station.
.BR weather " " rdu
Display weather conditions at the airport with IATA/FAA code \fIRDU\fR.
.TP
.B weather -n -c asheville -s nc
See a forecast for the Asheville, NC area.
.BR weather " " \-\-info " " raleigh
Show a list of FIPS codes for United States Census Bureau places
containing the word \fIraleigh\fR (or the proximity information if only
one match was found).
.TP
.B weather -fv gso
Get the full decoded METAR for the station associated with the gso alias,
and the forecast data for the city/state associated with the gso alias,
without filtering or fancy formatting.
.BR weather " " \(dq ^ral[ie]{2}gh " " city.*nc$ \(dq
Get the current weather conditions from the nearest station to the
Census place name matching the regular expression provided.
.TP
.B weather home work
Show current conditions for both the home and work aliases in that order.
.SH SEE ALSO
.BR weatherrc (5)
.BR weather " " \-fv " " fips3755000
Get the full decoded METAR from the nearest station, and the forecast
data for the nearest zone to the Census place with FIPS code
\fI3755000\fR with no special filtering or formatting.
.TP
.BR weather " " \-\-forecast " " \-\-no\-cache\-data " " 27613
Ignore any recent cached METAR or forecast data and display fresh output
for the nearest station and zone to the Census ZCTA (essentially USPS
ZIP code) \fI27613\fR.
.TP
.BR weather " " home " " work
Show current conditions for both the \fIhome\fR and \fIwork\fR aliases
in that order.
.TP
.BR weather " " 35.878573,\-78.727813
.TP
.BR weather " " 35\-52\-43n,78\-43\-40w
.TP
.BR weather " " \(dq 35\-52n, " " 78\-43w \(dq
Display weather conditions for the nearest station to an arbitrary set
of global coordinates in latitude,longitude order either in decimal
format or degree, degree\-minute or degree\-minute\-second formats,
optionally using signed or cardinal hemisphere designations with or
without spacing.
.
Note that the cut-off for maximum acceptable distance is hard-coded at
0.1 radians (roughly 637km or 396mi).
.
.SH INPUT FILES
.
.B weather
may additionally obtain configuration data from a system-wide
configuration file, a per-user configuration file, and a local
directory configuration file.
.
The file format and configuration options are described in
.IR weatherrc (5).
.
They are aggregated in the following order:
.TP
.I /etc/weatherrc
the system-wide configuration
.TP
.IR ~/.weather/weatherrc " or " ~/.weatherrc
the per-user configuration
.TP
.I ./weatherrc
the local directory configuration
.SH AUTHOR
Utility and manual written by Jeremy Stanley <fungi@yuggoth.org>.
.SH SEE ALSO
.IR weatherrc (5)

2541
weather.py

File diff suppressed because it is too large Load Diff

1116
weatherrc

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
.TH WEATHERRC 5 "March 15, 2010" "" \" -*- nroff -*-
\" Copyright (c) 2006-2010 Jeremy Stanley <fungi@yuggoth.org>.
.TH weatherrc 5 "2012\-06\-24" "2.0" \" -*- nroff -*-
\" Copyright (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>.
\" Permission to use, copy, modify, and distribute this software is
\" granted under terms provided in the LICENSE file distributed with
\" this software.
@@ -8,114 +8,109 @@ weatherrc \- configuration file format for the
.BR weather (1)
utility
.SH DESCRIPTION
The weatherrc file format is intended to specify a set of macros
by which to group a METAR station ID for current conditions data with a
city/state combination for a forecast, but many of the other
command\-line options and flags for the weather utility can be specified
as well. The file is organized as an INI-format config, with the alias
name in [] brackets and the associated parameter/value pairs on following
lines. Parameters and their values as separated by = or : characters.
.
The \fIweatherrc\fR file format is intended to specify a set of aliases
by which to group URIs for METAR station conditions and alert/forecast
zones, but other command-line options and flags for the weather utility
can be specified as well.
.
The file is organized as an INI-format config, with the alias name in []
brackets and the associated parameter/value pairs on following lines.
.
Parameters and their values are separated by = or : characters.
.
Multi-word values do not need quoting.
.SH PARAMETERS
.
These parameters are supported...
.TP
.B alert
include local alert notices
include local alert notices (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B atypes
alert notification types to display
list of alert notification types to display (ex:
.BR tornado_warning,urgent_weather_message )
.TP
.B aurl
alert URL (including %atype% and %zone%)
.B cache
control all caching (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B city
the city name (ex: Raleigh Durham)
.B cache_data
control retrieved data caching (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B cache_search
control search result caching (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B cacheage
duration in seconds to refresh cached data (ex:
.BR 900 )
.TP
.B cachedir
directory for storing cached searches and data (ex:
.BR ~/.weather )
.TP
.B conditions
output current conditions (possible values are False and True or 0 and 1)
output current conditions (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B flines
maximum number of forecast lines to show (integer value, 0 means unlimited)
.B defargs
list of default command-line arguments (ex:
.BR avl,rdu )
.TP
.B forecast
include a local forecast (possible values are False and True or 0 and 1)
.TP
.B furl
forecast URL (ex: http://forecast.org/%st%/%city%.txt)
include a local forecast (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B headers
the conditions headers to display (ex: temperature,wind)
.TP
.B id
the METAR station ID (ex: KRDU)
list of conditions headers to display (ex:
.BR temperature,wind )
.TP
.B imperial
filter/convert for US/UK units
filter/convert conditions for US/UK units (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B metric
filter/convert for metric units
.TP
.B murl
METAR URL (ex: http://metar.org/%id%.txt)
filter/convert conditions for metric units (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B quiet
skip preambles and don't indent (possible values are False and True or 0 and 1)
skip preambles and don't indent (possible values are
.BR False " and " True " or " 0 " and " 1 )
.TP
.B st
the state abbreviation (ex: NC)
.B setpath
directory search path for correlation sets (ex:
.BR .:~/.weather )
.TP
.B verbose
show full decoded feeds (possible values are False and True or 0 and 1)
.TP
.B zones
alert zones (ex: nc/ncc183,nc/ncz041)
.SH URL FORMAT
The placeholders %city% and %st% in the furl URL and %id% in the murl URL
will be replaced with the city, st and id definitions respectively. If the
placeholder has all letters lowercased, the replacement will be forced to
all lowercase. If the placeholder has all letters uppercased, the
replacement will be forced to all uppercase. If the placeholder has its
first letter uppercased and the remainder lowercased, then all words in the
replacement will start with an uppercase letter and the rest will be
lowercase. If the placeholder has its last letter uppercased and the
remainder lowercased, then case will be preserved in the replacement. Also,
after replacement, any spaces in the resulting URL will be converted to
underscore characters prior to use.
show full decoded feeds (possible values are
.BR False " and " True " or " 0 " and " 1 )
.SH EXAMPLES
Following is an example
.B ~/.weatherrc
defining the default settings to be used when running the utility with no
aliases specified, and a couple definitions for aliases named home and
work...
The following is an example \fI~/.weather/weatherrc\fR defining a couple
aliases named home and work to be displayed when running the utility
with no aliases specified...
.P
.RS
.in 0
.nf
[default]
.br
City = Asheville
.br
Forecast = True
.br
ID = KAVL
.br
St = NC
.P
defargs = home,work
[home]
.br
City = Raleigh Durham
.br
ID = KRDU
.br
St = NC
.P
description = Conditions and Forecast at Home
forecast = True
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/KRDU.TXT
zone_forecast = http://weather.noaa.gov/pub/data/forecasts/zone/nc/ncz041.txt
[work]
.br
City = Greensboro
.br
ID = KGSO
.br
St = NC
.RE
.SH SEE ALSO
.BR weather (1)
description = Conditions at Work
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/KGSO.TXT
.fi
.P
Now if
.B weather is invoked by itself on the command line, it will output
conditions for home and work, and also a forecast for home only.
.SH AUTHOR
Specification and manual written by Jeremy Stanley <fungi@yuggoth.org>.
.SH SEE ALSO
.BR weather (1)

165631
zctas Normal file

File diff suppressed because it is too large Load Diff

3578
zlist Normal file

File diff suppressed because it is too large Load Diff

96205
zones Normal file

File diff suppressed because it is too large Load Diff