This guide shows some of the various usages of using this project. Functionality will change over time. So, this is just a subset of use cases.
python -m gitlab_api --help
...
usage: __main__.py [-h] [--netrcfile NETRCFILE] [--search SEARCH]
[--token TOKEN] [--url URL]
{all-groups,all-groups-members,all-projects,all-projects-members,all-users,current-user-attrs}
Manage GitLab via API.
positional arguments:
{all-groups,all-groups-members,all-projects,all-projects-members,all-users,current-user-attrs}
Define action to take.
optional arguments:
-h, --help show this help message and exit
--netrcfile NETRCFILE
Path to Netrc file
--search SEARCH Filter objects.
--token TOKEN Your GitLab API private token.
--url URL Your GitLab API Url.
The following is a list of supported functionalities for groups.
To view all of your GitLab groups:
python -m gitlab_api all-groups --token PersonalAccessToken
To search for a specific group.
python -m gitlab_api all-groups --search group --token PersonalAccessToken
To get a list of all groups with group members for each group.
python -m gitlab_api all-groups-members --token PersonalAccessToken
The following are the currently supported functionalities for projects.
To view all of your GitLab projects:
python -m gitlab_api all-projects --token PersonalAccessToken
To search for a specific project.
python -m gitlab_api all-projects --search project --token PersonalAccessToken
To get a list of all projects with members for each project.
python -m gitlab_api all-projects-members --token PersonalAccessToken
NOTE: If the GitLab instance is gitlab.com, this retrieves all users. Which could be a huge issue.
To get all users:
python -m gitlab_api all-users --token PersonalAccessToken
To search for a specific user.
python -m gitlab_api all-users --search user --token PersonalAccessToken
To view your GitLab user attributes:
python -m gitlab_api user-attrs --token PersonalAccessToken