diff --git a/pyproject.toml b/pyproject.toml index e9239cb..41bc9bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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] diff --git a/src/yodapa/plugins/weather.py b/src/yodapa/plugins/weather.py new file mode 100644 index 0000000..8cbc10c --- /dev/null +++ b/src/yodapa/plugins/weather.py @@ -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)