Last active
December 6, 2023 05:57
-
-
Save ggorlen/47c3077093835ff59035dab1f09d14d4 to your computer and use it in GitHub Desktop.
JSON stream reader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # read file in the format of separate JSON objects without outer array | |
| # {} | |
| # {} | |
| # {} | |
| # ... | |
| # https://stackoverflow.com/a/50384432/6243352 | |
| # https://stackoverflow.com/a/54666028/6243352 | |
| # | |
| # other options: | |
| # jq -s < podcasts.json | |
| # pandas.read_json("podcasts.json", lines=True) | |
| with open("podcasts.json") as f: | |
| for line in f: | |
| parsed = json.loads(line) | |
| print(parsed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment