Skip to main content

gitlab-users

CI Latest Release Python Version License: MIT Code style: black Doc

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 . and black .

Documentation

  • Full API and usage documentation: Sphinx HTML docs
  • To build locally:
    cd docs
    make html
    

License

MIT License

Release files for gitlab-users 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitlab-users 2.0.1
File Size Uploaded
gitlab_users-2.0.1.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitlab-users 2.0.1
File Interpreter ABI Platform
gitlab_users-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / gitlab_users-2.0.1.tar.gz

Download URL gitlab_users-2.0.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3062c576f9adb1a17b07bc535c50a3b81678b393e5eec756e8c46c282e73dae5
BLAKE2b-256 checksum
How to use checksums
248892249a8461dbe53ecc4ab0658d57c330593fa2ca9a9a614015adaebe31d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2025.

Transparency log

Release files / gitlab_users-2.0.1-py3-none-any.whl

Download URL gitlab_users-2.0.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
539fd5342f86f890782a4283af4bef730ab556724cd21e629cbb4af7bf732dcf
BLAKE2b-256 checksum
How to use checksums
beefe061a60f2f1dffc0fed3f22fe3b6cbb4dfdb7e06b7069ba528055eb54d13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.3

2 release files

0.8.6

2 release files

0.8.5

1 release file

0.8.4

2 release files

0.8.3

1 release file

0.8.2

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

2 release files

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page