Skip to main content

A Python SDK for interacting with code.swecha.org using GitLab API v4.

Project description

gitlab-utils

A Python-based toolkit to interact with GitLab APIs on Swecha's self-hosted GitLab instance code.swecha.org. gitlab-utils streamlines GitLab workflows by offering tools to track and summarize contributions, Automate merge request pipelines, Generate issue reports and activity logs and Ensure development standards and reproducibility across projects.

๐Ÿš€ Features

  • Onboarding users to specific groups
  • Generates commit summaries and member-wise contribution stats
  • Generates Daily reports based on the Issues created and contributions done
  • Get specific information of a individual user

๐Ÿ› ๏ธ Installation Setup

Using pip

pip install gitlab-utils

Using uv

uv pip install gitlab-utils

๐Ÿš€ Initial Client Setup

To start using the SDK, initialize the GitLabClient with your GitLab instance URL and a valid private token:

from gitlab_utils.client import GitLabClient

client = GitLabClient(
    base_url="gitlab_instance_url",
    private_token="your_gitlab_token/admin_token"
)

Example: base_url="https://code.swecha.org"

๐Ÿ“ Project Structure

gitlab-utils/
โ”œโ”€โ”€ .gitlab/
โ”‚   โ”œโ”€โ”€ templates/
โ”‚   โ”‚    โ”œโ”€โ”€MR_template.md
โ”‚   โ”‚    โ””โ”€โ”€issue_template.md
โ”‚   โ””โ”€โ”€ workflow/
โ”‚        โ””โ”€โ”€ lint.yml
โ”œโ”€โ”€ gitlab_utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ client.py                 # Main logic
โ”‚   โ””โ”€โ”€ apis/                     # Modular API handlers
โ”‚        โ”œโ”€โ”€ __init__.py
โ”‚        โ””โ”€โ”€ users.py
โ”œโ”€โ”€ tests/                        # Unit tests for client
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ confest.py
โ”‚   โ”œโ”€โ”€ test_client.py
โ”‚   โ””โ”€โ”€ test_users.py
โ”‚
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .gitlab-ci.yml                # GitLab CI pipeline config
โ”œโ”€โ”€ .pre-comit-config.yaml
โ”œโ”€โ”€ LICENSE                       # GNU GPL v3 License
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ README.md                     # Project overview and usage
โ”œโ”€โ”€ CONTRIBUTING.md               # Contribution guidelines
โ”œโ”€โ”€ CODE_OF_CONDUCT.md            # Community standards
โ”œโ”€โ”€ pyproject.toml                # Project configuration
โ””โ”€โ”€ uv.lock

๐Ÿ’ฌ Support

Need help or have a question about gitlab-utils?
E-Mail the maintainers at ranjithraj@swecha.net

  • ๐Ÿ› Found a bug?
    If you encounter any bugs in the codebase, please create an issue with label bug

  • ๐Ÿ’ก Have a feature request or idea?
    Feel free to create a new issue labeled feature-request availabe in tags.

Make sure to follow the provided ISSUE BOARD TEMPLATE

Contributing to gitlab-utils

๐ŸŽ‰ Thank you for considering contributing to gitlab-utils

We welcome all kinds of contributions: code, documentation, bug reports, feature requests, ideas, and feedback, refer this DOCUMENTATION.

Realtime Applications of gitlab-utils

Several applications have integrated Gitlab-utils into their codebase.

๐Ÿ“ License

This project is licensed under the GNU General Public License v3.0.

You are free to use, modify, and distribute this software for any purpose, provided that:

The original license and copyright notice are included. Any derivative work must also be distributed under the same license. See the 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_utils-0.1.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlab_utils-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_utils-0.1.1.tar.gz.

File metadata

  • Download URL: gitlab_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for gitlab_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dcb287de1d65e226d54217e452b2ee32c6585a83b6f1a6937fbfddc1acfce06c
MD5 42e9bc77f15a69e1e106ff6eff7258b4
BLAKE2b-256 8c25d16ca02bf4c8acde698b8106c696fd304d7899a8ff05c93f35861ad6213e

See more details on using hashes here.

File details

Details for the file gitlab_utils-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gitlab_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8833aebcd0fd4719241443391f210dbbf2b554b2062e90f3a5c7aab3c771198
MD5 15b81c1bb449d6cf398546eecad153fc
BLAKE2b-256 5e18c137e62159b25c77acb8a277cbac946b3da5cd51edf6a2eb58dc7e3da803

See more details on using hashes here.

Supported by

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