Metadata-Version: 2.4
Name: gitlab-pypi
Version: 0.1.3
Summary: GitLab PyPI registry tools
Project-URL: Repository, https://gitlab.com/cyberassessmentlabs/public/tools/gitlab-pypi
Project-URL: Documentation, https://cyberassessmentlabs.gitlab.io/public/docs/gitlab-pypi/latest
Author: Cyber Assessment Labs
License-Expression: MIT
License-File: LICENSE
Keywords: gitlab,packages,pypi,registry
Classifier: Development Status :: 4 - Beta
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
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# gitlab-pypi

A command-line tool for managing Python packages in GitLab's PyPI registry.

GitLab provides a built-in PyPI package registry, but the web UI for browsing and managing packages is limited. gitlab-pypi gives you a fast, readable CLI for listing packages, inspecting versions, and downloading or uploading wheel files — all via the GitLab REST API.

## Features

- **List packages** — see all packages at a glance, with version counts and latest stable version
- **Show versions** — view all versions for one or more packages, with pre-release filtering
- **Download** — fetch `.whl` files from the registry
- **Upload** — publish one or more `.whl` files to the registry
- **Delete** — remove a package version from the registry
- **Multiple output formats** — coloured tables (default), `--plain` for piping into pip, or `--json` for scripting

Zero external dependencies — uses only the Python 3.12+ standard library.

## Installation

```bash
pip install gitlab-pypi
```

## Configuration

Create a config file at `~/.config/gitlab-pypi/config.json`:

```json
{
  "url": "https://gitlab.com",
  "project": "my-group/my-project",
  "token": "glpat-xxxxxxxxxxxx"
}
```

Or pass these as CLI flags (`--url`, `--project`, `--token`) on each command.

## Usage

```bash
# List all packages in the registry
gitlab-pypi list

# Show versions for a package (stable only by default)
gitlab-pypi show my-package

# Show all versions including pre-releases
gitlab-pypi show my-package --all

# Plain output for piping into pip or requirements files
gitlab-pypi show my-package --plain

# Download the latest stable wheel
gitlab-pypi download my-package

# Download a specific version
gitlab-pypi download my-package==1.2.3

# Download all versions of a package
gitlab-pypi download my-package --all

# Upload one or more wheels
gitlab-pypi upload dist/my_package-1.0.0-py3-none-any.whl
gitlab-pypi upload dist/*.whl

# Delete a specific version
gitlab-pypi delete my-package==1.0.0
```

## Development

```bash
make dev        # Create dev environment
make check      # Run ruff + pyright
make format     # Auto-fix and format code
make build      # Build wheel + docs
make docs       # Build HTML documentation
```

## Licence

MIT License — Copyright (c) 2026 Cyber Assessment Labs
