In case it helps give ideas, here is some code I wrote to download/parse/query the SRTM (shuttle radar tomography mission) elevation data which has pretty good coverage and quality globally from about -60 to +60 latitude. There's a lot of extra junk in there too for my particular use case ... which made sense to me at the time. I'd have to stare at it for a minute now to answer questions, but it still works for it's purpose.
https://github.com/NorthStarUAS/Simulator/blob/main/nstSimulator/world/srtm2.py