{"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,"search_vec":"'4.10.0':15 '6':23 'api':12 'approx':21 'cadenc':17 'client':5,27 'cloud':28 'current':13 'everi':22 'follow':18 'librari':6 'month':24 'openstack':9,19,25 'optim':11,29 'python':2,4 'python-watchercli':1 'releas':16,20 'version':14 'watcher':10,26 'watchercli':3","created_at":"2026-05-01T08:13:12.483446+00:00","updated_at":"2026-05-01T08:13:12.483446+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.10.0","cli_name":"watcher","cli_version":"watcher 4.10.0","type":"library","homepage":"https://docs.openstack.org/python-watcherclient/latest/","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/python-watcherclient/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","devops"],"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}}