{"id":24463,"library":"python-watcherclient","title":"python-watcherclient","description":"Python client library for the OpenStack Watcher (optimization) API. Current version: 4.10.0. Release cadence follows OpenStack releases (approx. every 6 months).","status":"active","version":"4.10.0","language":"python","source_language":"en","source_url":"https://opendev.org/openstack/python-watcherclient","tags":["openstack","watcher","client","cloud","optimization"],"install":[{"cmd":"pip install python-watcherclient","lang":"bash","label":"default"}],"dependencies":[{"reason":"Underlying SDK for OpenStack API communication","package":"openstacksdk","optional":false},{"reason":"Authentication","package":"keystoneauth1","optional":false},{"reason":"OpenStack client support","package":"osc-lib","optional":false}],"imports":[{"note":"Hyphen in package name, underscore in module.","wrong":"from python_watcherclient import client","symbol":"client","correct":"from watcherclient import client"}],"quickstart":{"code":"from watcherclient import client\nfrom keystoneauth1 import session\nfrom keystoneauth1.identity import v3\n\nauth = v3.Password(auth_url=os.environ.get('OS_AUTH_URL', 'http://localhost:5000/v3'),\n                   username=os.environ.get('OS_USERNAME', 'admin'),\n                   password=os.environ.get('OS_PASSWORD', 'password'),\n                   project_name=os.environ.get('OS_PROJECT_NAME', 'admin'),\n                   user_domain_name=os.environ.get('OS_USER_DOMAIN_NAME', 'Default'))\nsess = session.Session(auth=auth)\nwc = client.Client(1, session=sess)\nprint(list(wc.audit.list()))","lang":"python","description":"Authenticate and list audits."},"warnings":[{"fix":"Upgrade to Python >= 3.10.","message":"Version 4.0.0 dropped support for Python < 3.8. Version 4.10.0 requires Python >= 3.10.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Migrate to 'openstack watcher' CLI or use osc-lib plugin.","message":"The 'watcherclient.commands' module is deprecated and will be removed in a future release. Use the openstacksdk-based osc-lib plugin instead.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Always create a keystoneauth1 session and pass it to client.Client().","message":"Session object must be passed to client constructor; omitting it causes authentication errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass the API version: client.Client(1, session=sess).","message":"The API version (e.g., 1) is required as first argument to client.Client(). Missing version raises TypeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with 'pip install python-watcherclient' and import as 'from watcherclient import client'.","cause":"Package not installed or wrong import name.","error":"ModuleNotFoundError: No module named 'watcherclient'"},{"fix":"Verify environment variables OS_AUTH_URL, OS_USERNAME, OS_PASSWORD are set correctly.","cause":"Invalid or missing authentication credentials.","error":"watcherclient.exceptions.Unauthorized: Unauthorized"},{"fix":"Call client.Client(1, session=sess) (API version is the first argument).","cause":"API version argument omitted.","error":"TypeError: Client() missing 1 required positional argument: 'version'"},{"fix":"Use version 1 (the only stable version).","cause":"Using unsupported API version.","error":"ValueError: API version x is not supported"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}