New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vcap-services

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vcap-services

Client library to parse and return service credentials from environment variables that IBM Cloud provides.

  • 1.0.0
  • PyPI
  • Socket score

Maintainers
1

vcap_service_python

|Build Status| |Coverage Status|

Parse and return service credentials from environment variables that IBM Cloud <http://console.bluemix.net/>__ provides.

Installation

.. code:: sh

$ pip install vcap_services

Usage

.. code:: sh

from vcap_services import load_from_vcap_services
credentials = load_from_vcap_services('personality_insights')
print(credentials);

If VCAP_SERVICES is:

.. code:: json

{
  "personality_insights": [{
      "credentials": {
        "password": "<password>",
        "url": "<url>",
        "username": "<username>"
      },
    "label": "personality_insights",
    "name": "personality-insights-service",
    "plan": "standard"
  }]
}

Output:

.. code:: json

{
  "password": "<password>",
  "url": "<url>",
  "username": "<username>"
}

Getting credentials for a specific plan


Get credentials that match a specific service plan (only for
``VCAP_SERVICES``).

.. code:: sh

    from vcap_services import load_from_vcap_services
    credentials = load_from_vcap_services('personality_insights', 'standard')
    print(credentials);

Getting credentials for a specific instance

Get credentials that match a specific service instance (replace "YOUR NLC NAME" with the name of your service instance).

.. code:: sh

from vcap_services import load_from_vcap_services
credentials = load_from_vcap_services('natural_language_classifier', None, 'YOUR NLC NAME')
print(credentials);

Getting credentials for a specific plan and instance


Get credentials that match a specific service plan and instance (replace
"YOUR NLC NAME" with the name of your service instance).

.. code:: sh

    from vcap_services import load_from_vcap_services
    credentials = load_from_vcap_services('natural_language_classifier', 'standard', 'YOUR NLC NAME')
    print(credentials);

Tests
-----

Running all the tests:

.. code:: sh

    $ pip install -r requirements.txt
    $ cp .env.mock .env
    $ pytest --cov=vcap_services

License
-------

MIT.

Contributing
------------

See
`CONTRIBUTING <https://github.com/mamoonraja/vcap-services-python/blob/master/CONTRIBUTING.md>`__.

.. |Build Status| image:: https://travis-ci.org/mamoonraja/vcap-services-python.svg?branch=master
   :target: https://travis-ci.org/mamoonraja/vcap-services-python/
.. |Coverage Status| image:: https://coveralls.io/repos/mamoonraja/vcap-services-python/badge.svg?branch=master&service=github
   :target: https://coveralls.io/github/mamoonraja/vcap-services-python?branch=master

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc