{"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,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}