I would like to create a distance map using OpenStreetMap objects as input objects. To explain what I mean with distance map, let's look at the wikipedia definition:

A distance transform, also known as distance map or distance field, is a derived representation of a digital image. [...]
The map labels each pixel of the image with the distance to the nearest obstacle pixel.

Imagine, for example, one wants to create a distance map for Sweden, indicating the distance for each pixel to the nearest alcohol takeway (OSM key: shop, OSM value: alcohol). This would require the following steps:

Gather all OSM data for the area inside the country borders of Sweden

Define pixel spacing of desired raster map (e.g. 1m or 1 km etc.)

Calculate distance for every pixel of that map to nearest alcohol shop OSM map feature using a to-be-defined distance metric (e.g. Euclidian distance)

While I have a clear conceptual idea of how to do it, I don't know where to start implementation-wise.

Is there a good Python API that allows to do such a thing without too much overhead?