Registry / devops / dohq-artifactory

dohq-artifactory

JSON →
library1.0.2pypypi✓ verified 25d ago

dohq-artifactory is an active Python interface library for JFrog Artifactory, released as version 1.0.1. It functions as a logical descendant of Python's `pathlib`, aiming for a similar interface, and was forked from the `parallels/artifactory` project to provide continued support and development. It supports Python versions 3.8 through 3.13. The library enables interaction with Artifactory for tasks such as managing artifacts, searching repositories, and handling administrative functions. It generally follows an on-demand release cadence based on feature development and bug fixes.

pip install dohq-artifactory
INSTALL
IMPORT
SIG · DOHQ-ARTIFACTORY
D
dohq-artifactory
devopspythonv1.0.2
Install
2.5s avg
Import
410ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.418s · 22.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.402s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ArtifactoryPath
from artifactory import ArtifactoryPath
from dohq_artifactory import ArtifactoryPath
Despite the package name `dohq-artifactory`, the primary class `ArtifactoryPath` is imported directly from the `artifactory` module. This is due to it being a fork of a previous 'artifactory' library and maintaining the original module import path.
ArtifactoryPath
from artifactory import ArtifactoryPath
import artifactory
While `import artifactory` works, accessing `ArtifactoryPath` would require `artifactory.ArtifactoryPath`. Direct import of the class is more common.

This quickstart demonstrates how to connect to an Artifactory instance using `ArtifactoryPath` and basic authentication. It then shows how to list contents of a repository and check for the existence and properties of a specific artifact, leveraging the `pathlib`-like interface.

import os from artifactory import ArtifactoryPath ART_URL = os.environ.get('ARTIFACTORY_URL', 'https://artifactory.example.com/artifactory') ART_USER = os.environ.get('ARTIFACTORY_USERNAME', 'admin') ART_PASS = os.environ.get('ARTIFACTORY_PASSWORD', 'password') # Or API Key/Access Token try: # Initialize ArtifactoryPath with URL and authentication artifactory_path = ArtifactoryPath(ART_URL, auth=(ART_USER, ART_PASS)) # Example: List contents of a repository (e.g., 'libs-release') repo = artifactory_path / "libs-release" print(f"Contents of {repo}:") for item in repo: print(f" - {item.name} ({'dir' if item.is_dir() else 'file'})") # Example: Access a specific artifact (assuming it exists) artifact_path = repo / "com" / "example" / "myapp" / "1.0.0" / "myapp-1.0.0.jar" if artifact_path.exists(): print(f"\nArtifact found: {artifact_path.name}") print(f" Size: {artifact_path.stat().size} bytes") else: print(f"\nArtifact not found: {artifact_path}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
gotchaThe library is imported via `from artifactory import ...` despite the PyPI package name being `dohq-artifactory`. This can lead to confusion if users expect `from dohq_artifactory import ...` or if another `artifactory` package exists in the environment.
fix
Always use `from artifactory import ArtifactoryPath` for imports.
affects: All versions
deprecatedJFrog Artifactory itself has deprecated API keys as an authentication method. As of Artifactory version 7.98 (Q4 2024), creation of new API keys is disabled, with a push towards reference tokens. While `dohq-artifactory` still supports passing an API key via the `auth` or `apikey` parameter, users of newer Artifactory server versions should consider migrating to username/password or access tokens to avoid future compatibility issues.
fix
Prefer using username/password tuples (`auth=('user', 'password')`) or explicit access tokens (`token='your_access_token'`) for authentication with `ArtifactoryPath`, especially with modern Artifactory instances. Consult JFrog documentation for the latest authentication recommendations.
affects: All versions of dohq-artifactory when used with Artifactory server versions 7.98+ or in 2025 onwards.
gotchaThis library is designed as a 'logical descendant of pathlib', meaning interactions often mimic filesystem operations. Users accustomed to traditional HTTP client libraries might find this paradigm different and should review the documentation for `pathlib`-like methods such as `exists()`, `is_dir()`, `iterdir()`, and path concatenation (`/`).
fix
Familiarize yourself with Python's `pathlib` module and the `dohq-artifactory` documentation to understand its filesystem-like approach to Artifactory resources.
affects: All versions
Errors
Common errors & fixes
ImportError: No module named 'artifactory'
This typically occurs when the `dohq-artifactory` package is installed, but the Python interpreter cannot locate the 'artifactory' module, or there's a conflict with an older `parallels/artifactory` package.
fix
Ensure `dohq-artifactory` is installed in your active Python environment (`pip install dohq-artifactory --upgrade`) and that no conflicting `artifactory` package is present. If both are installed, uninstall `artifactory` first.
AttributeError: 'ArtifactoryPath' object has no attribute 'aql'
This specific error arises when both `dohq-artifactory` and the older `parallels/artifactory` package are installed, leading to the older `ArtifactoryPath` class (which lacks AQL support) being loaded instead of the one from `dohq-artifactory`.
fix
Uninstall the older `artifactory` package (`pip uninstall artifactory`) and ensure only `dohq-artifactory` is installed in your environment.
AttributeError: module 'pathlib' has no attribute 'posixpath'
This error, or similar `AttributeError`s related to `pathlib`, occurs when an older version of `dohq-artifactory` is used with a newer Python version (e.g., Python 3.13), due to changes in Python's internal `pathlib` API.
fix
Upgrade `dohq-artifactory` to the latest compatible version (1.0.1 or newer for Python 3.13 support) using `pip install dohq-artifactory --upgrade`.
401 Unauthorized / 403 Forbidden
These HTTP status codes indicate that the provided credentials (username/password, API key, or access token) are incorrect, expired, or the user lacks the necessary permissions for the requested operation on the Artifactory instance.
fix
Verify the Artifactory URL and ensure your username, password, API key, or access token are correct and have the required permissions. Pass authentication details correctly via the `auth`, `apikey`, or `token` parameters to `ArtifactoryPath` or `ArtifactorySaaSPath`.
AttributeError: 'str' object has no attribute 'drive'
This error typically occurs when a string is passed to a `dohq-artifactory` method (e.g., `copy`, `move`) that expects an `ArtifactoryPath` object.
fix
Ensure that all path arguments passed to `dohq-artifactory` methods are instances of `ArtifactoryPath`. Convert string paths to `ArtifactoryPath` objects like: `my_path = ArtifactoryPath('http://your-artifactory/repo/path')`.
Upgrade
Version history
1.0.2latest on PyPI · released Aug 19, 2026
Audit
Dependencies
requestsrequiredHTTP client for Artifactory API communication
python-dateutilrequiredDate and time utilities
PyJWTrequiredJSON Web Token support for authentication
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
dohq-artifactory — pip install dohq-artifactory · libregistry