Is there a method to batch add brushes with Python?

Is there a method to batch add brushes with Python?

What exactly do you try to do?

I use the script to find the single line path that meets certain conditions in all characters, and then want to convert it into brush parts in batch with the function of ‘Add Brush’.
So I want to know s there an API interface for add brush that I can add in batches instead of clicking the right mouse button one by one to execute addbrush

path = Layer.shapes[0]
brush = GSHint()
brush.name = "_brush.test"
brush.type = 18 # should be BRUSH, just added it to the wrapper
brush.originNode = path.nodes[1]
Layer.hints.append(brush)

It’s good!Thanks!