Created
December 31, 2020 11:31
-
-
Save LouisdeBruijn/f2c13c03633d226448535228fa27cceb to your computer and use it in GitHub Desktop.
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
| import jsonlines | |
| def write_jsonl(json_data, file_loc=False): | |
| """Write list object to newline-delimited JSON format. | |
| :param json_data: data in an object that is to be converted to JSONL format | |
| :type json_data: list | |
| :param file_loc: location of file to write to | |
| :type file_loc: str, bool | |
| """ | |
| with jsonlines.open(file_loc, 'w') as writer: | |
| writer.write_all(json_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment