aioarpapiemonte 0.1.0__tar.gz → 0.1.1__tar.gz

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.
Files changed (30) hide show
  1. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/PKG-INFO +1 -1
  2. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/__init__.py +1 -1
  3. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/parsers.py +6 -1
  4. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/test_parsers.py +3 -0
  5. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/.gitignore +0 -0
  6. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/LICENSE +0 -0
  7. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/README.md +0 -0
  8. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/pyproject.toml +0 -0
  9. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/_http.py +0 -0
  10. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/client.py +0 -0
  11. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/const.py +0 -0
  12. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/exceptions.py +0 -0
  13. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/models.py +0 -0
  14. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/py.typed +0 -0
  15. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/src/aioarpapiemonte/urls.py +0 -0
  16. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/__init__.py +0 -0
  17. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/conftest.py +0 -0
  18. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/data_pie_188.json +0 -0
  19. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/data_pie_999.json +0 -0
  20. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/idro_002105900.geojson +0 -0
  21. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/igro_001022905.geojson +0 -0
  22. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/nivo_001019900.geojson +0 -0
  23. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/pie_anag.json +0 -0
  24. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/pluv_001013900.geojson +0 -0
  25. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/sensors.geojson +0 -0
  26. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/status.json +0 -0
  27. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/fixtures/real/terma_002105900.geojson +0 -0
  28. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/server.py +0 -0
  29. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/test_client.py +0 -0
  30. {aioarpapiemonte-0.1.0 → aioarpapiemonte-0.1.1}/tests/test_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: aioarpapiemonte
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Async client for the real-time data of the stations of Arpa Piemonte: river levels, rain, temperature and snow, from its website files and its api_realtime
5
5
  Project-URL: Homepage, https://github.com/webysther/aio-arpa-piemonte
6
6
  Project-URL: Changelog, https://github.com/webysther/aio-arpa-piemonte/blob/main/CHANGELOG.md
@@ -63,4 +63,4 @@ __all__ = [
63
63
  "station_page_url",
64
64
  ]
65
65
 
66
- __version__ = "0.1.0"
66
+ __version__ = "0.1.1"
@@ -45,6 +45,11 @@ THRESHOLD_KEYS: Final = (
45
45
  )
46
46
  """Thresholds in the level files (``idro``), in that order; with a hyphen."""
47
47
 
48
+ _EMPTY_TEXTS: Final = frozenset({"", "-"})
49
+ """Texts written for a missing value: the api_realtime gives the river of the
50
+ 264 stations without a hydrometer as "-" (``river_name``, measured on
51
+ 2026-11-17), as Meteo 3R does."""
52
+
48
53
 
49
54
  def parse_sensors(data: object) -> tuple[Sensor, ...]:
50
55
  """Return the stations of the list of the website (``sensors.geojson``).
@@ -331,7 +336,7 @@ def _mapping(value: object, what: str) -> Mapping[str, object]:
331
336
  def _text(record: Mapping[str, object], key: str) -> str | None:
332
337
  """Return a text of a record, stripped; None when missing or empty."""
333
338
  value = record.get(key)
334
- if not isinstance(value, str) or not value.strip():
339
+ if not isinstance(value, str) or value.strip() in _EMPTY_TEXTS:
335
340
  return None
336
341
  return value.strip()
337
342
 
@@ -205,6 +205,9 @@ class TestRealtime:
205
205
  assert pray.thresholds == Thresholds(2.3, 3.0, 3.8)
206
206
  assert pray.hydrometric_zero == 400.7
207
207
  assert pray.river == "SESSERA"
208
+ rain_gauge = next(s for s in stations if s.station_code == "001")
209
+ assert rain_gauge.river is None
210
+ assert sum(station.river is None for station in stations) == 264
208
211
 
209
212
  def test_station_identifier(self) -> None:
210
213
  """Test the identifier on the website, from text or broken values."""
File without changes