{"id":21050,"library":"cloudfoundry-client","title":"Cloud Foundry Python Client","description":"A client library for interacting with Cloud Foundry APIs. Current version 1.40.3 (released 2025-03-10), supports Python >=3.10. Maintained by the Cloud Foundry community with regular releases.","status":"active","version":"1.40.3","language":"python","source_language":"en","source_url":"https://github.com/cloudfoundry-community/cf-python-client","tags":["cloudfoundry","cf","paas","api-client","cloud"],"install":[{"cmd":"pip install cloudfoundry-client","lang":"bash","label":"Latest from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"WebSocket support for logs/streaming","package":"websocket-client","optional":true},{"reason":"YAML configuration parsing","package":"pyyaml","optional":true}],"imports":[{"note":"Direct import from client module.","symbol":"CloudFoundryClient","correct":"from cloudfoundry_client.client import CloudFoundryClient"},{"note":"V2 resources are under v2 subpackage.","symbol":"Organization","correct":"from cloudfoundry_client.v2.organizations import Organization"}],"quickstart":{"code":"from cloudfoundry_client.client import CloudFoundryClient\n\napi_endpoint = 'https://api.cf.example.com'\nclient_id = os.environ.get('CF_CLIENT_ID', '')\nclient_secret = os.environ.get('CF_CLIENT_SECRET', '')\nclient = CloudFoundryClient(api_endpoint, client_id=client_id, client_secret=client_secret)\nclient.init()\norgs = client.organizations.list()\nfor org in orgs:\n    print(org['entity']['name'])","lang":"python","description":"Initialize client with OAuth2 credentials and list organizations."},"warnings":[{"fix":"Use keyword arguments: CloudFoundryClient(endpoint, client_id=..., client_secret=..., ...)","message":"In v1.24.0, the client initialization changed from positional arguments to keyword-only for OAuth parameters. Old code using positional arguments will break.","severity":"breaking","affected_versions":">=1.24.0"},{"fix":"Always call client.init() after instantiation, or pass a refresh_token to enable automatic refresh.","message":"The client does not automatically refresh tokens; you must call client.init() or use a refresh_token.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to V2 or V3 resources, e.g., from cloudfoundry_client.v2 import ...","message":"V1 API resources (e.g., cloudfoundry_client.v1) are deprecated and will be removed in a future version.","severity":"deprecated","affected_versions":">=1.30.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from cloudfoundry_client.client import CloudFoundryClient","cause":"Incorrect import path; CloudFoundryClient is not at top-level.","error":"ImportError: cannot import name 'CloudFoundryClient' from 'cloudfoundry_client'"},{"fix":"Call client.init() after creating the client object.","cause":"Forgot to call client.init() before making API calls.","error":"AttributeError: 'NoneType' object has no attribute 'list'"},{"fix":"Ensure client_id and client_secret are correct and the client has the required scopes.","cause":"OAuth token missing or insufficient permissions.","error":"requests.exceptions.HTTPError: 403 Client Error: Forbidden"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}