cfenv
Python wrapper for Cloud Foundry environments
What it is and what it does
py-cfenv is a lightweight wrapper around Cloud Foundry's environment variable conventions, designed to make it easier to read app metadata and service credentials in Python applications running on CF. It parses the VCAP_SERVICES and VCAP_APPLICATION JSON structures that Cloud Foundry injects into deployed apps, exposing them through a simple object interface so you can retrieve your app's name, port, and bound service credentials without manual JSON parsing.
The package depends only on furl for URL manipulation and installs with low friction. However, it has been abandoned since early 2019 and is marked Pre-Alpha; it was never intended for production use. Its classifiers list support only up to Python 3.5, and there is no indication of ongoing maintenance or compatibility with modern Python versions or Cloud Foundry API changes.
Use it for:
- Extract app name and port from VCAP_APPLICATION in a Cloud Foundry-deployed Python app.
- Retrieve database connection credentials for a bound PostgreSQL or MySQL service by label.
- Build a service URL from parsed credentials (e.g., redis://user:pass@host:port).
- Simplify environment variable parsing in a legacy Cloud Foundry application still in production.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Cloud Foundry environment variables and service credentials into a simple Python object, extracting app metadata and service connection details from the VCAP_SERVICES environment variable.
No, unless you are maintaining a legacy Cloud Foundry application that already uses this package. The project is abandoned (last commit 2019-01-23), classified as Pre-Alpha, and has not been tested against modern Python versions. If you are starting a new Cloud Foundry project, investigate current Cloud Foundry Python tooling or parse VCAP_SERVICES directly; if you must use this, pin it and test thoroughly in your environment.
Install
cfenv on PyPI
pip
pip install cfenvuv
uv add cfenvpoetry
poetry add cfenvInstalling cfenv
Before you install
Low install friction with a single dependency (furl). However, the package is abandoned—last commit was 2019-01-23, over six years ago, and it is classified as Pre-Alpha. Use only if you are already committed to Cloud Foundry and have no alternative.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or redistribution in your own projects.
Quickstart
pip install cfenv
from cfenv import AppEnv
env = AppEnv()
app_name = env.name
app_port = env.port
redis_service = env.get_service(label='redis')
redis_url = redis_service.get_url(host='hostname', password='password', port='port')
Requires a Cloud Foundry environment with VCAP_SERVICES and VCAP_APPLICATION environment variables set; will not function meaningfully outside a deployed CF app.
Verify before relying
- Whether the package works reliably with modern Python versions (classifiers list only up to 3.5, released 2015–2017).
- Whether furl's current API remains compatible with cfenv's usage patterns.
- Active maintenance status or community forks that may have superseded this project.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — furl |
| Maintenance | abandoned — 3,353 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,642/month — #13,202 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cfenv-0.5.3-py2.py3-none-any.whl
Keywords: cloud, foundry
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
cloudfoundry-clientA Python client library for interacting with…
unclear · top 15,000 on PyPI
foundry-platform-sdkA Python client library for the Foundry API…
permissive · top 5,000 on PyPI
redis-cliProvides a lightweight wrapper around redis-py…
permissive · top 15,000 on PyPI
redis-entraidProvides Entra ID (Azure Active Directory)…
unclear · top 5,000 on PyPI
foundry-local-sdkA Python SDK for discovering, downloading,…
permissive · top 15,000 on PyPI
alibabacloud-credentials-apiProvides credential management interfaces and…
permissive · top 5,000 on PyPI
python-nmapPython wrapper for the nmap port scanner that…
copyleft · top 15,000 on PyPI
port-forport-for finds and remembers unused TCP…
permissive · top 5,000 on PyPI
agent-framework-azure-aiIntegrates Azure AI Foundry memory capabilities…
permissive · top 15,000 on PyPI
cloudauthzCloudauthz obtains temporary credentials from…
permissive · top 15,000 on PyPI