pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python-gitlab/python-gitlab/blob/refs/heads/main/docs/gl_objects/packages.rst

6a1af.css" /> python-gitlab/docs/gl_objects/packages.rst at refs/heads/main · python-gitlab/python-gitlab · GitHub
Skip to content

Latest commit

 

History

History
159 lines (102 loc) · 3.49 KB

File metadata and controls

159 lines (102 loc) · 3.49 KB

Packages

Packages allow you to utilize GitLab as a private repository for a variety of common package managers, as well as GitLab's generic package registry.

Project Packages

Reference

Examples

List the packages in a project:

packages = project.packages.list(get_all=True)

Filter the results by package_type or package_name

packages = project.packages.list(package_type='pypi', get_all=True)

Get a specific package of a project by id:

package = project.packages.get(1)

Delete a package from a project:

package.delete()
# or
project.packages.delete(package.id)

Group Packages

Reference

Examples

List the packages in a group:

packages = group.packages.list(get_all=True)

Filter the results by package_type or package_name

packages = group.packages.list(package_type='pypi', get_all=True)

Project Package Files

Reference

Examples

List package files for package in project:

package = project.packages.get(1)
package_files = package.package_files.list(get_all=True)

Delete a package file in a project:

package = project.packages.get(1)
file = package.package_files.list(get_all=False)[0]
file.delete()

Project Package Pipelines

Reference

Examples

List package pipelines for package in project:

package = project.packages.get(1)
package_pipelines = package.pipelines.list(get_all=True)

Generic Packages

You can use python-gitlab to upload and download generic packages.

Reference

Examples

Upload a generic package to a project:

project = gl.projects.get(1, lazy=True)
package = project.generic_packages.upload(
    package_name="hello-world",
    package_version="v1.0.0",
    file_name="hello.tar.gz",
    path="/path/to/local/hello.tar.gz"
)

Download a project's generic package:

project = gl.projects.get(1, lazy=True)
package = project.generic_packages.download(
    package_name="hello-world",
    package_version="v1.0.0",
    file_name="hello.tar.gz",
)

Hint

You can use the Packages API described above to find packages and retrieve the metadata you need download them.

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy