weathergrabber 0.0.7a1__py3-none-any.whl → 0.0.7a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ """weathergrabber - Python interface and CLI for weather.com data."""
2
+
3
+ from .core import main
4
+ from .cli import main_cli
5
+
6
+ __all__ = ["main", "main_cli"]
7
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ """weathergrabber CLI entry point."""
2
+ from .cli import main_cli
3
+ if __name__ == "__main__":
4
+ main_cli()
weathergrabber/cli.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import argparse
2
2
  import os
3
- from .core import main
3
+ from weathergrabber import main
4
4
 
5
5
  def main_cli():
6
6
  ## Get current locale, or use the default one
@@ -7,6 +7,7 @@ class WeatherIconEnum(Enum):
7
7
  CLOUDY_FOGGY_DAY = ('cloudy-foggy-day', chr(0xF013), '🌥️')
8
8
  CLOUDY_FOGGY_NIGHT = ('cloudy-foggy-night', chr(0xF013), '🌥️')
9
9
  DAY = ('day', '\uf185', '🌞')
10
+ DRIZZLE = ('drizzle', '\uf0e9', '🌦️')
10
11
  FEEL = ('feel', '\uf2c9', '🥵')
11
12
  FOGGY = ('foggy', '\uf74e', '🌫️')
12
13
  HUMIDITY = ('humidity', '\uf043', '💧')
@@ -59,11 +59,13 @@ class UseCase:
59
59
  try:
60
60
  hourly_predictions = self.extract_hourly_forecast_service.execute(weather_data)
61
61
  except ValueError:
62
+ self.logger.warning("Falling back to old style hourly forecast extraction")
62
63
  hourly_predictions = self.extract_hourly_forecast_oldstyle_service.execute(weather_data)
63
64
 
64
65
  try:
65
66
  daily_predictions = self.extract_daily_forecast_service.execute(weather_data)
66
67
  except ValueError:
68
+ self.logger.warning("Falling back to old style daily forecast extraction")
67
69
  daily_predictions = self.extract_daily_forecast_oldstyle_service.execute(weather_data)
68
70
 
