forked from mate-academy/claude-ship-a-change-end-to-end
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.txt
More file actions
58 lines (43 loc) · 1.91 KB
/
Copy pathreadme.txt
File metadata and controls
58 lines (43 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Finland Weather CLI
====================
A terminal application that prints current weather statistics for major
cities in Finland: Helsinki, Espoo, Tampere, Vantaa, Oulu, Turku,
Jyvaskyla, and Lahti.
Weather data comes from Open-Meteo (https://open-meteo.com), a free
service that requires no API key or signup. The script uses only the
Python standard library, so there is nothing to install.
Requirements
------------
- Python 3.x
- An internet connection (to fetch live weather data)
- No pip installation needed - the script uses only the Python standard
library, so there are no third-party packages to install
Usage
-----
Run from inside the weather_app folder:
python weather.py
This prints a table with current temperature, feels-like temperature,
humidity, wind speed/direction, and conditions for all cities.
To see detailed stats for a single city, pass its name as an argument
(case-insensitive):
python weather.py tampere
python weather.py Helsinki
If the city name is not recognized, the script prints the list of valid
city names and exits with a non-zero status.
To see a 7-day forecast instead of current conditions, add the -f (or
--forecast) flag. It works both with a single city and with all cities:
python weather.py Helsinki --forecast
python weather.py -f
Each forecast shows, per day: condition, high/low temperature, total
precipitation, and max wind speed.
By default, temperatures are shown in Celsius. Use -u (or --units) to
show Fahrenheit instead. This works with any of the modes above:
python weather.py -u fahrenheit
python weather.py Helsinki -u fahrenheit
python weather.py Helsinki -f -u fahrenheit
Notes
-----
- If a city's data cannot be fetched (e.g. no internet connection), the
script prints an error for that city instead of crashing.
- Non-ASCII city names (like Jyvaskyla) are displayed correctly even on
Windows terminals that don't default to UTF-8.