Repository navigation
v0.3.0
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()andDpcClient.get_vigilance_map()return
aCriticalityMapor aVigilanceMap: the files of a bulletin, downloaded
once. Theirat(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
DpcLocationErrorfor 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()andget_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.