Parsing a string returned from a comand line sensor to a multiline entity card

Hello
I have the following command line sensor:

  - platform: command_line
    name: flydata
    command: "python3 /config/flysjekk.py {{ states('sensor.openskyflights') }}"
    scan_interval: 5  

The sensor return the following string:

(‘Norwegian Air Shuttle 769’, ‘Boeing 737-800 (twin-jet)’, ‘Stjordal, Norway’, ‘Oslo, Norway’, ‘arrived’, ‘October 21 2020 15:44:00’, ‘October 21 2020 16:21:00’)

As you understand the string contains flightnumber, aircraft type, origin, destination, status, departure time and estimated arrival time.

For now the entire string shows in an entitycard in lovelace. I want a card to show something like this:
Flightnbr: Norwegian Air Shuttle 769
Aircraft type: Boeing 737-800 (twin-jet)
.
.
.
Estimated arrival time: October 21 2020 16:21:00

Any suggestions to how I can accomplish this for instance in a multiline entity card?

I hope that python script isn’t scraping a website. Calling it every 5 seconds would be considered excessive.

It does scrape a website. I thought it was only checking the sensor.openskyfkights every 5 seconds and run if it changes. That it was I want. Anh suggestions to change the behavior so it only triggers when the openskysensor changes. This sensor changes everytime a plane passes over my house

You could try using the replace() function in a value template to replace ", " with a newline. Something like;

value_template "{{ value.replace(', ', '\n') }}"

Though I don’t know if \n will work or you have to use something else.