Metadata-Version: 2.4
Name: gitlab-download-packages
Version: 1.0.0
Summary: Download all packages from a GitLab project's package registry
Project-URL: Repository, https://gitlab.com/cyberassessmentlabs/public/tools/gitlab-download-packages
Project-URL: Documentation, https://cyberassessmentlabs.gitlab.io/public/docs/gitlab-download-packages/latest/
Author: Cyber Assessment Labs
License-Expression: MIT
License-File: LICENSE
Keywords: download,gitlab,packages,pypi,registry
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# gitlab-download-packages

Download all packages from a GitLab project's package registry.

## Features

- Downloads all packages from a GitLab project's package registry
- Supports **PyPI** and **generic** package types only
- Works with public registries (no authentication required)
- Organises downloads by package type and name
- Skips existing files (use `--overwrite` to re-download)
- Python 3.12+ with zero external dependencies

## Supported Package Types

This tool only supports downloading:
- **PyPI packages** (`--type pypi`)
- **Generic packages** (`--type generic`)

Other GitLab package types (Maven, npm, NuGet, etc.) are not supported.

## Installation

```bash
pip install gitlab-download-packages
```

Or install from source:

```bash
git clone https://gitlab.com/cyberassessmentlabs/public/tools/gitlab-download-packages.git
cd gitlab-download-packages
pip install .
```

## Usage

```bash
# Download all packages (PyPI and generic)
gitlab-download-packages \
  --gitlab-url https://gitlab.com \
  --project mygroup/myproject \
  --output ./packages

# Download only PyPI packages
gitlab-download-packages -u https://gitlab.com -p mygroup/myproject -o ./packages -t pypi

# Download only generic packages
gitlab-download-packages -u https://gitlab.com -p mygroup/myproject -o ./packages -t generic

# Overwrite existing files
gitlab-download-packages -u https://gitlab.com -p mygroup/myproject -o ./packages -f
```

## Options

| Option | Short | Description |
|--------|-------|-------------|
| `--gitlab-url` | `-u` | GitLab instance URL (required) |
| `--project` | `-p` | Project path (e.g., `group/project`) (required) |
| `--output` | `-o` | Output directory for downloaded packages (required) |
| `--type` | `-t` | Package type: `pypi` or `generic` (default: both) |
| `--package` | `-n` | Package name to download (exact match, can repeat) |
| `--release-only` | `-r` | Only download release versions (x.y.z format) |
| `--overwrite` | `-f` | Overwrite existing files instead of skipping |
| `--verbose` | `-v` | Verbose output (use twice for debug) |
| `--no-colour` | | Disable coloured output |
| `--help` | `-h` | Show help message |
| `--version` | | Show version |

## Output Structure

Downloads are organised by package type and name:

```
packages/
├── pypi/
│   └── package-name/
│       ├── package_name-1.0.0.tar.gz
│       └── package_name-1.0.0-py3-none-any.whl
└── generic/
    └── artifact-name/
        └── artifact-name-1.0.0.zip
```

## Requirements

- Python 3.12 or higher
- No external dependencies (uses only Python standard library)

## Development

```bash
# Set up development environment
make dev

# Run linting and type checks
make check

# Format code
make format

# Build package and documentation
make build
```

## Licence

MIT License — Copyright (c) 2026 Cyber Assessment Labs
