Skip to content

v0.3.0

Choose a tag to compare

@webysther webysther released this 14 Nov 22:40

Several places now cost a single download: get the bulletin of the whole of
Italy once, then read it at each place.

criticality = await dpc.get_criticality_map()
vigilance = await dpc.get_vigilance_map()

for place in (home, office):
    print(criticality.at(place).today)
    print(vigilance.at(place, phenomena_within_km=20).today)

Added

  • DpcClient.get_criticality_map() and DpcClient.get_vigilance_map() return
    a CriticalityMap or a VigilanceMap: the files of a bulletin, downloaded
    once. Their at(location) returns the bulletin of a location without any
    request; on the vigilance map, each reading takes its own
    phenomena_within_km. A location outside every zone raises
    DpcLocationError for that location only.
  • aiodpc.parsers.GeoJsonFeatures: a DPC GeoJSON file checked once. The parse
    functions accept it in place of the decoded GeoJSON.
  • aiodpc.parsers.check_phenomena_distance().

Changed

  • get_criticality() and get_vigilance() read a map, with the same results.
  • The JSON files are decoded in a worker thread: they are several MB each, and
    decoding them blocked the event loop.