Hi @Samppa
I think I managed to sort it out (along with ChatGPT)
Original Request
Importing custom Property Set Templates from spreadsheet file ( I use .csv format here for simplicity)
Issue
the functions in ifcopenshell.api.pset_template are supposed to be used in conjunction with
model = ifcopenshell.file(schema="IFC4") # start IFC file
model.write(output_path) # save file
to create a simple .ifc file with the Pset_template information, the same that Bonsai does when the user adds it manually in Project Setup > Property Set Templates.
_I wish it were mentioned in the example here to help non-programmers like me in adopting some scripts in day-to-day tasks. Not a criticism, just an observation_
Solution (?)
in this example a .csv table is used to organize the data, like:

and the same data is loaded in a Pandas table (dataframe) and converted to property set/property accordingly.
The final file is then saved in the folder where Bonsai reads all custom pset templates.


Video
Where I use .csv file and .py script to generate your template (all attached, you need to change the suffix) in Bonsai.
Please do not forget to update the script for csv_path and output_folder.

I would appreciate your feedback
cheers