The free maxminddb geolite2 does fine for most cases, too. Nice and easy-to-use python module to go with it. I'm pretty sure the city one is ~100MB, so doable to keep a copy on-device.
If the requirements are less strict then using a local db like MaxMind would be the right choice.
As a side note, we offer very simple and well documented libraries in C#, Typescript and PHP.