glpkg


Nameglpkg JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryTool to make GitLab generic package registry operations easy.
upload_time2025-08-17 17:51:50
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords gitlab packages registry generic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # glpkg - GitLab Generic Package registry tools 

glpkg is a tool that makes it easy to work with [GitLab generic package registry](https://docs.gitlab.com/user/packages/generic_packages/).


## Installation

Install the tool from with pip:

```bash
pip install glpkg
```

To check the installation and version,  run:


```bash
glpkg --version
```

If you see a version in the terminal, you're good to go!

## Usage

By default, the used GitLab host is gitlab.com. If you use a self-hosted GitLab, use argument `--host my-gitlab.net` with the commands.

> Only https scheme is supported.

To authenticate with the package registry in any of the commands below, use `--token readapitoken123` argument where the `readapitoken123` is a [personal](https://docs.gitlab.com/user/profile/personal_access_tokens/#create-a-personal-access-token) or [project](https://docs.gitlab.com/user/project/settings/project_access_tokens/#create-a-project-access-token) access token, with read API scope. In case the package registry is public, you can omit this argument.

The above arguments are omitted in the examples below to focus on the functions. Add the arguments to change the host or to authenticate with the registry.

In general, run `glpkg --help` when needed.

### Listing package versions

To list the versions of a generic package, run

```bash
glpkg list --project 12345 --name mypackagename
```

Where:
- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)
- `mypackagename` is the name of the generic package

The output will be, if package is found, something like:

```bash
Name            Version
mypackagename   1.0
mypackagename   1.5
mypackagename   2.0
```

### Download generic package

To download everything from a specific generic package, run

```bash
glpkg download --project 12345 --name mypackagename --version 1.0
```

Where:
- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)
- `mypackagename` is the name of the generic package
- `1.0` is the version of the generic package from which the files are downloaded

The files will be downloaded in the current working directory. Any pre-existing files will be overridden without warning.

> If a package has multiple files with the same filename, the tool can only download the newest file. This is a restriction of GitLab API.

### Upload a file to a generic package

To upload a file to a version of a generic package, run

```bash
glpkg upload --project 12345 --name mypackagename --version 1.0 --file my-file.txt
```

Where:
- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)
- `mypackagename` is the name of the generic package
- `1.0` is the version of the generic package to which the file is uploaded
- `my-file.txt` is the file that is uploaded to the generic package. Currently, only relative paths are supported, and the relative path (e.g. `folder/file.txt`) is preserved when uploading the file to the registry.

> A GitLab generic package may have multiple files with the same file name. However, it likely is not a great idea, as they cannot be downloaded separately from the GitLab API.

### Use in GitLab pipelines

