Skip to main content

Export GitLab users information and automate user accounts creation

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlab_users-2.0.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

gitlab_users-2.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

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

Hashes for gitlab_users-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3062c576f9adb1a17b07bc535c50a3b81678b393e5eec756e8c46c282e73dae5
MD5 c9412640d2ca1451e300fa05a98a6596
BLAKE2b-256 248892249a8461dbe53ecc4ab0658d57c330593fa2ca9a9a614015adaebe31d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitlab_users-2.0.1.tar.gz:

Publisher: ci-publish.yml on boileaum/gitlab-users

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gitlab_users-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 539fd5342f86f890782a4283af4bef730ab556724cd21e629cbb4af7bf732dcf
MD5 cc43dae5b64bc16dcf211e9b196fb57b
BLAKE2b-256 beefe061a60f2f1dffc0fed3f22fe3b6cbb4dfdb7e06b7069ba528055eb54d13

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page