Skip to main content

do_artifactory

Introduction

"do_artifactory" is an Artifactory API that makes the common artifact operations really easy to do with just a few lines of code.

MAINTAINERS:

- Daniel Oberti (obertidaniel@gmail.com)

Install this package

Using a distribuible package:

This project is deployed as a python package. Once cloned we advice to install it with pip. In order to do that the user needs to open a command prompt, go into the directory containing the project and execute the next command:

git clone <REPO>
# creating the dist. package
cd <REPO>
python setup.py sdist

# install the dist. package (located on folder "dist")
pip install <PACKAGE.tar.gz>

Using git + pip

git clone <REPO>
pip install -e <PACKAGE>

Using pypi

How to - uploading to pypi

# install the required tools
python -m pip install -U pip setuptools twine
python setup.py bdist_wheel
# (publicar en pypi)
python -m twine upload dist/* --skip-existing

How to - install from pypi

# install the package anywhere:
pip install <PACKAGE>

Uninstall this package

pip uninstall <PACKAGE>

Getting started

Usage:

Using the environment:

# Set your Linux environment as shown below or use an yaml file:
setenv ARTIF_URL https://<YOURSERVER>/artifactory/
setenv ARTIF_REPO <ARTIF_REPO>
setenv ARTIF_USER <ARTIF_USER>
setenv ARTIF_PASS <ARTIF_PASS> #(Recomandation: use a token, never the admin password)

Using a config.yml:

VERBOSE_LEVEL: 0
ARTIF_URL: https://<YOURSERVER>/artifactory/
ARTIF_REPO: <ARTIF_REPO>
ARTIF_USER: <ARTIF_USER>
ARTIF_PASS: <ARTIF_PASS>

Importing it on your python script:

from do_artifactory import DoArtifactory
arti = DoArtifactory(config='config.yml')

Methods and examples:

Upload files

# upload "filename.txt" to an specific "target_path"
arti.upload("filename.txt", target_path="arti_folder/example/")

Download file/folder as a compressed file

# Download "dirB" as "download.zip"
arti.download(_path_source="dirA/dirB", _repo="project_A")

# Download "file.txt" as "download.zip"
arti.download(_path_source="dirA/dirB/file.txt", _repo="project_A")

List releases

Based on the idea you are using the next dir structure:

<REPOSITORY>/
        release/
            <VERSION1>/
                <RELEASE-FILE1>
                <RELEASE-FILE2>
            <VERSION2>/
                <RELEASE-FILE3>
# Get a list with the releases versions of "project_A"
arti.list_releases(_repo="project_A")

Download a release

# Download the specific release "v0.0.1" from "project_A"
arti.download_release(_repo="project_A", version="v0.0.1")

# Download the latest release from "project_A"
arti.download_release(_repo="project_A")

Show file/s on an specific path and navigate a repository

There are a list of methods that allow you to show the list of files into the "current_path"

"current_path" starts as default on the root path ("."), but you can change it by using the next methods:

# set the current path to another one
arti.set_current_path(path="dir_A/dir_B")

# get the current path
arti.get_current_path()

Using the last two methods in combination with the next methods, it allows you to navigate the artifactory repositories and use some filters if needed.

The method search, allows you to get an artifacts_list based on the "current_path", for example:

# Get the artifacts (files + folders) from "project_A" on the "current_path"
arti.search(_repo="project_A")

# Get the artifacts (folders) from "project_A" on the "current_path"
# _type options are: (file/folder/any)
arti.search(_repo="project_A", _type='folder')

# Get the artifacts (folders) from "project_A" on the "current_path", but showing only the coincidence with "DirB"
arti.search(_name="DirB", _repo="project_A", _type='folder')

# Get the list of fullpaths from the root
arti.get_list_path(_repo="project_A", _folder='')

# Get the list of fullpaths starting from "/dir_A/dir_B/"
arti.get_list_path(_repo="project_A", _folder='/dir_A/dir_B/')

References:

Metadata

Release files for do-artifactory 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for do-artifactory 0.0.8
File Interpreter ABI Platform Actions
do_artifactory-0.0.8-py2.py3-none-any.whl Python 3, Python 2 none any Details for do_artifactory-0.0.8-py2.py3-none-any.whl

Release files / do_artifactory-0.0.8-py2.py3-none-any.whl

Download URL do_artifactory-0.0.8-py2.py3-none-any.whl
Size 11.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8365787d7c45781ab345cd6bd2021287f59a67e94bba9b479146fdf157927d11
BLAKE2b-256 checksum
How to use checksums
1d415aef686f3c8c2efde8d17c82ae97af437e7175d0be2b2d53f6f79479b2f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for do-artifactory 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page