Skip to content

cuducos/wed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather on the Event Day Tests Linters

wed's idea is to automate something I do pretty often: once I register for a run or triathlon event, I frequently check the city's weather forecast for the race's date and time in the previous days.

Install

With cargo installed:

$ cargo install --path .

Use cases

wed and its sub-commands that output weather information accept the options --units, --json and --verbose before the subcommand (e.g. wed --json or wed --json forecast "Ottawa, ON" "2022-07-09 09:00").

Try wed --help for details.

Weather forecast for any location, date and time

Run wed forecast with two arguments:

$ wed forecast "Ottawa, ON" "2022-07-09 09:00"
🌤 26°C (feels like 27°C)  ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W
Or with a JSON output:
$ wed --json forecast "Ottawa, ON" "2022-07-09 09:00"
{
    "name": null,
    "location": "Ottawa, CA",
    "units": "Metric",
    "icon": "\u26c5",
    "date": "2023-05-28 07:00:00",
    "weather_code": 3,
    "probability_of_precipitation": 13,
    "temperature": 17.4,
    "feels_like": 17.8,
    "humidity": 90,
    "wind_speed": 10.8,
    "wind_direction": 244
}

Save an event

Run wed save with three arguments:

$ wed save "National Capital Triathlon" "Ottawa, ON" "2022-07-09 09:00"
🌤 26°C (feels like 27°C)  ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W

Weather forecast for saved events

Run wed with no sub-command or arguments:

$ wed
🗓 National Capital Triathlon (Jul 7, 09:00) 🌐 Ottawa, ON, Canada
🌤 26°C (feels like 27°C) ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W
Or with a JSON output:
$ wed --json
[
    {
        "name": null,
        "location": "Ottawa, CA",
        "units": "Metric",
        "icon": "\u26c5",
        "date": "2023-05-28 07:00:00",
        "weather_code": 3,
        "probability_of_precipitation": 13,
        "temperature": 17.4,
        "feels_like": 17.8,
        "humidity": 90,
        "wind_speed": 10.8,
        "wind_direction": 244
    }
]

macOS notification

$ wed notify

Running this command on a non-macOS system will output the same information as wed --json notify:

$ wed --json notify
{
    "title": "🗓️ Formula Run (Jun 11, 09:00)",
    "subtitle": "🌐 Ottawa, ON, Canada",
    "body": "⛅ 18°C (feels like 17°C)\n☔ 0% chance of rain & 69% humidity\n💨 9km/h E"
}

Delete a saved event

Run wed delete with one argument, the name of the event:

$ wed delete "National Capital Triathlon"

List all saved events

Run wed list with no arguments.

Data

Sources

Persistence

  • Saved events are saved in a simple file ~/.wed.json
  • The app automatically deletes past events when the app is run
  • The app ignores events that are more than 5 days ahead

About

🌤 Track the weather for event days

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages