Registry / devops / cloudfoundry-client

cloudfoundry-client

JSON →
library1.40.3pypypi✓ verified 87d ago

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.

pip install cloudfoundry-client
INSTALL
IMPORT
SIG · CLOUDFOUNDRY-CLIEN
C
cloudfoundry-client
devopspythonv1.40.3
Install
5.0s avg
Import
1236ms
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.40.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.432s · 35.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.0s · import 1.040s · 38MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CloudFoundryClient
from cloudfoundry_client.client import CloudFoundryClient
Direct import from client module.
Organization
from cloudfoundry_client.v2.organizations import Organization
V2 resources are under v2 subpackage.

Initialize client with OAuth2 credentials and list organizations.

from cloudfoundry_client.client import CloudFoundryClient api_endpoint = 'https://api.cf.example.com' client_id = os.environ.get('CF_CLIENT_ID', '') client_secret = os.environ.get('CF_CLIENT_SECRET', '') client = CloudFoundryClient(api_endpoint, client_id=client_id, client_secret=client_secret) client.init() orgs = client.organizations.list() for org in orgs: print(org['entity']['name'])
Debug
Known issues
breakingIn v1.24.0, the client initialization changed from positional arguments to keyword-only for OAuth parameters. Old code using positional arguments will break.
fix
Use keyword arguments: CloudFoundryClient(endpoint, client_id=..., client_secret=..., ...)
affects: >=1.24.0
gotchaThe client does not automatically refresh tokens; you must call client.init() or use a refresh_token.
fix
Always call client.init() after instantiation, or pass a refresh_token to enable automatic refresh.
affects: all
deprecatedV1 API resources (e.g., cloudfoundry_client.v1) are deprecated and will be removed in a future version.
fix
Migrate to V2 or V3 resources, e.g., from cloudfoundry_client.v2 import ...
affects: >=1.30.0
Errors
Common errors & fixes
ImportError: cannot import name 'CloudFoundryClient' from 'cloudfoundry_client'
Incorrect import path; CloudFoundryClient is not at top-level.
fix
Use: from cloudfoundry_client.client import CloudFoundryClient
AttributeError: 'NoneType' object has no attribute 'list'
Forgot to call client.init() before making API calls.
fix
Call client.init() after creating the client object.
requests.exceptions.HTTPError: 403 Client Error: Forbidden
OAuth token missing or insufficient permissions.
fix
Ensure client_id and client_secret are correct and the client has the required scopes.
Upgrade
Version history
1.40.3latest on PyPI · released Feb 10, 2026
Audit
Dependencies
requestsrequiredHTTP client for API calls
websocket-clientoptionalWebSocket support for logs/streaming
pyyamloptionalYAML configuration parsing
Agent activity
8 hits · last 30 days
node
8
Resources
cloudfoundry-client — pip install cloudfoundry-client · libregistry