If you use the tool in a GitLab pipeline, using `--ci` argument uses [GitLab predefined variables](https://docs.gitlab.com/ci/variables/predefined_variables/) to configure the tool. In this case `CI_SERVER_HOST`, `CI_PROJECT_ID`, and `CI_JOB_TOKEN` environment variables are used. The `--project`, and `--token` arguments can still be used to override the project ID and to use a personal or project access token instead of CI_JOB_TOKEN.

In other words, you don't need to give the `--host`, `--project`, or `--token` arguments if you are interacting with the package registry of the project where the pipeline is running. Example: uploading `my-file.txt` to generic package `mypackagename` version `1.0` in the project package registry in CI:

```bash
glpkg upload --ci --name mypackagename --version 1.0 --file my-file.txt
```

To use the `CI_JOB_TOKEN` with package registry of another projects, add `--project <otherproject ID>` argument. Remember that you may need to add [permissions for the CI_JOB_TOKEN](https://docs.gitlab.com/ci/jobs/ci_job_token/#control-job-token-access-to-your-project) in the other project.


## Limitations

The tool is not perfect (yet) and has limitations. The following limitations are known, but more can exist:

- Uploading files must be done one-by-one.
- Only project registries are supported for now.
- Pagination is not supported for now - in case you have more than 100 versions of a package, not all will be shown.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "glpkg",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "GitLab, packages, registry, generic",
    "author": null,
    "author_email": "bugproduction <bugproduction@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/b3/5a/b522c61900fa372a7c2fc78d4450bb18f4a3099ef7c0f06789a231c388a6/glpkg-1.0.0.tar.gz",
    "platform": null,
    "description": "# glpkg - GitLab Generic Package registry tools \n\nglpkg is a tool that makes it easy to work with [GitLab generic package registry](https://docs.gitlab.com/user/packages/generic_packages/).\n\n\n## Installation\n\nInstall the tool from with pip:\n\n```bash\npip install glpkg\n```\n\nTo check the installation and version,  run:\n\n\n```bash\nglpkg --version\n```\n\nIf you see a version in the terminal, you're good to go!\n\n## Usage\n\nBy default, the used GitLab host is gitlab.com. If you use a self-hosted GitLab, use argument `--host my-gitlab.net` with the commands.\n\n> Only https scheme is supported.\n\nTo authenticate with the package registry in any of the commands below, use `--token readapitoken123` argument where the `readapitoken123` is a [personal](https://docs.gitlab.com/user/profile/personal_access_tokens/#create-a-personal-access-token) or [project](https://docs.gitlab.com/user/project/settings/project_access_tokens/#create-a-project-access-token) access token, with read API scope. In case the package registry is public, you can omit this argument.\n\nThe above arguments are omitted in the examples below to focus on the functions. Add the arguments to change the host or to authenticate with the registry.\n\nIn general, run `glpkg --help` when needed.\n\n### Listing package versions\n\nTo list the versions of a generic package, run\n\n```bash\nglpkg list --project 12345 --name mypackagename\n```\n\nWhere:\n- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)\n- `mypackagename` is the name of the generic package\n\nThe output will be, if package is found, something like:\n\n```bash\nName            Version\nmypackagename   1.0\nmypackagename   1.5\nmypackagename   2.0\n```\n\n### Download generic package\n\nTo download everything from a specific generic package, run\n\n```bash\nglpkg download --project 12345 --name mypackagename --version 1.0\n```\n\nWhere:\n- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)\n- `mypackagename` is the name of the generic package\n- `1.0` is the version of the generic package from which the files are downloaded\n\nThe files will be downloaded in the current working directory. Any pre-existing files will be overridden without warning.\n\n> If a package has multiple files with the same filename, the tool can only download the newest file. This is a restriction of GitLab API.\n\n### Upload a file to a generic package\n\nTo upload a file to a version of a generic package, run\n\n```bash\nglpkg upload --project 12345 --name mypackagename --version 1.0 --file my-file.txt\n```\n\nWhere:\n- `12345` is your projects ID ([Find the Project ID](https://docs.gitlab.com/user/project/working_with_projects/#find-the-project-id)) or the path of the project (like `namespace/project`)\n- `mypackagename` is the name of the generic package\n- `1.0` is the version of the generic package to which the file is uploaded\n- `my-file.txt` is the file that is uploaded to the generic package. Currently, only relative paths are supported, and the relative path (e.g. `folder/file.txt`) is preserved when uploading the file to the registry.\n\n> A GitLab generic package may have multiple files with the same file name. However, it likely is not a great idea, as they cannot be downloaded separately from the GitLab API.\n\n### Use in GitLab pipelines\n\nIf you use the tool in a GitLab pipeline, using `--ci` argument uses [GitLab predefined variables](https://docs.gitlab.com/ci/variables/predefined_variables/) to configure the tool. In this case `CI_SERVER_HOST`, `CI_PROJECT_ID`, and `CI_JOB_TOKEN` environment variables are used. The `--project`, and `--token` arguments can still be used to override the project ID and to use a personal or project access token instead of CI_JOB_TOKEN.\n\nIn other words, you don't need to give the `--host`, `--project`, or `--token` arguments if you are interacting with the package registry of the project where the pipeline is running. Example: uploading `my-file.txt` to generic package `mypackagename` version `1.0` in the project package registry in CI:\n\n```bash\nglpkg upload --ci --name mypackagename --version 1.0 --file my-file.txt\n```\n\nTo use the `CI_JOB_TOKEN` with package registry of another projects, add `--project <otherproject ID>` argument. Remember that you may need to add [permissions for the CI_JOB_TOKEN](https://docs.gitlab.com/ci/jobs/ci_job_token/#control-job-token-access-to-your-project) in the other project.\n\n\n## Limitations\n\nThe tool is not perfect (yet) and has limitations. The following limitations are known, but more can exist:\n\n- Uploading files must be done one-by-one.\n- Only project registries are supported for now.\n- Pagination is not supported for now - in case you have more than 100 versions of a package, not all will be shown.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Tool to make GitLab generic package registry operations easy.",
    "version": "1.0.0",
    "project_urls": {
        "Repository": "https://gitlab.com/bugproduction/glpkg.git"
    },
    "split_keywords": [
        "gitlab",
        " packages",
        " registry",
        " generic"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3b4c83c7311752d5b38dd383e94aa177ad473f26b9f2a412ac57270ad6cf5d3d",
                "md5": "ef7b63dcccb0482218a89578ea4f4d4d",
                "sha256": "e7df010824f4b8b3ec87a9af3a8dd8130a6d934b6942f97bafd0410c7ca8b832"
            },
            "downloads": -1,
            "filename": "glpkg-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef7b63dcccb0482218a89578ea4f4d4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7310,
            "upload_time": "2025-08-17T17:51:49",
            "upload_time_iso_8601": "2025-08-17T17:51:49.072719Z",
            "url": "https://files.pythonhosted.org/packages/3b/4c/83c7311752d5b38dd383e94aa177ad473f26b9f2a412ac57270ad6cf5d3d/glpkg-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b35ab522c61900fa372a7c2fc78d4450bb18f4a3099ef7c0f06789a231c388a6",
                "md5": "9c66e2305ac3b67194512e943f28a04d",
                "sha256": "0ab16f52030a7fa3e5dc56cf1083fde94f415b80201aaca8590eaed7ace95501"
            },
            "downloads": -1,
            "filename": "glpkg-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9c66e2305ac3b67194512e943f28a04d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8822,
            "upload_time": "2025-08-17T17:51:50",
            "upload_time_iso_8601": "2025-08-17T17:51:50.155485Z",
            "url": "https://files.pythonhosted.org/packages/b3/5a/b522c61900fa372a7c2fc78d4450bb18f4a3099ef7c0f06789a231c388a6/glpkg-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 17:51:50",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "bugproduction",
    "gitlab_project": "glpkg",
    "lcname": "glpkg"
}
        
Elapsed time: 2.04412s