{ "info": { "author": "RedBeacon (Gobind Ball)", "author_email": "support@redbeacon.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python" ], "description": "Okapi\n=====\n\nPython Library to send API info to Storage Server\n\n\nOkapi setup \n===========\nIn an existing project you should at least modify the following files:\n\n\nrequirements/base.txt\n---------------------\nAdd the following requirement to the project's settings. It won't be needed to\nadd ``requests`` if the project is already using it.\n``requests`` version should be >= 2.2.11:\n\n.. code-block:: python\n\n okapi==X.Y.Z\n\n\nsettings.py\n-----------\nAdd the following configuration to the project's settings:\n\n.. code-block:: python \n\n ########## OKAPI CONFIGURATION\n OKAPI_PROJECT = 'your-project-name'\n\n OKAPI_URI = None\n if settings.has_section('okapi'):\n OKAPI_URI = 'mongodb://{0},{1},{2}/{3}?replicaSet={4}'.format(\n\n settings.get('okapi', 'host0'),\n settings.get('okapi', 'host1'),\n settings.get('okapi', 'host2'),\n settings.get('okapi', 'name'),\n settings.get('okapi', 'replica'),\n )\n\n ########## END OKAPI CONFIGURATION\n\nNote that if the project is already using *MongoDB*, you shouldn't store Okapi's\ndata into the same database. Okapi creates collections dynamically and could\nconflict with your the project's.\n\n\nInitialization\n--------------\nInitialize Okapi in the ``models.py`` file of a basic application of the project.\nThis way Okapi will be imported at startup time:\n\n.. code-block:: python\n\n import requests \n from django.conf import settings \n\n from okapi.api import Api\n\n project_name = getattr(settings, 'OKAPI_PROJECT')\n mongodb_uri = getattr(settings, 'MONGODB_URI')\n okapi_client = Api(project_name, requests, mongodb_uri)\n\n\nUsage\n-----\nOnce initialized you can use Okapi wherever you use ``requests`` library.\nThink of Okapi as if you were using ``requests`` because they both have the same\nAPI.\n\nRequests documentation: http://docs.python-requests.org/en/latest/\n\n\nActivating/deactivating okapi in your project\n---------------------------------------------\nIn the file ``settings/base.py`` under the ``OKAPI CONFIGURATION`` section, you \ncan add a boolean setting in order to enable/disable okapi for your project. It \ncould be interesting to have it enabled in QA or staging environment and after\nit has been properly tested, activate it also in production.\n\nYou can have a section into ``your-project-name/settings/dev.py``: \n\n.. code-block:: python\n\n ########## OKAPI CONFIGURATION\n OKAPI_ENABLED = True\n ########## END OKAPI CONFIGURATION\n\nAnother one into ``your-project-name/settings/production.py``: \n\n.. code-block:: python \n\n ########## OKAPI CONFIGURATION\n OKAPI_ENABLED = False\n ########## END OKAPI CONFIGURATION\n\nAnd so on. Note that ``get_custom_setting`` is a wrapper around ``getattr``. \nThen you could initialize it conditionally as shown below:\n\n.. code-block:: python\n\n http_lib = requests\n if (get_custom_setting('OKAPI_ENABLED') and okapi_uri is not None):\n project_name = get_custom_setting('OKAPI_PROJECT', required=True)\n okapi_uri = get_custom_setting('OKAPI_URI', required=True)\n okapi_client = Api(project_name, requests, okapi_uri)\n http_lib = okapi_client\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "okapi", "package_url": "https://pypi.org/project/okapi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/okapi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/okapi/0.12.0/", "requires_dist": null, "requires_python": null, "summary": "Okapi\n=====\n\nPython Library to send API info to Storage Server\n\n\nOkapi setup \n===========\nIn an existing project you should at least modify the following files:\n\n\nrequirements/base.txt\n---------------------\nAdd the following requirement to the project's settings. It won't be needed to\nadd ``requests`` if the project is already using it.\n``requests`` version should be >= 2.2.11:\n\n.. code-block:: python\n\n okapi==X.Y.Z\n\n\nsettings.py\n-----------\nAdd the following configuration to the project's settings:\n\n.. code-block:: python \n\n ########## OKAPI CONFIGURATION\n OKAPI_PROJECT = 'your-project-name'\n\n OKAPI_URI = None\n if settings.has_section('okapi'):\n OKAPI_URI = 'mongodb://{0},{1},{2}/{3}?replicaSet={4}'.format(\n\n settings.get('okapi', 'host0'),\n settings.get('okapi', 'host1'),\n settings.get('okapi', 'host2'),\n settings.get('okapi', 'name'),\n settings.get('okapi', 'replica'),\n )\n\n ########## END OKAPI CONFIGURATION\n\nNote that if the project is already using *MongoDB*, you shouldn't store Okapi's\ndata into the same database. Okapi creates collections dynamically and could\nconflict with your the project's.\n\n\nInitialization\n--------------\nInitialize Okapi in the ``models.py`` file of a basic application of the project.\nThis way Okapi will be imported at startup time:\n\n.. code-block:: python\n\n import requests \n from django.conf import settings \n\n from okapi.api import Api\n\n project_name = getattr(settings, 'OKAPI_PROJECT')\n mongodb_uri = getattr(settings, 'MONGODB_URI')\n okapi_client = Api(project_name, requests, mongodb_uri)\n\n\nUsage\n-----\nOnce initialized you can use Okapi wherever you use ``requests`` library.\nThink of Okapi as if you were using ``requests`` because they both have the same\nAPI.\n\nRequests documentation: http://docs.python-requests.org/en/latest/\n\n\nActivating/deactivating okapi in your project\n---------------------------------------------\nIn the file ``settings/base.py`` under the ``OKAPI CONFIGURATION`` section, you \ncan add a boolean setting in order to enable/disable okapi for your project. It \ncould be interesting to have it enabled in QA or staging environment and after\nit has been properly tested, activate it also in production.\n\nYou can have a section into ``your-project-name/settings/dev.py``: \n\n.. code-block:: python\n\n ########## OKAPI CONFIGURATION\n OKAPI_ENABLED = True\n ########## END OKAPI CONFIGURATION\n\nAnother one into ``your-project-name/settings/production.py``: \n\n.. code-block:: python \n\n ########## OKAPI CONFIGURATION\n OKAPI_ENABLED = False\n ########## END OKAPI CONFIGURATION\n\nAnd so on. Note that ``get_custom_setting`` is a wrapper around ``getattr``. \nThen you could initialize it conditionally as shown below:\n\n.. code-block:: python\n\n http_lib = requests\n if (get_custom_setting('OKAPI_ENABLED') and okapi_uri is not None):\n project_name = get_custom_setting('OKAPI_PROJECT', required=True)\n okapi_uri = get_custom_setting('OKAPI_URI', required=True)\n okapi_client = Api(project_name, requests, okapi_uri)\n http_lib = okapi_client\n\n\n\n0.12.0 (2015-04-01)\n-------------------\n- New Features:\n\n - Method `get_mongodb_client` to get a MongoDB connection client.\n\n- Bugfixes:\n\n - None\n\n- Incompatible changes:\n\n - `Okapi.__init__` has changed to have a new mandatory `db` parameter.\n Parameters `mongodb_uri` and `connect_timeout_ms` have been removed.\n\n0.11.0 (2014-12-29)\n-------------------\n- New Features:\n\n - Changed blank space to a T letter as indicator of the beginning of the time \n element to be more iso-friendly:\n http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15\n\n0.10.0 (2014-11-11)\n-------------------\n- New Features:\n\n - Don't hardcode the name of the database but expect it to be in\n the mongodb_uri parameter.\n\n0.9.0 (2014-10-16)\n------------------\n- New Features:\n\n - Decouple okapi from requests so that any library following requests \n interface can be used. This introduces a backward incompatible change\n because now the __init__ method for okapi Api class requires a new\n argument\n\n0.8.0 (2014-09-26)\n------------------\n- New features:\n\n - Use one collection per project instead of saving all projects in the same collection\n - Add a time_bucket attribute to make time based queries faster\n\n0.7.1 (2014-07-28)\n----------------\n- Bug Fixes:\n\n\t-Make sure to raise the exception if an error occurs so the user know \n\texactly what is happening instead of code crashing", "version": "0.12.0" }, "last_serial": 1488793, "releases": { "0.1": [ { "comment_text": "built for Darwin-11.4.2", "digests": { "md5": "2c4f07e677164ea5e3703ef6e46f4c11", "sha256": "df7d2beff2ec0a1749402a4a1f89a512320e627f49a82f3c0b53067a115ff363" }, "downloads": -1, "filename": "okapi-0.1.macosx-10.6-intel.tar.gz", "has_sig": false, "md5_digest": "2c4f07e677164ea5e3703ef6e46f4c11", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3373, "upload_time": "2014-06-03T21:01:33", "url": "https://files.pythonhosted.org/packages/13/a0/42b601ccf3edc0bc0d34a31a979f64bc197bc164f6d76420b2eff318130f/okapi-0.1.macosx-10.6-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "3c252ef6f96b6d9a9fa6fc2e6638929e", "sha256": "fe7faed25bdab2dd0489d71871fbd89f8c3b7e6cad60d6dfeccf494791588cc8" }, "downloads": -1, "filename": "okapi-0.1.tar.gz", "has_sig": false, "md5_digest": "3c252ef6f96b6d9a9fa6fc2e6638929e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2241, "upload_time": "2014-06-03T21:00:37", "url": "https://files.pythonhosted.org/packages/f7/d8/1b64511acce34b0475aa0139a6714a23bf771ef88cfd4722449be3b685fd/okapi-0.1.tar.gz" } ], "0.10.0": [ { "comment_text": "", "digests": { "md5": "d39f8dbbc3b827a6603d743379470835", "sha256": "a094f0e43528f52ec473ba42192a9528e7b25144d93daf42581d06261c3ba3ba" }, "downloads": -1, "filename": "okapi-0.10.0.tar.gz", "has_sig": false, "md5_digest": "d39f8dbbc3b827a6603d743379470835", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3339, "upload_time": "2014-11-11T22:50:43", "url": "https://files.pythonhosted.org/packages/e8/bf/f0cdbf64b30f5704721fd3f858ecaa37e8711372702b8826873c31cd6224/okapi-0.10.0.tar.gz" } ], "0.11.0": [ { "comment_text": "", "digests": { "md5": "51c59e75cbfadaa783b5d50102ef6e23", "sha256": "2516f33ddb63ba2e2bbe66f644a9a74227598980fe75cebb0e5ebbef42fe4172" }, "downloads": -1, "filename": "okapi-0.11.0.tar.gz", "has_sig": false, "md5_digest": "51c59e75cbfadaa783b5d50102ef6e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3720, "upload_time": "2014-12-30T19:52:27", "url": "https://files.pythonhosted.org/packages/2c/73/f8a8989e78e7d37aa2b29d44c49a6940ca64310a3239be1a848d04237679/okapi-0.11.0.tar.gz" } ], "0.12.0": [ { "comment_text": "", "digests": { "md5": "d7c992dec78cef06999189fa79c37e44", "sha256": "04fadc82728c12425e1cc54841c4f6baad4a0ae580b36af98ee1bc382d20d829" }, "downloads": -1, "filename": "okapi-0.12.0.tar.gz", "has_sig": false, "md5_digest": "d7c992dec78cef06999189fa79c37e44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4910, "upload_time": "2015-04-02T20:39:18", "url": "https://files.pythonhosted.org/packages/16/82/70dd4d34604de95e5fe5bac6482ef025347fe2da98621980d35127405836/okapi-0.12.0.tar.gz" } ], "0.2": [ { "comment_text": "built for Darwin-11.4.2", "digests": { "md5": "929103f50e0b527fa2c39700081ed460", "sha256": "47ca06e6e7e86e6d2a719a9d52f320c062595db2c929ca5abb458354b645d553" }, "downloads": -1, "filename": "okapi-0.2.macosx-10.6-intel.tar.gz", "has_sig": false, "md5_digest": "929103f50e0b527fa2c39700081ed460", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 3267, "upload_time": "2014-06-03T23:39:10", "url": "https://files.pythonhosted.org/packages/7e/4c/f6f25b64ecf035db8580bae1089f6d5340f2bcd10cef36661aa3d0b622e4/okapi-0.2.macosx-10.6-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "1243c6703cea5c2319d0841ef06b7670", "sha256": "643b6e69a4d7c334380192f4b8772659ead4458e9fb49928830ddffa9e12d72d" }, "downloads": -1, "filename": "okapi-0.2.tar.gz", "has_sig": false, "md5_digest": "1243c6703cea5c2319d0841ef06b7670", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2166, "upload_time": "2014-06-03T23:38:59", "url": "https://files.pythonhosted.org/packages/80/c8/2d46f16d828175e1cd3adf6107773c85cc407a5de2f70264ebb8e2383e94/okapi-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7ea6b0f9498246a610c9cb68f734e058", "sha256": "82213124e5a63b3c7b68953fc1dd5caa396e09987a909f3640f5637434090b64" }, "downloads": -1, "filename": "okapi-0.3.tar.gz", "has_sig": false, "md5_digest": "7ea6b0f9498246a610c9cb68f734e058", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2066, "upload_time": "2014-06-04T19:03:14", "url": "https://files.pythonhosted.org/packages/cf/75/c04a6418fb4a902ce5ba1ba7209db3280e563e0fa4c16fb91d34c4053573/okapi-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "1967947e33ee374c174beaa41f7a37b6", "sha256": "b219f2dc92f4ba839d83c0b9fae5fc7156f40c0d91d0cb1d8a6c972c79797ba5" }, "downloads": -1, "filename": "okapi-0.4.tar.gz", "has_sig": false, "md5_digest": "1967947e33ee374c174beaa41f7a37b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2110, "upload_time": "2014-06-04T23:28:51", "url": "https://files.pythonhosted.org/packages/44/a0/f108002c46ee64e84978ba5c6175e6c7fc26947c415e934a747375a5b8b2/okapi-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "df814f1fb318fea3c5e0de1e25b3c3b5", "sha256": "759241b86564e759973481e5c85369a133bd5c379c873b43cb20923ef3559105" }, "downloads": -1, "filename": "okapi-0.5.tar.gz", "has_sig": false, "md5_digest": "df814f1fb318fea3c5e0de1e25b3c3b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1996, "upload_time": "2014-06-17T21:16:30", "url": "https://files.pythonhosted.org/packages/e0/a0/5f7cdda072178b2bc3855edac7f4797d08d4ce5e5623e9047b0abec38e71/okapi-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "c16c42909dcbe77961886046fe954b0f", "sha256": "8aaaa8344a873f99ca5a9af175897923be0f39e4daddd379ea53095510cd50ea" }, "downloads": -1, "filename": "okapi-0.5.1.tar.gz", "has_sig": false, "md5_digest": "c16c42909dcbe77961886046fe954b0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2000, "upload_time": "2014-06-17T21:37:27", "url": "https://files.pythonhosted.org/packages/00/df/a2653b5610f1ba0bb2dc946c2290f07dc0c34ba3f3f1939c7d25edaddcf2/okapi-0.5.1.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "73a2fc3836b3d84ff299069008e419a7", "sha256": "aad1e3da2f965fac7388db9d7ee4dca7ba4808baf2fc3c3437147660d5c68858" }, "downloads": -1, "filename": "okapi-0.6.tar.gz", "has_sig": false, "md5_digest": "73a2fc3836b3d84ff299069008e419a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2334, "upload_time": "2014-06-25T17:49:18", "url": "https://files.pythonhosted.org/packages/ad/ed/29089e82826f5394fd20924663dd7e0d13b18e7e15b2a8f05176db530fd6/okapi-0.6.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "f54f72bb4b6bcc86d5c0c1b533890b3b", "sha256": "e1d2ddcf89a915fc5856b190b74cfa6005f31ec93989614b938c725c2c460584" }, "downloads": -1, "filename": "okapi-0.6.1.tar.gz", "has_sig": false, "md5_digest": "f54f72bb4b6bcc86d5c0c1b533890b3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2656, "upload_time": "2014-07-22T17:42:21", "url": "https://files.pythonhosted.org/packages/46/92/e8fc65b2afb7031efe3b0a40404411af8ee69d07aee99b3d7cc3282d9623/okapi-0.6.1.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "45901ebcfebc9b1d8756a69a552ab835", "sha256": "40d7316d85e36b68893ed5d3ec034b7ba510dd6f64b8846aded182b19caafbe6" }, "downloads": -1, "filename": "okapi-0.7.tar.gz", "has_sig": false, "md5_digest": "45901ebcfebc9b1d8756a69a552ab835", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2942, "upload_time": "2014-07-28T16:59:12", "url": "https://files.pythonhosted.org/packages/e9/cd/842409156ff68273448ed12512511755de4628cc9ad4d9f30a21a39d6d05/okapi-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "5d63cf316a1f27526939855242f2411b", "sha256": "fb3152992d97191924673cfffdce7f50798f46cbeef107864e4c828fbf65c361" }, "downloads": -1, "filename": "okapi-0.7.1.tar.gz", "has_sig": false, "md5_digest": "5d63cf316a1f27526939855242f2411b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2977, "upload_time": "2014-07-30T19:43:29", "url": "https://files.pythonhosted.org/packages/37/da/48619802a669b33ab329d4bb2a3ed708f20045939e595e10783850faaf41/okapi-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "46ee2d0861d6369aadf93e8513ef08be", "sha256": "4ad695ad1c67c71a959de14e58a779562774be87e1252ae1e06a23449b2f8c2b" }, "downloads": -1, "filename": "okapi-0.7.2.tar.gz", "has_sig": false, "md5_digest": "46ee2d0861d6369aadf93e8513ef08be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2940, "upload_time": "2014-08-15T23:10:42", "url": "https://files.pythonhosted.org/packages/21/50/4edede508235b77b35d7e56957dadd95b357f8cbf197e0d95f04f8c15e38/okapi-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "b078e48cd425b235a46833c5a415da64", "sha256": "1defe13d80d646f2f8d477b662ed1b223ec744b0b77b02d61e87439e1b85107a" }, "downloads": -1, "filename": "okapi-0.7.3.tar.gz", "has_sig": false, "md5_digest": "b078e48cd425b235a46833c5a415da64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3007, "upload_time": "2014-08-19T23:12:04", "url": "https://files.pythonhosted.org/packages/21/78/1063288da7a79f69523f8baac133358d5f6d0fabb5ae4bdc759d2fa9dfb1/okapi-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "5a518e5cda33b8e1beb954a2ab3cc5e0", "sha256": "f9882cc743c4f7a33aec9331867a8851b7d9a15b66e7533e4619e7d653205608" }, "downloads": -1, "filename": "okapi-0.7.4.tar.gz", "has_sig": false, "md5_digest": "5a518e5cda33b8e1beb954a2ab3cc5e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2830, "upload_time": "2014-08-22T01:55:35", "url": "https://files.pythonhosted.org/packages/a9/bb/887308d83c143c7eb580a682e582beb7d5f5e6258df26855541aedc24e0d/okapi-0.7.4.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "71e7cdeacc3473e110d755da867335cd", "sha256": "c750f2a9c8934cee369e6616b168ece0527df52be142218e7bf24ade1743967d" }, "downloads": -1, "filename": "okapi-0.8.0.tar.gz", "has_sig": false, "md5_digest": "71e7cdeacc3473e110d755da867335cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3108, "upload_time": "2014-09-26T22:28:53", "url": "https://files.pythonhosted.org/packages/74/49/236a695b7b158ab0a2e4fd5d3468fdd5173283448298c9769822689237d2/okapi-0.8.0.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "987f57ecade957c6d8b70d98aee115cd", "sha256": "5223de6855b1b5a5325eb67194398a4e2a8ec74247bb3f36d5bb737de6298c1a" }, "downloads": -1, "filename": "okapi-0.9.0.tar.gz", "has_sig": false, "md5_digest": "987f57ecade957c6d8b70d98aee115cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3254, "upload_time": "2014-10-16T23:40:08", "url": "https://files.pythonhosted.org/packages/61/51/7be160e003a0694499c19e82d62bb1e61c4ca40891f534b5197476f775cf/okapi-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7c992dec78cef06999189fa79c37e44", "sha256": "04fadc82728c12425e1cc54841c4f6baad4a0ae580b36af98ee1bc382d20d829" }, "downloads": -1, "filename": "okapi-0.12.0.tar.gz", "has_sig": false, "md5_digest": "d7c992dec78cef06999189fa79c37e44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4910, "upload_time": "2015-04-02T20:39:18", "url": "https://files.pythonhosted.org/packages/16/82/70dd4d34604de95e5fe5bac6482ef025347fe2da98621980d35127405836/okapi-0.12.0.tar.gz" } ] }