{"id":21030,"library":"cfenv","title":"cfenv","description":"Python wrapper for Cloud Foundry environments, providing easy access to VCAP_SERVICES and VCAP_APPLICATION environment variables. Current version: 0.5.3, updates infrequent.","status":"active","version":"0.5.3","language":"python","source_language":"en","source_url":"https://github.com/jmcarp/py-cfenv","tags":["cloud-foundry","environment","vcap"],"install":[{"cmd":"pip install cfenv","lang":"bash","label":"Install"}],"dependencies":[],"imports":[{"note":"Commonly imported correctly, but sometimes confused with CfEnv.","wrong":"","symbol":"CfApp","correct":"from cfenv import CfApp"},{"note":"Main class for accessing environment.","wrong":"","symbol":"CfEnv","correct":"from cfenv import CfEnv"}],"quickstart":{"code":"from cfenv import CfEnv\n\ncfenv = CfEnv()\nprint('App name:', cfenv.name)\nprint('URI:', cfenv.uri)\nprint('Port:', cfenv.port)","lang":"python","description":"Basic usage of CfEnv to get Cloud Foundry app information."},"warnings":[{"fix":"Wrap in try-except or check the environment first.","message":"CfEnv() expects VCAP_APPLICATION to be set; throws AttributeError if not in a Cloud Foundry environment.","severity":"gotcha","affected_versions":"all"},{"fix":"Use .get() with default or check key existence.","message":"Accessing service credentials via cfenv.get_credential() may return None if key missing.","severity":"gotcha","affected_versions":"all"},{"fix":"Use keyword arguments: cfenv.get_service(name='my-service')","message":"Methods like .get_service() may be renamed; prefer .get_service(name=...) over positional args.","severity":"deprecated","affected_versions":">0.5.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you are running inside Cloud Foundry or set VCAP_APPLICATION manually for testing.","cause":"Usually missing or malformed VCAP_APPLICATION environment variable.","error":"AttributeError: 'CfEnv' object has no attribute 'name'"},{"fix":"Run: pip install cfenv","cause":"Library not installed.","error":"ImportError: No module named cfenv"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}