Skip to main content

Lightweight Python client to the Artifactory API.

Project description

Python client for the Artifactory API

Usage

Key Points

  • Configuration is pre-loaded from party_config.py, but can be overridden at runtime

  • A new class must first be instantiated

  • Any properties returned from using a “find” or “get” method are assigned to the class instance

  • Properties are NOT appended. To add multiple properties to a class, get them all in one call.

Some example code:

import party

artifact = party.Party()

artifact.artifactory_url = "http://myserver.com/api"  # <= Runtime config change

Find Artifact by Name

myFile = "my-file.rpm"
result = artifact.find(myFile)

Find Artifact By Properties

file_props = {
    "build.number": 999,
    "rpm.version": "1.0.0.999"
}
result = artifact.find_by_properties(file_props)

Find Artifact by Pattern

result = artifact.find_by_pattern("erlang*R15B*.rpm")

Get Specific Artifact Properties

specific_properties = [ "build.number", "rpm.version" ]
result = artifact.get_properties(artifact, specific_properties)

Set Properties on an Artifact

new_properties = {
    "myKey": "myValue"
}
result = artifact.set_properties(artifact, new_properties)

CONFIGURING PARTY

Party class instances load in the values from party_config.py. However, those values can be overridden directly in the file, or at runtime using:

artifact = party.Party()
artifact.CONFIG_KEY = "new value"

The following is a list of config keys (CONFIG_KEY above) and descriptions of their purposes:

artifactory_url - Base URL to your Artifactory instance.
    search_prop - Artifactory API endpoint used for the property search.
    search_name - Artifactory API endpoint to access quick search.
   search_repos - Artifactory API endpoint to search for repositories.
       username - Username credential to use to connect to the Artifactory instance.
       password - Base64 encoded password credential used to connect to the Artifactory instance.
        headers - JSON (Python dict) of headers to send in the Artifactory queries.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

party-1.6.1.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file party-1.6.1.tar.gz.

File metadata

  • Download URL: party-1.6.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for party-1.6.1.tar.gz
Algorithm Hash digest
SHA256 91d8e9adfd36486305e9d4658ae30c51dd5d95808a8ac0336583ed74bdfbd903
MD5 1564e63cf5a5808481c2aefbfb20891a
BLAKE2b-256 1c078114952e2a2f1d0a17820503cac9a7717be5121000ffca6e5a835696f644

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page