Export GitLab users information and automate user accounts creation
Project description
gitlab-users
A CLI and an API to manage GitLab user accounts, based on python-gitlab.
Features
- List users and groups from a GitLab instance
- Export users to CSV
- Bulk create/delete users from CSV
- Export SSH keys
Installation
pip install gitlab-users
Requires Python 3.9+ and a valid python-gitlab
configuration (~/.python-gitlab.cfg
).
Usage
Get help and list all commands:
gitlab-users -h
List all users:
gitlab-users list-users
List all groups:
gitlab-users list-groups
Export all users to a CSV file:
gitlab-users export-users users.csv
Create users from a CSV file (see example format below):
gitlab-users create-from-csv users.csv
Delete users from a CSV/text file (usernames in first column):
gitlab-users delete-from-csv users.csv
Delete a single user (asks for confirmation):
gitlab-users delete-user USERNAME
Export SSH keys of a user:
gitlab-users export-ssh-keys USERNAME
Example CSV format
# username, name, email, [organization], [location], [group], [access_level]
# Note: The fields in square brackets are optional and can be omitted if not needed.
ww,Diana Prince,wonder.woman@themyscira.org,,Themyscira
wayne,Bruce Wayne,bruce.wayne@wayne-enterprises.com,Wayne Enterprises,Gotham City,board,owner
Development
- See CONTRIBUTING.md for dev setup, linting, testing, and release instructions.
- Run all tests:
pytest
- Lint and format:
ruff check .
andblack .
Documentation
- Full API and usage documentation: Sphinx HTML docs
- To build locally:
cd docs make html
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gitlab_users-2.0.1.tar.gz
.
File metadata
- Download URL: gitlab_users-2.0.1.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
3062c576f9adb1a17b07bc535c50a3b81678b393e5eec756e8c46c282e73dae5
|
|
MD5 |
c9412640d2ca1451e300fa05a98a6596
|
|
BLAKE2b-256 |
248892249a8461dbe53ecc4ab0658d57c330593fa2ca9a9a614015adaebe31d6
|
Provenance
The following attestation bundles were made for gitlab_users-2.0.1.tar.gz
:
Publisher:
ci-publish.yml
on boileaum/gitlab-users
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
gitlab_users-2.0.1.tar.gz
-
Subject digest:
3062c576f9adb1a17b07bc535c50a3b81678b393e5eec756e8c46c282e73dae5
- Sigstore transparency entry: 230221390
- Sigstore integration time:
-
Permalink:
boileaum/gitlab-users@bee02c7e5b607ec654aebf06a24b12242f860c4e
-
Branch / Tag:
refs/tags/v2.0.1
- Owner: https://github.com/boileaum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci-publish.yml@bee02c7e5b607ec654aebf06a24b12242f860c4e
-
Trigger Event:
push
-
Statement type:
File details
Details for the file gitlab_users-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: gitlab_users-2.0.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
539fd5342f86f890782a4283af4bef730ab556724cd21e629cbb4af7bf732dcf
|
|
MD5 |
cc43dae5b64bc16dcf211e9b196fb57b
|
|
BLAKE2b-256 |
beefe061a60f2f1dffc0fed3f22fe3b6cbb4dfdb7e06b7069ba528055eb54d13
|
Provenance
The following attestation bundles were made for gitlab_users-2.0.1-py3-none-any.whl
:
Publisher:
ci-publish.yml
on boileaum/gitlab-users
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
gitlab_users-2.0.1-py3-none-any.whl
-
Subject digest:
539fd5342f86f890782a4283af4bef730ab556724cd21e629cbb4af7bf732dcf
- Sigstore transparency entry: 230221394
- Sigstore integration time:
-
Permalink:
boileaum/gitlab-users@bee02c7e5b607ec654aebf06a24b12242f860c4e
-
Branch / Tag:
refs/tags/v2.0.1
- Owner: https://github.com/boileaum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci-publish.yml@bee02c7e5b607ec654aebf06a24b12242f860c4e
-
Trigger Event:
push
-
Statement type: