Assign trace width to a net

If you do routing in python then just set width on the tracks.
If you want to create a netclass for the net then see How to create new NetClass using python

You will be able to set width on the netclass.