========
py-cfenv
========
.. image:: https://img.shields.io/pypi/v/cfenv.svg
:target: http://badge.fury.io/py/cfenv
:alt: Latest version
.. image:: https://img.shields.io/travis/jmcarp/py-cfenv/master.svg
:target: https://travis-ci.org/jmcarp/py-cfenv
:alt: Travis-CI
**py-cfenv** is a tiny utility that simplifies interactions with Cloud Foundry environment variables, modeled after node-cfenv_.
Quickstart
----------
.. code-block:: python
from cfenv import AppEnv
env = AppEnv()
env.name # 'test-app'
env.port # 5000
redis = env.get_service(label='redis')
redis.credentials # {'uri': '...', 'password': '...'}
redis.get_url(host='hostname', password='password', port='port') # redis://pass:host
Keys may change based on the service. To see what keys are available for the app's services:
.. code-block:: bash
$ cf env my-app
Getting env variables for app my-app in org my-org / space my-space as me@example.com...
OK
System-Provided:
{
"VCAP_SERVICES": {
"redis": [
{
"credentials": {
"hostname": "example.redis.host",
"password": "verysecurepassword",
"port": "30773",
"ports": {
"6379/tcp": "30773"
},
"uri": "redis://:verysecurepassword@example.redis.host:30773"
},
"label": "redis",
"name": "example-redis",
"plan": "standard",
"provider": null,
"syslog_drain_url": null,
"tags": [
"redis28",
"redis"
],
"volume_mounts": []
}
]
}
}
.. _node-cfenv: https://github.com/cloudfoundry-community/node-cfenv/
Raw data
{
"_id": null,
"home_page": "https://github.com/jmcarp/py-cfenv",
"name": "cfenv",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "cloud foundry",
"author": "Joshua Carp",
"author_email": "jm.carp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8a/f5/6682c335d19d116b0c076392884784216eb22e5ebe81a9c6ce4aa3ce9027/cfenv-0.5.3.tar.gz",
"platform": "",
"description": "========\npy-cfenv\n========\n\n.. image:: https://img.shields.io/pypi/v/cfenv.svg\n :target: http://badge.fury.io/py/cfenv\n :alt: Latest version\n\n.. image:: https://img.shields.io/travis/jmcarp/py-cfenv/master.svg\n :target: https://travis-ci.org/jmcarp/py-cfenv\n :alt: Travis-CI\n\n**py-cfenv** is a tiny utility that simplifies interactions with Cloud Foundry environment variables, modeled after node-cfenv_.\n\nQuickstart\n----------\n\n.. code-block:: python\n\n from cfenv import AppEnv\n\n env = AppEnv()\n env.name # 'test-app'\n env.port # 5000\n\n redis = env.get_service(label='redis')\n redis.credentials # {'uri': '...', 'password': '...'}\n redis.get_url(host='hostname', password='password', port='port') # redis://pass:host\n\nKeys may change based on the service. To see what keys are available for the app's services:\n\n.. code-block:: bash\n\n $ cf env my-app\n\n Getting env variables for app my-app in org my-org / space my-space as me@example.com...\n OK\n\n System-Provided:\n {\n \"VCAP_SERVICES\": {\n \"redis\": [\n {\n \"credentials\": {\n \"hostname\": \"example.redis.host\",\n \"password\": \"verysecurepassword\",\n \"port\": \"30773\",\n \"ports\": {\n \"6379/tcp\": \"30773\"\n },\n \"uri\": \"redis://:verysecurepassword@example.redis.host:30773\"\n },\n \"label\": \"redis\",\n \"name\": \"example-redis\",\n \"plan\": \"standard\",\n \"provider\": null,\n \"syslog_drain_url\": null,\n \"tags\": [\n \"redis28\",\n \"redis\"\n ],\n \"volume_mounts\": []\n }\n ]\n }\n }\n\n.. _node-cfenv: https://github.com/cloudfoundry-community/node-cfenv/\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python wrapper for Cloud Foundry environments",
"version": "0.5.3",
"project_urls": {
"Homepage": "https://github.com/jmcarp/py-cfenv"
},
"split_keywords": [
"cloud",
"foundry"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "15b05fc4d8dc9fd0807b240cab217c26bb8a37ca22e8f86d0b0e896e6fc16655",
"md5": "15eea7f86af3e3aef1e9e8a611839841",
"sha256": "7815bffcc4a3db350f92517157fafc577c11b5a7ff172dc5632f1042b93073e8"
},
"downloads": -1,
"filename": "cfenv-0.5.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "15eea7f86af3e3aef1e9e8a611839841",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4538,
"upload_time": "2017-06-09T04:43:36",
"upload_time_iso_8601": "2017-06-09T04:43:36.211060Z",
"url": "https://files.pythonhosted.org/packages/15/b0/5fc4d8dc9fd0807b240cab217c26bb8a37ca22e8f86d0b0e896e6fc16655/cfenv-0.5.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8af56682c335d19d116b0c076392884784216eb22e5ebe81a9c6ce4aa3ce9027",
"md5": "41d161bcfb5fb8536cf099d0bacb58da",
"sha256": "c7a91a4c82431acfc35db664c194d5e6cc7f4df3dcb692d0f836a6ceb0156167"
},
"downloads": -1,
"filename": "cfenv-0.5.3.tar.gz",
"has_sig": false,
"md5_digest": "41d161bcfb5fb8536cf099d0bacb58da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3234,
"upload_time": "2017-06-09T04:43:37",
"upload_time_iso_8601": "2017-06-09T04:43:37.517088Z",
"url": "https://files.pythonhosted.org/packages/8a/f5/6682c335d19d116b0c076392884784216eb22e5ebe81a9c6ce4aa3ce9027/cfenv-0.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2017-06-09 04:43:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jmcarp",
"github_project": "py-cfenv",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "cfenv"
}