Get exif data for all files in a folder

Goal: Generate a json for every folder with all the gps data of all the images in the folder.

import json
from exif import get_location
from pathlib import Path
import exifread

base = Path("images")
for folder in sorted(base.glob("201*")):
    if folder.is_dir():
        gps_data = {}
        json_fn = folder / "gps.json"
        if json_fn.exists():
        for fn in sorted(folder.glob("*.JPG"):
            with open(folder / fn, "rb") as f:
               gps_data[] = get_location(exifread.process_file(f))
        if gps_data:
           json.dump(gps_data, open(json_fn, "w"))

this code uses get_location from this blog post:

Plot on an OSM map using Python

I want to plot a circle (and later possible a lot of circles) on a static openstreetmap map.
The library best suited seems staticmap from komoot:

This code plots a circle on a map of Stuttgart-Vaihingen:

from staticmap import StaticMap, CircleMarker
m = StaticMap(200, 200)

marker = CircleMarker((9.1065541, 48.7324794), '#0036FF', 5)

image = m.render(zoom=15)'marker.png')

I want to generate quite some images on a large map so I added a cache to the tiles system in staticmap: