fpweather – a console application displaying weather information for your city using OpenWeatherMap API
Author: Paul Lipkowski
- Required:
- FreePascal Compiler
fpc
(version 3.0.4 or newer) - an OpenWeather API token (get it here if you don't have one)
- FreePascal Compiler
- If using Linux, then just compile by executing
compile.sh
- Then you can install fpweather to
$PATH
usinginstallBash.sh
- Then you can install fpweather to
- If using Windows, then compile by executing
compile.bat
- The default version of FPC is 3.0.4. If you use the another version of it, then edit the
compile.bat
script and change the setting containing version of FPC (variablever
) in order to match your FPC version.
- The default version of FPC is 3.0.4. If you use the another version of it, then edit the
- After compilation you can run
fpweather
to set up the app config file (if it does not exist)
fpweather
– shows weather of your city using your OpenWeatherMap API token in a compact readable formatfpweather [flags]
-c
or--config
– Launch config-e
or--emoji
– Display emojis in output (to be implemented)-h
or--help
– Display help-j
or--json
– Print a flat JSON (to be improved)-J
or--JSON
– Print a beautified JSON (to be improved)-l
or--location
– Overwrite the city for the particular program execution-n
or--no-feed-line
– Don't feed the line after the execution of the program-o S
or--output=S
– Adjust the output data you want to be displayed--raw-json
– Print a raw JSON from OpenWeatherMap (it returns the result in international SI units only)-s N
or--style=N
– Determine the style of the output-t N
or--time=N
– Display weather data for theN
th day after today (to be implemented,N
may be negative, so then it would display weather fromN
days ago)-T S
or--token=S
– Overwrite the OpenWeather API token for the particular program execution-u N
or--units=N
– Change output units (N = [0, 1, 2, 3]
, see the list of values below)
Notes:
- Cities with names containing spaces must be quoted, e.g.
-l "Tel Aviv"
or--location="Bnei Brak"
Available chars for S
string used in the -o
/--output
flag: (chars may be concatenated)
+
– add default settings (equivalent ofS = abcdefg
)a
– add locationb
– add datec
– add weather descriptiond
– add current temperatureD
– add current temperature and also the lowest and the highest temperature for the daye
– add atmospheric pressuref
– add humidityg
– add wind speedG
– add wind speed and directionh
– add visibility distance
You can use one of the following options for preset output setups:
S = default
is an equivalent ofS = abcdefg
orS = +
, i.e. default displayS = basic
is an equivalent ofS = acdef
S = medium
is an equivalent ofS = abcdefgh
orS = +h
S = high
is an equivalent ofS = abcdefGh
orS = +Gh
S = full
is an equivalent ofS = abcDefGh
orS = +DGh
, i.e. full display
N
values for -s
/--style
flag:
N = 0
– print flat stringN = 1
– print flat output, except for location being in a separate line (default)N = 2
– same asN = 1
, but with labelsN = 3
– print every value in a separate line (a list of values)N = 4
– print every value in a separate line, and all its subvalues as well
N
values for -u
/--units
flag:
N = 0
– 🇺🇳 International SI system (Kelvin, m/s and hPa)N = 1
– 🇪🇺 Metric units (Celsius, km/h and hPa; m/s on JSON output)N = 2
– 🇺🇸 US units (Fahrenheit, mph and psi; hPa on JSON output)N = 3
– 🇬🇧 UK units (Celsius, mph and mb) – so far it works likeN=1
on JSON output
fpweather
shows the current weather of your city using your OpenWeatherMap API token in a compact readable formatfpweather -c
launches configfpweather -l "Tel Aviv"
shows the current weather in Tel Aviv, IL.fpweather -u 3
displays weather info of your city using the British locale (Celsius, mph, millibars)fpweather -s 4 -u 1 -l Skopje
displays weather of Skopje in a bulleted list using Metric unitsfpweather -s 4 -u 1 -o +DG -l Bydgoszcz
displays weather of Bydgoszcz in a bulleted list using Metric units and adds both wind direction and min/max temperaturefpweather --style=3 --units=1 --output=+DG --location=Bydgoszcz
does the same as abovefpweather -s 0 -u 1 -o D -l Gdynia
displays the full temperature info of Gdynia in a flat string using Metric unitsfpweather -s 4 -u 1 -o +DGh -l Gdynia
displays the full info of Gdynia in a flat string using Metric unitsfpweather -s 4 -u 1 -o full -l Gdynia
does the same as above
Note that the plans may change or be cancelled at all.
- Checking the weather forecast for the next few days
- Weather history
- Improved JSON output
- Integration with other console apps (maybe)