Skip to content

Commit

Permalink
add weather plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsal-afk committed Oct 15, 2024
1 parent 2b755aa commit 83b6ca2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ homepage = "https://yoda-pa.github.io/yoda"

[tool.poetry.dependencies]
python = "^3.9"
typer = "^0.12.5"
pyyaml = "^6.0.2"
mkdocs = "^1.6.1"
mkdocs-material = "^9.5.39"
Expand All @@ -25,6 +24,7 @@ sqlmodel = "^0.0.22"
requests = "^2.32.3"
speedtest-cli = "^2.1.3"
python-whois = "^0.9.4"
typer = "^0.12.5"


[tool.poetry.group.docs.dependencies]
Expand Down
14 changes: 14 additions & 0 deletions src/yodapa/plugins/weather.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import requests
import click
import typer

app = typer.Typer()

@app.command()
def get_weather(location):
location_id = location.strip().replace(" ", "+")

weather_service = "http://wttr.in/"

response = requests.get(weather_service + location)
click.echo(response.text)

0 comments on commit 83b6ca2

Please sign in to comment.