Your input appears to be a sequence of Python objects; it certainly is not valid a JSON document.

If you have a list of Python dictionaries, then all you have to do is dump each entry into a file separately, followed by a newline:

import json

with open('output.jsonl', 'w') as outfile:
    for entry in JSON_file:
        json.dump(entry, outfile)
        outfile.write('\n')

The default configuration for the json module is to output JSON without newlines embedded.

Assuming your A, B and C names are really strings, that would produce:

{"index": 1, "met": "1043205", "no": "A"}
{"index": 2, "met": "000031043206", "no": "B"}
{"index": 3, "met": "0031043207", "no": "C"}

If you started with a JSON document containing a list of entries, just parse that document first with json.load()/json.loads().

Answer from Martijn Pieters on Stack Overflow
🌐
Medium
galea.medium.com › how-to-love-jsonl-using-json-line-format-in-your-workflow-b6884f65175b
How to Love jsonl — using JSON Lines in your Workflow | by Alex Galea | Medium
April 9, 2024 - I use jsonl for dumping raw “source of truth” data. From there it can be loaded in and processed by any part of the application and, if needed, dumped into a relational format (e.g. Postgres, MySQL, CSV). Here are python functions that can be used to write and read jsonl:
🌐
Readthedocs
jsonlines.readthedocs.io
jsonlines — jsonlines documentation - Read the Docs
The sort_keys argument can be used to sort keys in json objects, and will produce deterministic output. For more control, provide a a custom encoder callable using the dumps argument. The callable must produce (unicode) string output. If specified, the compact and sort arguments will be ignored. When the flush argument is set to True, the writer will call fp.flush() after each written line.
Discussions

