{ "info": { "author": "Will Stevens", "author_email": "wstevens@cloudops.com", "bugtrack_url": null, "classifiers": [], "description": "CPBM BSS API Wrapper\n====================\n\nThis project is a minimalist wrapper around the CPBM BSS API. Its\npurpose is to provide a CPBM BSS library that works independent of the CPBM version.\nInstead of having function stubs for all of the CPBM BSS features, this lib is used\nin conjunction with the CPBM BSS API documentation and the `request` function takes\nthe JSON values needed for each call.\n\nThere are two ways in which this lib can be consumed:\n\n1. The `API` class can be instantiated from any code. It has a single `request`\n method, which is used to make API calls against the CPBM BSS API. This method \n takes a python dictionary of request parameters and returns a python dictionary \n with the result.\n\n2. The `CLI` class is a subclass of `API` and is designed to be a convenience\n class for working with stand alone scripts that populate the `API` constructor\n using command line arguments parsed by `docopt`. The command line arguments can be\n passed in directly or they can be added to a JSON file and the `--json` flag can\n be used to reference the JSON file path. A `cli_example.py` file is included in\n the package to give a working example of how to use this use case.\n\nThe core of this library is a single `request` method which is described as follows.\n\n``` python\napi.request(self, rest_path, params={}, payload={}, method='GET')\n```\n\n``` sphinx\nBuilds the request and returns a python dictionary of the result or None.\n\n:param rest_path: appended to the 'endpoint'. remember to include the leading '/'\n:type rest_path: str or unicode\n\n:param params: the query parameters to be added to the url\n:type params: dict\n\n:param payload: the object to be passed to the server (may not work as expected \n due to non standard bss api implementation)\n:type payload: dict\n\n:param method: the request method [ GET | POST | PUT | DELETE ]\n:type method: str or unicode\n\n:returns: the result of the request as a python dictionary\n:rtype: dict or None\n```\n\n**An example using the parent `API` class:**\n\n``` python\napi = API(api_key=\"your_api_key\",\n secret_key=\"your_secred_key\",\n endpoint=\"http://127.0.0.1:8080/portal/api\")\naccounts = api.request('/accounts')\n```\n\n**An example using the `CLI` sub-class:**\n\n``` python\napi = CLI(__doc__)\naccounts = api.request('/accounts')\n```\n\n\nINSTALL\n=======\nThe easiest way to install this library is through `pip`.\n\n``` bash\n$ pip install cpbmapi\n```\n\nAlternatively, you can pull down the source code directly and install manually.\n\n``` bash\n$ git clone https://github.com/swill/cpbmapi.git\n$ cd cpbmapi\n$ python setup.py install\n```\n\n\nUSAGE\n=====\n\nThe core functionality is documented above, but it is worth spending a minute\nto better describe the `CLI` use case. \n\n``` bash\n$ ./cli_example.py --help\n\nUsage:\n cli_example.py [--json=] [--api_key= --secret_key=] [options]\n cli_example.py (-h | --help)\n\nOptions:\n -h --help Show this screen.\n --json= Path to a JSON config file with the same names as the \n options (without the -- in front).\n --api_key= CPBM Api Key.\n --secret_key= CPBM Secret Key.\n --endpoint= CPBM Endpoint \n [default: http://127.0.0.1:8080/portal/api].\n --logging= Boolean to turn on or off logging [default: True].\n --log= The log file to be used [default: logs/cpbmapi.log].\n --clear_log= Removes the log each time the API object is created \n [default: True].\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/swill/cpbmapi", "keywords": null, "license": "Apache Licence v2.0", "maintainer": null, "maintainer_email": null, "name": "cpbmapi", "package_url": "https://pypi.org/project/cpbmapi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cpbmapi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/swill/cpbmapi" }, "release_url": "https://pypi.org/project/cpbmapi/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "A minimalist wrapper around the CPBM BSS API.", "version": "0.0.2" }, "last_serial": 1902926, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "12273a196b698a2622004beb60283eb9", "sha256": "e7004e6a70dd91171274e65dfc06087a540057ebdd3ef6ca32cb167591a379c7" }, "downloads": -1, "filename": "cpbmapi-0.0.2.tar.gz", "has_sig": false, "md5_digest": "12273a196b698a2622004beb60283eb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4862, "upload_time": "2016-01-13T17:14:35", "url": "https://files.pythonhosted.org/packages/26/75/9c4dd5a6b4fbe30d4ee5b7fc6e6476f94485fae4d024ba4611bf0a8e7ec5/cpbmapi-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "12273a196b698a2622004beb60283eb9", "sha256": "e7004e6a70dd91171274e65dfc06087a540057ebdd3ef6ca32cb167591a379c7" }, "downloads": -1, "filename": "cpbmapi-0.0.2.tar.gz", "has_sig": false, "md5_digest": "12273a196b698a2622004beb60283eb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4862, "upload_time": "2016-01-13T17:14:35", "url": "https://files.pythonhosted.org/packages/26/75/9c4dd5a6b4fbe30d4ee5b7fc6e6476f94485fae4d024ba4611bf0a8e7ec5/cpbmapi-0.0.2.tar.gz" } ] }