# Changing the grease pencil brush from the API

How can the grease pencil brush be changed from the API? The default is Pencil, but in my addon I would like to use the Pen. I cannot find this anywhere in the documentation.

# Define grease pencil parameters
gp_mat = bpy.data.materials.new("my_mat")
bpy.data.materials.create_gpencil_data(gp_mat)
gp_mat.grease_pencil.color = [0,1,0,1]
bpy.context.scene.tool_settings.gpencil_stroke_placement_view3d = 'SURFACE'
bpy.data.brushes["Pen"].size = 5

# Add grease pencil to scene
bpy.ops.object.mode_set(mode='PAINT_GPENCIL')
gp_obj = bpy.data.objects['GPencil']
gp_obj.data.materials.append(gp_mat)
gp_obj.active_material = gp_mat

# Change brush to pen
_________________________________________  # What goes here?


You can change the active brush via the context tool settings like you set the gpencil_stroke_placement_view3d in your code:
bpy.context.scene.tool_settings.gpencil_paint.brush = bpy.data.brushes["Pen"]