Use this API to interact with the PyPI package manager client.
This API is used by the PyPI package manager client and is generally not meant for manual consumption.
These endpoints do not adhere to the standard API authentication methods. See the PyPI package registry documentation for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.
Twine 3.4.2 or greater is recommended when FIPS mode is enabled.
Download a package file from a group
GET /api/v4/groups/{id}/-/packages/pypi/files/{sha256}/{file_identifier}
Downloads a specified PyPI package file for a group. The package descriptor endpoint usually supplies this URL. This feature was introduced in GitLab 13.12
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | ID or URL- |
file_Path, | String | The Py Example: my. |
sha256Path, | String | The Py Example: 5y57017232013c8ac806 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a group
GET /api/v4/groups/{id}/-/packages/pypi/simple
Lists all packages for a specified group in an HTML file.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi Simple Group Package Endpoint
GET /api/v4/groups/{id}/-/packages/pypi/simple/{package_name}
Retrieves the package descriptor as an HTML file for a specified package in a group. The HTML lists a link to each package file, with its SHA256 checksum and its data-requires-python value. This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | ID or URL- |
package_Path, | String | The Py Example: my. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Upload a package
POST /api/v4/projects/{id}/packages/pypi
Uploads a PyPI package for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
author_ | String | Email address for the package author Example: cschultz@example. |
contentRequired | String (binary) | The package file to be published (generated by Multipart middleware) |
description | String | Description of the package |
description_ | String | Type of content for the package description Example: text/ |
keywords | String | Keywords listed for the package Example: dog, |
md5_ | String | MD5 checksum of the package Example: 900150983cd24fb0d696 |
metadata_ | String | Metadata version of the package Example: 2. |
nameRequired | String | Name of the package Example: my. |
requires_ | String | Py Example: >=3. |
sha256_ | String | SHA256 checksum of the package.pip install fails because package index URLs lack required checksumsPattern: (?:Example: ba7816bf8f01cfea4141 |
summary | String | Short summary of the package Example: A module for collecting votes from beagles. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
422 | Unprocessable Entity | — |
Authorize the PyPi package upload from workhorse
POST /api/v4/projects/{id}/packages/pypi/authorize
This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi package download endpoint
GET /api/v4/projects/{id}/packages/pypi/files/{sha256}/{file_identifier}
Downloads a specified PyPI package file for a project. The package descriptor endpoint usually supplies this URL. This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
file_Path, | String | The Py Example: my. |
sha256Path, | String | The Py Example: 5y57017232013c8ac806 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a project
GET /api/v4/projects/{id}/packages/pypi/simple
Lists all packages for a specified project in an HTML file.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi Simple Project Package Endpoint
GET /api/v4/projects/{id}/packages/pypi/simple/{package_name}
Retrieves the package descriptor as an HTML file for a specified package in a project. The HTML lists a link to each package file, with its SHA256 checksum and its data-requires-python value. This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | String | The Py Example: my. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |