Package: artifactory
Python interface library for Jfrog ArtifactoryThis module is intended to serve as a logical descendant ofpathlib, a Python 3
module for object-oriented path manipulations. As such, it implements
everything as closely as possible to the origin with few exceptions,
such as stat().Usage ExamplesWalking Directory TreeGetting directory listing:from artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://repo.jfrog.org/artifactory/gradle-ivy-local")
for p in path:
    print pFind all .gz files in current dir, recursively:from artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://repo.jfrog.org/artifactory/distributions/org/")

for p in path.glob("**/*.gz"):
    print pDownloading ArtifactsDownload artifact to a local filesystem:from artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://repo.jfrog.org/artifactory/distributions/org/apache/tomcat/apache-tomcat-7.0.11.tar.gz")

with path.open() as fd:
    with open("tomcat.tar.gz", "wb") as out:
        out.write(fd.read())Uploading ArtifactsDeploy a regular filemyapp-1.0.tar.gzfrom artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/libs-snapshot-local/myapp/1.0")
path.mkdir()

path.deploy_file('./myapp-1.0.tar.gz')Deploy a debian packagemyapp-1.0.debfrom artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/ubuntu-local/pool")
path.deploy_deb('./myapp-1.0.deb',
                distribution='trusty',
                component='main',
                architecture='amd64')AuthenticationTo provide username and password to access restricted resources, you can
passauthparameter to ArtifactoryPath:from artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/myrepo/restricted-path",
    auth=('admin', 'ilikerandompasswords'))
path.touch()SSL Cert Verification OptionsSeeRequests - SSL
verificationfor more details.from artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/libs-snapshot-local/myapp/1.0")… is the same asfrom artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/libs-snapshot-local/myapp/1.0",
    verify=True)Specify a local cert to use as client side certificatefrom artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/libs-snapshot-local/myapp/1.0",
    cert="/path_to_file/server.pem")Disable host cert verificationfrom artifactory import ArtifactoryPath
path = ArtifactoryPath(
    "http://my-artifactory/artifactory/libs-snapshot-local/myapp/1.0",
    verify=False)Note:If host cert verification is disabled urllib3 will throw aInsecureRequestWarning.To disable these warning, one needs to call
urllib3.disable_warnings().import requests.packages.urllib3 as urllib3
urllib3.disable_warnings()Global Configuration FileArtifactory Python module also has a way to specify all
connection-related settings in a central file,~/.artifactory_python.cfgthat is read upon the creation of firstArtifactoryPathobject and is stored globally. For instance, you can
specify per-instance settings of authentication tokens, so that you
won’t need to explicitly passauthparameter toArtifactoryPath.Example:[http://artifactory-instance.com/artifactory]
username = deployer
password = ilikerandompasswords
verify = false

[another-artifactory-instance.com/artifactory]
username = foo
password = @dmin
cert = ~/mycertWhether or not you specifyhttp://orhttps://prefix is not
essential. The module will first try to locate the best match and then
try to match URLs without prefixes. So if in the config you specifyhttps://my-instance.localand callArtifactoryPathwithhttp://my-instance.local, it will still do the right thing.