A Python utility to help you manage multiple repositories at once.

Our target users are teachers that need to manage separate repository for each student and massively fork, clone or upload files in all projects at once.

Our typical scenario

The following scenario is something we have faced in many of our courses.

For each student we needed to create their own Git project (repository) where they will submit their assignments for a particular course. Usually, that means uploading some initial state of the repository, setup branch protection rules, enable CI and add the user with the correct access rights and permissions.

For a few students, it was relatively easy to do so manually. But with tens (or even hundreds) of students some kind of automation was needed.

That is where this utility comes in handy.

Installation and first steps

We publish the utility through PyPI so installation is as simple as:

pip install teachers-gitlab

Once the above command finishes, you will have teachers-gitlab command available.

Individual actions are available as subcommands and for example the following command will add students to their projects. We expect that we have the following CSV with students and each student has their own repository at courses/sw-eng/student-NUMBER where NUMBER is their unique number (e.g. their ISIC card number).

isic,name,email
1234,John Doe,john@example.com
9876,Jane Done,jane@example.com

The following command will make each student a Developer in their projects.

teachers-gitlab add-member \
    --users students.csv \
    --project "courses/sw-eng/student-{isic}" \
    --access-level developer

Continue reading at teachers-gitlab.readthedocs.io

Contributors

Repositories

Contact