| ▲ | shakna 7 hours ago | |
There's a whole heap of approaches, each with their own tradeoffs. But most of them aren't trivial, no. And most end up behaving erratically with invalid json. You can buffer data, or yield as it becomes available before discarding, or use the visitor pattern, and others. One Python library that handles pretty much all of them, as a place to start learning, would be: https://github.com/daggaz/json-stream | ||