Python conversion from JSON to JSONL - Stack Overflow
If you have a list of JSONs, like in your example, you can still search and replace with RegEx, take the negative lookahead "?!", see Stack Overflow Find 'word' not followed by a certain character with \n(?!\s*\{) so that you also skip the spaces after a linebreak: ... Clean the rest of the unneeded characters as you showed it yourself, but take RegEx for it, and you could also do this RegEx replacement automatically with Python ... More on stackoverflow.com
🌐 stackoverflow.com
How can I add \n(newline) In Json string
The line with the JSON string is extremely long. Normally you should keep the length of the lines under 80 or under about 100 characters. Backslash in a Python string is a special character. Some examples of characters you want to get and how to write the string (including quotes): More on discuss.python.org
🌐 discuss.python.org
0
0
September 19, 2022
Python JSON dump / append to .txt with each variable on new line - Stack Overflow
Since you are working with JSON ... outfile.write(',\n') 2021-08-19T15:41:14.437Z+00:00 ... To avoid confusion, paraphrasing both question and answer. I am assuming that user who posted this question wanted to save dictionary type object in JSON file format but when the user used json.dump, this method dumped all its content in one line... More on stackoverflow.com
🌐 stackoverflow.com
How do you print json data in multiply lines?
Use the pprint module. from pprint import pprint response = requests.get(url) x = json.loads(response.text) pprint(x) (BTW json is just the vehicle; there's no such type as "json data". The data you have is just standard python lists and dictionaries.) Edit: the json module also has this feature: import json response = requests.get(url) x = json.loads(response.text) print(json.dumps(x, indent=2)) More on reddit.com
🌐 r/learnpython
10
5
December 4, 2021
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.3 documentation
3 weeks ago - Encode the given object, o, and yield each string representation as available. For example: for chunk in json.JSONEncoder().iterencode(bigobject): mysocket.write(chunk) ... The JSON document being parsed.
🌐
PyPI
pypi.org › project › json-lines
json-lines · PyPI
Handling broken (cut at some point) files is enabled by passing broken=True to json_lines.reader or json_lines.open. Broken lines are skipped (only logging a warning), and reading continues from the next valid position.
      » pip install json-lines
    
Published   Nov 21, 2018
Version   0.5.0
🌐
OneUptime
oneuptime.com › home › blog › how to read and write json files in python
How to Read and Write JSON Files in Python
January 25, 2026 - Notice that JSON's true becomes Python's True, and null becomes None. To write Python data to a JSON file, use json.dump():
🌐
GitHub
github.com › wbolster › jsonlines
GitHub - wbolster/jsonlines: python library to simplify working with jsonlines and ndjson data
April 27, 2022 - jsonlines is a Python library to simplify working with jsonlines and ndjson data.
Starred by 307 users
Forked by 31 users
Languages   Python 100.0% | Python 100.0%
Find elsewhere
🌐
Python.org
discuss.python.org › python help
How can I add \n(newline) In Json string - Python Help - Discussions on Python.org
September 19, 2022 - FYI I have added line break at the end of postman request body. ... E..bz.@.@.+q...[.......P.....!y. .....>..........UF..POST./elasticsearch/_msearch.HTTP/1.1..Host:.xxxxxxxxxxxxxxx..User-Agent:.python-requests/2.28.1..Accept-Encoding:.gzip,.deflate..Accept:.*/*..Connection:.keep-alive..kbn-xsrf:.true..Content-Type:.application/json..Content-Length:.917..Authorization:.Basic.xxxxxxxxxxxxxxxxxx=..E...z.@.@.)....[.......P.....!y.....p...........UF..{"index":"pm2-lspqs-*","ignore_unavailable":true,"timeout":30000,"preference":1666002448430}{"version":true,"size":500,"sort":[{"@timestamp":{"order"
🌐
GitHub
github.com › rmoralespp › jsonl
GitHub - rmoralespp/jsonl: A lightweight Python library for handling jsonlines files · GitHub
September 13, 2017 - ... Requires Python 3.8+. No external dependencies. import jsonl data = [ {"name": "Gilbert", "wins": [["straight", "7♣"], ["one pair", "10♥"]]}, {"name": "May", "wins": []}, ] jsonl.dump(data, "players.jsonl")
Author   rmoralespp
🌐
Ml-gis-service
ml-gis-service.com › index.php › 2022 › 04 › 27 › toolbox-python-list-of-dicts-to-jsonl-json-lines
Toolbox: Python List of Dicts to JSONL (json lines) – Sp.4ML
April 27, 2022 - """ sjsonl = '.jsonl' sgz = '.gz' # Check filename if not filename.endswith(sjsonl): filename = filename + sjsonl # Save data if compress: filename = filename + sgz with gzip.open(filename, 'w') as compressed: for ddict in data: jout = json.dumps(ddict) + '\n' jout = jout.encode('utf-8') compressed.write(jout) else: with open(filename, 'w') as out: for ddict in data: jout = json.dumps(ddict) + '\n' out.write(jout)
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... JSON is a syntax for storing and exchanging data.
🌐
GeeksforGeeks
geeksforgeeks.org › python › reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python - GeeksforGeeks
It takes two parameters: dictionary: ... simply write it to a file using the "write" function. Example: Convert a dictionary to a JSON string and write it to a file....
Published   August 5, 2025
🌐
Reddit
reddit.com › r/learnpython › how do you print json data in multiply lines?
r/learnpython on Reddit: How do you print json data in multiply lines?
December 4, 2021 -

Currently trying to get some data from a url which shows in json format, i can get the data, however when i print it, it just shows in 1 long line of text which isnt what i want. i want the text to be split into multiply lines like when you add \n to strings. (i know its normally not good to do except Exceptions, its just there while i get the other part to work, also the entire def is in a class)

Here is what i currently have. I havent work much with json data before which is why im stuck at what exactly to do.

def info(self):
      try:
            url = [url]
            response = requests.get(url)
            x = json.loads(response.text)
            lore = str(x['data'][input_champion]['lore'])
            print('Getting champion info, please wait')
            time.sleep(5)
            print(f'lore:  {lore}')
            time.sleep(0.5)

      except Exception as e:
            time.sleep(5)
🌐
Prodigy
support.prodi.gy › t › jsonl-format › 783
jsonl format - usage - Prodigy Support
August 29, 2018 - Hi all, I have problems with the .jsonl format (python 3.6.4). After some serious hacking I managed to write a list of dictionaries in jsonl format (converted each list entry to a string) data_list = [{dict1_data}, {dict1_data}, ...] with ...
🌐
Python Land
python.land › home › data processing with python › json in python: how to read, write, and parse
JSON in Python: How To Read, Write, and Parse • Python Land Tutorial
January 13, 2023 - Example: json.dumps(data, ensure_ascii=False) If you’re looking for a format that is easy to write for humans (e.g.: config files), read our article on reading and writing YAML with Python. JMESPath is a query language for JSON. JMESPath in Python allows you to obtain the data you need from a JSON document or dictionary easily. If you need to parse JSON on the command-line, try our article on a tool called jq!
🌐
Medium
nicholaszhan.com › line-em-up-a-guide-to-json-lines-7c43215b3b82
Line ’Em Up: A Guide to JSON Lines | by Nicholas Zhan | Medium
February 2, 2024 - Line ’Em Up: A Guide to JSON Lines Today, we are gonna to learn JSON Lines! JSON Lines, often referred to as newline-delimited JSON (NDJSON), takes the well-known flexibility of JSON and adapts it …
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-pretty-print-json
Python - Pretty Print JSON - GeeksforGeeks
2 weeks ago - This code reads JSON data from a file called "test.json," parses it into a Python data structure, and then prints it using both the built-in print function and the pprint module. The pprint module is used to pretty-print the JSON data with specific formatting options like an indentation of 2, a line width of 30 characters, and compact representation.
🌐
Python.org
discuss.python.org › python help
Python updated json file is full of backslashes and newline characters - Python Help - Discussions on Python.org
January 24, 2023 - I have a python script where I ... to write it to a different blank json file by using this: file.write(json.loads(json.dumps(replaced_content.replace("\\n", "")))) Result output json has a lot of slashes and new line characters ...
🌐
PyPI
pypi.org › project › jsonlines
jsonlines · PyPI
September 15, 2025 - Library with helpers for the jsonlines file format
      » pip install jsonlines
    
Published   Sep 01, 2023
Version   4.0.0