{"id":23839,"library":"harborapi","title":"Harbor API Client","description":"Async Python client for Harbor v2.0 API. Handles authentication, rate limiting, and all CRUD operations for Harbor registry resources (projects, repositories, artifacts, robots, users, etc.). Latest version 0.26.2, requires Python >=3.8. Actively maintained with monthly releases.","status":"active","version":"0.26.2","language":"python","source_language":"en","source_url":"https://github.com/unioslo/harborapi","tags":["harbor","container-registry","async","api-client"],"install":[{"cmd":"pip install harborapi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for async requests","package":"httpx","optional":false},{"reason":"Data validation and serialization","package":"pydantic","optional":false},{"reason":"YAML parsing for configuration","package":"pyyaml","optional":false}],"imports":[{"note":"In older versions HarborClient was in a submodule. Now it's exposed at package level.","wrong":"from harborapi.client import HarborClient","symbol":"HarborClient","correct":"from harborapi import HarborClient"},{"note":"Primary client class for async usage.","symbol":"HarborAsyncClient","correct":"from harborapi import HarborAsyncClient"}],"quickstart":{"code":"import asyncio\nfrom harborapi import HarborAsyncClient\n\nasync def main():\n    client = HarborAsyncClient(\n        url=\"https://your-harbor-instance.com\",\n        username=\"admin\",\n        password=\"password\",  # or use secret\n        verify=True\n    )\n    # List all projects\n    projects = await client.get_projects()\n    for project in projects:\n        print(project.name)\n    await client.close()\n\nasyncio.run(main())","lang":"python","description":"Create an async client, authenticate with username/password, list projects."},"warnings":[{"fix":"Update to Python >=3.8 or pin harborapi==0.21.0","message":"Version 0.22.0+ drops Python 3.7 support. If you are on Python 3.7, pin harborapi<0.22.0.","severity":"breaking","affected_versions":">=0.22.0"},{"fix":"Replace 'from harborapi import create_client' with 'from harborapi import HarborAsyncClient'","message":"In version 0.20.0 the client factory function 'create_client' was removed. Use 'HarborAsyncClient' directly.","severity":"breaking","affected_versions":">=0.20.0"},{"fix":"Wrap client calls with retry logic that re-calls login on 401.","message":"The client does not automatically refresh expired authentication tokens. You must catch '401' errors and re-authenticate.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'verify=True' instead of 'verify_ssl=True'","message":"Parameter 'verify_ssl' is deprecated in v0.25.0+ in favor of 'verify' (bool or SSLContext).","severity":"deprecated","affected_versions":">=0.25.0"}],"env_vars":null,"search_vec":"'0.26.2':31 '3.8':34 'activ':35 'api':2,10,46 'api-cli':45 'artifact':25 'async':4,44 'authent':12 'client':3,6,47 'contain':42 'container-registri':41 'crud':17 'etc':28 'handl':11 'harbor':1,8,20,40 'latest':29 'limit':14 'maintain':36 'month':38 'oper':18 'project':23 'python':5,33 'rate':13 'registri':21,43 'releas':39 'repositori':24 'requir':32 'resourc':22 'robot':26 'user':27 'v2.0':9 'version':30","created_at":"2026-05-01T08:09:54.194874+00:00","updated_at":"2026-05-01T08:09:54.194874+00:00","problems":[{"fix":"Use 'from harborapi import HarborAsyncClient' (or HarborClient if sync, but sync is deprecated).","cause":"Older import path used 'from harborapi.client import HarborClient', but that module was restructured.","error":"ImportError: cannot import name 'HarborClient' from 'harborapi'"},{"fix":"Verify the user/robot has correct permissions in Harbor UI. Use an admin account or robot account with 'system_admin' role.","cause":"The authenticated user does not have the required permissions for the requested resource (e.g., admin privileges).","error":"harborapi.exceptions.Forbidden: Forbidden"},{"fix":"Check the URL (e.g., 'https://myharbor.example.com'). Ensure the host is reachable from your network.","cause":"The Harbor URL provided to the client is incorrect or the DNS cannot resolve the hostname.","error":"httpx.ConnectError: [Errno 8] nodename nor servname provided, or not known"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.26.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/unioslo/harborapi","docs":"https://unioslo.github.io/harborapi/","changelog":"https://github.com/unioslo/harborapi/blob/main/CHANGELOG.md","pypi":"https://pypi.org/project/harborapi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","devops","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}