Metadata-Version: 2.4
Name: gitlab-depcheck
Version: 0.5.3
Summary: Check python package dependencies across GitLab projects
Project-URL: Homepage, https://github.com/sesav/gitlab-dep-checker
Project-URL: Repository, https://github.com/sesav/gitlab-dep-checker
Project-URL: Issues, https://github.com/sesav/gitlab-dep-checker/issues
Author-email: Sergey Silaev <hello@8am.dev>
License: MIT
License-File: LICENSE
Keywords: checker,dependencies,gitlab,package,python,python310,python311,python312,python313
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: click>=8.3.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: rich>=14.2.0
Requires-Dist: tomli>=2.3.0
Description-Content-Type: text/markdown

# GitLab Dependency Checker

![Python Version](https://img.shields.io/badge/python-3.10+-blue)
![](https://img.shields.io/github/repo-size/sesav/gitlab-depcheck)
![](https://img.shields.io/github/last-commit/sesav/gitlab-depcheck)
[![codecov](https://codecov.io/github/sesav/gitlab-depcheck/graph/badge.svg?token=GSHBWZGXAH)](https://codecov.io/github/sesav/gitlab-depcheck)

A command-line utility to check if Python packages are used in GitLab repositories or groups. It helps you track package usage across your projects.

## Installation

The easiest way to install is with `uv`:

```bash
% uv tool install gitlab-depcheck
```

Now it's available globally. You can check that the installation was
successful:

```bash
% gitlab-depcheck --version
gitlab-depcheck, version 0.5.3
```

Next, create a config file `.gitlab_depcheck.toml` in your project directory or
`~/.gitlab_depcheck.toml` in your home directory:

```toml
[gitlab]
url = "https://gitlab.com"  # or your self-hosted GitLab URL
token = "your-personal-access-token"

[search]
group = "foo"              # default group to search in
max_concurrent = 20        # parallel API requests (default: 10)
```

And just run:

```bash
% gitlab-depcheck httpx

🔍 Searching for package: httpx

✓ Found 56 projects to check
Checking projects... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

✓ Found in 4 projects:

┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┓
┃ Project               ┃ File           ┃ Package                                ┃ Line ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━┩
│ foo/bar-service       │ pyproject.toml │ httpx==0.27.1                          │   31 │
│ foo/tor-service       │ pyproject.toml │ httpx[http2]==0.25.2                   │   18 │
│ foo/org-service       │ pyproject.toml │ httpx[brotli,zstd]==0.27.1             │   49 │
│ foo/autotests         │ pyproject.toml │ httpx>=0.25.1                          │   24 │
└───────────────────────┴────────────────┴────────────────────────────────────────┴──────┘

Version distribution:
  httpx==0.27.1: 2 project(s)
  httpx==0.25.2: 1 project(s)
  httpx>=0.25.1: 1 project(s)

```

Output can be transformed into `json` or `csv`, for example:

```bash
% gitlab-depcheck numpy --output json > foo_numpy.json
% gitlab-depcheck numpy --output csv > foo_numpy.csv
```

## More options

You can narrow the search by specifying a group:

```bash
gitlab-depcheck httpx --group mycompany/backend
```

or filter by project name:

```bash
gitlab-depcheck httpx --search foo-service
```

A full list of options is available via `--help`:

```bash
% gitlab-depcheck --help
Usage: gitlab-depcheck [OPTIONS] PACKAGE

  Check Python package dependencies across GitLab projects.

  Examples:
    # Search for pandas in all accessible projects
    gitlab-depcheck pandas

    # Search in specific group
    gitlab-depcheck httpx --group mycompany/backend

    # Search with project name filter
    gitlab-depcheck fastapi --search api

    # Include archived projects
    gitlab-depcheck django --archived

  Configuration file (searches in order):
    1. .gitlab_depcheck.toml (project directory)
    2. ~/.gitlab_depcheck.toml (home directory)

    [gitlab]
    url = "https://gitlab.com"
    token = "your-token-here"

    [search]
    group = "mycompany"
    max_concurrent = 20

Options:
  --version                  Show the version and exit.
  --url TEXT                 GitLab URL (default: https://gitlab.com or from
                             config)
  --token TEXT               GitLab personal access token (or use GITLAB_TOKEN
                             env var or config)
  --group TEXT               GitLab group path (e.g., mycompany/backend)
  --search TEXT              Filter projects by name
  --archived                 Include archived projects
  --max-concurrent INTEGER   Maximum concurrent API requests
  --output [table|json|csv]  Output format
  --help                     Show this message and exit.
  ```

## Requirements

- Python 3.10+
- uv package manager
- wget or curl (for uv installation)

## License

This project is licensed under the [MIT License](LICENSE).
