CSV to JSON using python : I want to populate my json message with data from a CSV file. I want each row to be a "new" json message. I am using python and will connect the the code to an API once done. Some of the data is categorized under "personalinfo" and "carinfo" and I need the correct data to be populated under the right category as under the "expected json message output"

Example csv table:

     FirstName	LastName	Age	gender	Car	model Price loan
        Anna	Andersson	28	F	    Audi	A8 40    FALSE
        Bea	   Bertilsson	27	F	    WV	    GT 20    TRUE

expected json message output:

    {
    	"personalinfo": {
    		"firstname": "Anna",
    		"lastname": "Andersson",
    		"age": "28",
    		"gender": "F",
    
    		"carinfo": [{
    			"car  ": "Audi",
    			"model": "A8"
    
    		}],
    		"price": 40,
    		"loan": "FALSE"
    
    	}
    }


    {
    	"personalinfo": {
    		"firstname": "Bea",
    		"lastname": "Bertilsson",
    		"age": "27",
    		"gender": "F",
    
    		"carinfo": [{
    			"car  ": "WV",
    			"model": "GT"
    
    		}],
    		"price": 20,
    		"loan": "TRUE"
    
    	}
    }