InkyFrame and Large Json Responses

Hi,

I want to use the InkyFrame with the Pirate Weather API (Pirate Weather) . However, this returns a response of over 100K, which is too large to use with the json library as it loads everything into memory.

Can anybody suggest an alternative? My ideas so far are:

1.) Write a server to proxy the requests and compress them into a more sane format, maybe proto buffers or similar.
2.) Port json-stream to micropython. I hoped someone had done this but I can’t find it.
3.) Write my own hacky json parser

All of these are annoying and involve extra work. I’m hoping there’s a clever solution I’ve missed that just works.

Thanks,

Martin

Three more options:

  • ask Pirate Weather to extend the api (options to reduce the response-size to the needed)
  • use some other weather-api (e.g. meteo)
  • have a look at the circuitpython implementation of the json parser. Maybe porting this to micropython is less work than writing your own.

BTW: I went the route of your first option with a different project (calendar data). I lifted the complex processing of the caldav-api to a server and only return the necessary stuff to the InkyFrame for displaying it.

1 Like

Thanks. It looks like the meteo API is much more concise and that might be the best option to start with.

Martin