Iterate all projects under namespace, push updated code to a branch, and create a MR

,

I’d like to iterate over all projects under namespace MyDepartment, create a branch on each project called “good-updates” and push some code, and create a MR on that branch.

Is there a sample code I can use to achieve this? Preferably in python or shell.

example namespace
MyDepartment/goodprojects/project1
MyDepartment/goodprojects/project2
MyDepartment/goodprojects/project3

edit:
gitlab version GitLab Enterprise Edition [12.8.7-ee]