harborapi
Async Harbor API v2.0 client
What it is and what it does
harborapi is an async Python client for Harbor, the open-source container registry. It wraps Harbor's REST API v2.0 with full type hints and Pydantic validation, allowing you to programmatically manage projects, artifacts, robots, vulnerability reports, and other registry resources. The library acknowledges that the official Harbor API spec contains errors and inconsistencies; it applies local fixes to make validation usable where the spec and actual API responses diverge.
You instantiate a HarborAsyncClient with your Harbor URL and credentials, then call async methods like get_projects(), create_project(), get_artifacts(), and get_artifact_vulnerability_reports(). Built-in retry logic via backoff handles transient failures automatically. Optional Rich support provides pretty-printed output. The library supports Python 3.8–3.12 and is classified as Beta.
Use it for:
- Automate project and artifact management in Harbor from Python scripts or CI/CD pipelines.
- Fetch vulnerability reports for container images and integrate them into security scanning workflows.
- Query and manage robot accounts and permissions programmatically for registry access control.
- Build monitoring or audit tools that track Harbor projects, repositories, and artifact metadata.
- Integrate Harbor operations into larger container orchestration or DevOps automation frameworks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Async Python client for the Harbor container registry REST API v2.0, with full type hints, Pydantic validation, and built-in retry logic.
Yes, if you need to automate Harbor registry operations from Python. The library is mature (Beta, since 2022), has no known vulnerabilities, and low install friction. The dormant maintenance status is acceptable for a stable API client—the last release fixed a recent httpx compatibility issue. Verify that its workarounds for Harbor API spec inconsistencies align with your Harbor version before committing to production use.
Install
harborapi on PyPI
pip
pip install harborapiuv
uv add harborapipoetry
poetry add harborapiInstalling harborapi
Before you install
Low friction: pure Python wheel with four lightweight runtime dependencies (backoff, httpx, pydantic, typing-extensions). Maintenance is dormant—last release 2025-01-21 with a recent fix for httpx>=0.28.0 compatibility, but no active development signals beyond bug fixes.
License in practice
MIT license (permissive). No restrictions on commercial or private use; you may modify and redistribute under the same license.
Quickstart
pip install harborapi
import asyncio
from harborapi import HarborAsyncClient
async def main():
client = HarborAsyncClient(
url="https://demo.goharbor.io/api/v2.0/",
username="user",
secret="pass"
)
projects = await client.get_projects()
for p in projects:
print(p.name)
asyncio.run(main())
Requires Python 3.8+; async/await syntax mandatory; Harbor API endpoint URL and credentials required.
Verify before relying
- Whether the library's workarounds for Harbor API spec inconsistencies remain sufficient for current Harbor versions.
- Current maintenance commitment and response time for bug reports or compatibility issues.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — backoff, httpx, pydantic, typing-extensions |
| Maintenance | dormant — 570 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,247/month — #14,175 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: harborapi-0.26.2-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
harborHarbor is a framework for running and…
permissive · top 5,000 on PyPI
legit-api-clientA Python client library for interacting with an…
permissive · top 15,000 on PyPI
azure-containerregistryClient library for managing container images,…
permissive · top 5,000 on PyPI
harbor-rewardkitHarbor Rewardkit defines and runs verifiers for…
permissive · top 5,000 on PyPI
socketdevA Python SDK that wraps the Socket.dev REST…
permissive · top 15,000 on PyPI
azure-mgmt-containerregistryManages Azure Container Registry…
unclear · top 5,000 on PyPI
neptune-apiA generated Python client library for the…
permissive · top 5,000 on PyPI
google-cloud-artifact-registryPython client library for Google Cloud Artifact…
permissive · top 5,000 on PyPI
google-cloud-containeranalysisPython client library for Google Cloud…
permissive · top 15,000 on PyPI
GitHubKitA fully typed Python SDK for GitHub's REST and…
permissive · top 5,000 on PyPI