69
71
  forecast = Forecast(
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weathergrabber
3
- Version: 0.0.7a1
3
+ Version: 0.0.7a2
4
4
  Summary: A grabber for weather.com data with various output formats.
5
5
  Author-email: Carlos Anselmo Mendes Junior <cjuniorfox@gmail.com>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: homepage, https://github.com/cjuniorfox/weather
8
8
  Project-URL: repository, https://github.com/cjuniorfox/weather
9
9
  Requires-Python: >=3.12
@@ -140,7 +140,21 @@ weathergrabber [location_name] [options]
140
140
  Or as a Python module:
141
141
 
142
142
  ```sh
143
- python -m weathergrabber.cli [location_name] [options]
143
+ python -m weathergrabber [location_name] [options]
144
+ ```
145
+
146
+ ### Importing as a Python module
147
+
148
+ You can also use the main API or CLI entry point in your own Python code:
149
+
150
+ ```python
151
+ import weathergrabber
152
+
153
+ # Call the main API
154
+ weathergrabber.main(log_level="INFO", location_name="London", location_id="", lang="en-GB", output="console", keep_open=False, icons="emoji")
155
+
156
+ # Or run the CLI programmatically
157
+ weathergrabber.main_cli()
144
158
  ```
145
159
 
146
160
  ### Arguments
@@ -172,7 +186,7 @@ weathergrabber "Paris" -o waybar -i fa
172
186
  Or as a Python module:
173
187
 
174
188
  ```sh
175
- python -m weathergrabber.cli "London" --output console --lang en-GB
176
- python -m weathergrabber.cli --location-id 1234567890abcdef... --output json
177
- python -m weathergrabber.cli "Paris" -o waybar -i fa
189
+ python -m weathergrabber "London" --output console --lang en-GB
190
+ python -m weathergrabber --location-id 1234567890abcdef... --output json
191
+ python -m weathergrabber "Paris" -o waybar -i fa
178
192
  ```
@@ -1,5 +1,6 @@
1
- weathergrabber/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- weathergrabber/cli.py,sha256=QzBqR4N70W1bSfrSngQAL79vfY8_h8U8s5-LRzzesKo,1970
1
+ weathergrabber/__init__.py,sha256=ZIzvBQBCry-C_ieN_oSQpTYfFeUOOi-ymjYNNqje1uw,173
2
+ weathergrabber/__main__.py,sha256=K10wQv3-LSRD_FRLHWphdSs3OAcuzIb4sQaKmj7Fql0,105
3
+ weathergrabber/cli.py,sha256=YOWoVLfwktgqK1bp89GUKkAEKyMM4DaNL4akBi6xVVk,1979
3
4
  weathergrabber/core.py,sha256=TiZ2utmYKf9lkIXWv8YBfSdiHZXJZXuHS8B-dBDvevw,1138
4
5
  weathergrabber/weathergrabber_application.py,sha256=2JfZAR94En3rmGrYKWRKxdRXmK_ikhJdgrGotFjtDys,3987
5
6
  weathergrabber/adapter/client/weather_api.py,sha256=9S7JmXaAVvvPY60dz6rC3lx7X68BcqyvNzvSVM1-af8,963
@@ -26,7 +27,7 @@ weathergrabber/domain/temperature_hight_low.py,sha256=PQOJ5uDtfMRBR5yMxXA46xuorJ
26
27
  weathergrabber/domain/timestamp.py,sha256=Bk6f8Tx0-yNitYmEKIWHnqh_ALDwxEHrhoCRSrfvYTU,1222
27
28
  weathergrabber/domain/today_details.py,sha256=EUlV7xerYw5QhEsBfvO5m6-9Ghm4nPkXJz9zCmSYTbA,2398
28
29
  weathergrabber/domain/uv_index.py,sha256=lNdk38Jq-A9msuzOLjIKrZIHUc2C9J8V4MA7HU3s1ZM,1420
29
- weathergrabber/domain/weather_icon_enum.py,sha256=t2JEsZWKqFscEq5_NS1Ti6regQDjpjrGGzmvMBvZGjw,2649
30
+ weathergrabber/domain/weather_icon_enum.py,sha256=tAaN6w9g3ZcwB5KLN5ivjO7Hp_C1tBynSkyxRQaChTI,2696
30
31
  weathergrabber/domain/wind.py,sha256=wTDz3X1rYsnw_eNoDi1miwaomxwhiJkY_q6xrdZtLak,789
31
32
  weathergrabber/domain/adapter/icon_enum.py,sha256=YxGYS5vBRV2AiAfeuPOdqaQOHixAssiMbOzQnTmdSBg,84
32
33
  weathergrabber/domain/adapter/output_enum.py,sha256=61iR10ppY8DNALPKV-vLnDQni5HxEzpoRNZbdBdRygk,117
@@ -62,10 +63,10 @@ weathergrabber/service/extract_temperature_service.py,sha256=46nRO3Izj1QmG4BNTh8
62
63
  weathergrabber/service/extract_today_details_service.py,sha256=QAwF7EzVaL1STGNDyxve9r7oQTjvNKhYQ53d_68lbKA,4126
63
64
  weathergrabber/service/read_weather_service.py,sha256=7_B8E9IN1KCwOhpuS5PfWazI1sCrDyYrZhkV2R38bhc,649
64
65
  weathergrabber/service/search_location_service.py,sha256=tZmVgO45hjwoa4cl5bKPjMBmYlGxJiH_I9Ymb5pwEwU,1422
65
- weathergrabber/usecase/use_case.py,sha256=wmNmJSiy0t00-KaxQqSryiu0keX0kI4PcLI2hBBHT_0,4460
66
- weathergrabber-0.0.7a1.dist-info/licenses/LICENSE,sha256=X5JFljoqN43yFwpMLudQ9rtty4K_FeZfnz3v8Yhw23Q,1067
67
- weathergrabber-0.0.7a1.dist-info/METADATA,sha256=iUhLmkb-bnuUgGeO11Xdho5Hstq0tZWX8OSyFSdYxgg,5442
68
- weathergrabber-0.0.7a1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- weathergrabber-0.0.7a1.dist-info/entry_points.txt,sha256=m2P9a4mrJDTzuNaiTU438NA60GxCfaw7VKvruWw43N8,63
70
- weathergrabber-0.0.7a1.dist-info/top_level.txt,sha256=P3NMDJJYRIvQujf994Vb4gZrobkKWkL2gh3NF_ajQWM,15
71
- weathergrabber-0.0.7a1.dist-info/RECORD,,
66
+ weathergrabber/usecase/use_case.py,sha256=K2RBIEi7S0ixAM6oDKmCPYkuJ9azatxle8zAqX0xM1E,4635
67
+ weathergrabber-0.0.7a2.dist-info/licenses/LICENSE,sha256=X5JFljoqN43yFwpMLudQ9rtty4K_FeZfnz3v8Yhw23Q,1067
68
+ weathergrabber-0.0.7a2.dist-info/METADATA,sha256=J2-5LBiUVjhvV1-cwVN4v_0mFQGzunE3w4I37mRug2o,5807
69
+ weathergrabber-0.0.7a2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ weathergrabber-0.0.7a2.dist-info/entry_points.txt,sha256=m2P9a4mrJDTzuNaiTU438NA60GxCfaw7VKvruWw43N8,63
71
+ weathergrabber-0.0.7a2.dist-info/top_level.txt,sha256=P3NMDJJYRIvQujf994Vb4gZrobkKWkL2gh3NF_ajQWM,15
72
+ weathergrabber-0.0.7a2.dist-info/RECORD,,