Automating rebar bar type using python script

Hi! I just started to use Dynamo and I hope someone can help me. I currently choose rebar type manually from rebar.bar.type. Do you think it would be possible to automate this part using a python script? Because I want to rewrite my excel calculations for reinforcement bars with python and use it as input data in Dynamo. Do you think it is possible?