{ "info": { "author": "Fetchable", "author_email": "support@fetchable.ai", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries" ], "description": "=================================\nFetchable: Python Client Side SDK\n=================================\n\nThis is the Fetchable client-side Software Development Kit (SDK) for Python. It allows developers of robots, smart speakers, voice assistants, etc. to quickly develop programs that make calls to the Fetchable API. The library has only been tested on Ubuntu systems so far.\n\n\nTable of Contents\n=================\n\n- `Installation <#installation>`__\n- `Usage <#usage>`__\n- `Errors <#errors>`__\n- `Contributing <#contributing>`__\n- `License <#license>`__\n\nInstallation\n============\n\nPre-requisites\n--------------\n\n* Python 2.7 or 3.6\n* An active Fetchable account.\n\nInstall Package\n---------------\n\nThe recommended way to install this package is through pip (or pip3) as follows:\n\n.. code-block:: sh\n\n $ pip install fetchable\n\n\nSet Up Keys\n-----------\n\n1. Log into your account and on the console page, download the authentication keys and note the location it downloaded to. The file should be named 'fetchable_auth_keys.json'. Note: be sure to keep this file secure and share it or commit it to any source control.\n\n2. By default, when the library runs it will attempt to read the file containing your keys from an environment variable which\nspecifies the path to the file (you can also override the environment variable by explicitly setting the path in the constructor). Set the environment variable as so:\n\n.. code-block:: sh\n\n $ export FETCHABLE_AUTH_FILE=/path/to/fetchable_auth_keys.json\n\n\nUsage\n=====\nOnce you have completed the installation, you can start fetching data from the index. The main class used to interact with the API is the FetchableClient object.\n\nConstructing the Client Object\n------------------------------\n\nThere are three optional parameters which can be passed to the constructor of the FetchableClient object.\n\n1. API version\n\nThe verison of the API to be used can be specified with the :code:`api_version` parameter. The parameter is an enum defined in the configuration file which needs to be imported. The FetchableClient object will default to the latest version in the absence of this parameter.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n from fetchable import configuration\n\n client = FetchableClient(api_version=configuration.api_version.v0_1)\n\n2. User agent\n\nThe FetchableClient object allows you to set your own user-agent header, this can be done through the :code:`user_agent` parameter in the format :code:`/` where :code:`version` takes the form :code:`0.1.0`, :code:`0.2.0`, :code:`1.0.0`, etc. By setting this to something relevant to only your application (e.g. :code:`my-amazing-chatbot/0.1`) and by whitelisting only that value through the console you can enhance the security of your account and distinguish between different applications. The default is value is :code:`fetchable-python-client/x.y.z`.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient(user_agent='my-amazing-chatbot/0.1.0')\n\n\n3. Authentication credentials\n\nBy default, the libary will attempt to read your authentication keys from the file specified by the :code:`FETCHABLE_AUTH_FILE` environment variable. You can also specify this through the constructor. If both are set, the value passed through to the constructor will override the environment variable. If neither are set, an exception is thrown.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient(auth_file='/path/to/file/here.json')\n\n\n\nFetching from endpoints\n-----------------------\n\nOnce the installation has been completed and the object has been constructed, you can begin making calls against the API endpoints. Note: these endpoints only cover version v0.1 of the API, visit the `endpoint `_ documentation for more details on these.\n\n1. API status endpoint\n\nThis endpoint is useful to test the connection and authentication of the client as well as receive the current status of the API.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n status_response = client.status()\n\n if(status_response['status_code']==200):\n print(\"The Fetchable API is up - all systems are go\")\n elif(status_response['status_code']==1001):\n print(\"I can't connect to the internet right now...\")\n else:\n print(status_response)\n\n2. Entity-attribute endpoint\n\nThis endpoint is used to fetch the attributes of entities in our index.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n entity_response = client.fetch_entity_attribute(\"Mount Everest\", \"Elevation\")\n\n if(entity_response['status_code']==200):\n print(\"The height of mount_everest is {} {}.\".format(entity_response['value'], entity_response['unit']))\n elif(entity_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(entity_response)\n\n3. Dictionary endpoint\n\nUsed to fetch the definitions of words.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n definition_response = client.fetch_word_definition(\"ameliorate\")\n\n if(definition_response['status_code']==200):\n print(\"The definition of {}: is {}\".format(\"ameliorate\", definition_response['meanings'][0]))\n elif(definition_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(definition_response)\n\n\n4. Joke endpoint\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n joke_response = client.fetch_joke()\n\n if(joke_response['status_code']==200):\n print(\"{} - {}\".format(joke_response['setup'], joke_response['punchline']))\n elif(joke_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(joke_response)\n\n5. Inspirational quote endpoint\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n quote_response = client.fetch_quote()\n\n if(quote_response['status_code']==200):\n print(\"{} by {}\".format(quote_response['quote'], quote_response['author']))\n elif(quote_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(quote_response)\n\n4. Fun fact endpoint\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n fun_fact_response = client.fetch_fun_fact()\n\n if(fun_fact_response['status_code']==200):\n print(fun_fact_response['fun_fact'])\n elif(fun_fact_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(fun_fact_response)\n\n4. Exact endpoint\n\nThis endpoint allows you to specify an exact endpoint to fetch.\n\n.. code-block:: python\n\n from fetchable import FetchableClient\n\n client = FetchableClient()\n\n endpoint_response = client.fetch_endpoint(\"/v0.1/mount_everest/height\")\n\n if(endpoint_response['status_code']==200):\n print(\"The height of mount_everest is {} {}s.\".format(endpoint_response['value'], endpoint_response['unit']))\n elif(endpoint_response['status_code']==1001):\n print(\"Can't connect to the internet right now...\")\n else:\n print(endpoint_response)\n\n\nErrors\n======\n\n1. Exceptions\n\nThe FetchableClient object will throw exceptions when:\n\n* The path to the authentication file is not set through an environment variable or constructor argument.\n* The path to the authentication file is not a valid file path.\n* The authentication file is not formatted properly.\n* Functions taking string parameters are passed arguments which are not strings.\n\n2. Error codes\n\nThere are two types of error codes you can receive back from the client object. Those in the 1xxx range are errors thrown by the client object itself and other error codes in the 2xx, 3xx, 4xx and 5xx ranges are the standard http error codes received from the server. For more information on the server error codes visit the `documentation `_.\n\n+-------+------------------+--------------------------------------------------------------+\n| Code | Description | Reason |\n+-------+------------------+--------------------------------------------------------------+\n| 1001 | Connection error | The client cannot make a connection to the API server. |\n+-------+------------------+--------------------------------------------------------------+\n| 1002 | Timeout error | The request timed out. |\n+-------+------------------+--------------------------------------------------------------+\n| 1003 | Proxy error | A proxy error occurred. |\n+-------+------------------+--------------------------------------------------------------+\n| 1004 | Unknown error | An unknown error occurred. |\n+-------+------------------+--------------------------------------------------------------+\n\nContributing\n============\n\nContributions are welcome and encouraged! See the `Contributing Guide `_ for information on how to contribute.\n\n\nLicense\n=======\nLicensed under Apache Version 2.0.\n\nSee the `LICENSE `_ file for more information.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "fetchable", "package_url": "https://pypi.org/project/fetchable/", "platform": "", "project_url": "https://pypi.org/project/fetchable/", "project_urls": { "Company": "https://fetchable.ai", "Issue tracker": "https://github.com/fetchableai/fetchable-python/issues", "Source": "https://github.com/fetchableai/fetchable-python" }, "release_url": "https://pypi.org/project/fetchable/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "Client SDK for Fetchable", "version": "0.1.5" }, "last_serial": 5804986, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "be43d9f2009cec348e307617e61936ad", "sha256": "0f00b51ca5c48724e5d00efc73899fb892ac75e52556027564abb0074e817c90" }, "downloads": -1, "filename": "fetchable-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "be43d9f2009cec348e307617e61936ad", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10702, "upload_time": "2019-08-25T16:55:08", "url": "https://files.pythonhosted.org/packages/67/72/3ed466e78e7f24f1cfba6839d6166114db55c4c67db2a2013bcf832854a0/fetchable-0.1.0-py2-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "29b16dea3d20cd446ccb54e12dc0d9b0", "sha256": "6cc17b05b532c3172b2423b4755cfd62f51d06b41cb578363df157e6f83e72e2" }, "downloads": -1, "filename": "fetchable-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "29b16dea3d20cd446ccb54e12dc0d9b0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10723, "upload_time": "2019-09-05T22:26:08", "url": "https://files.pythonhosted.org/packages/21/d5/28fa002241da19b2adecacc65761ed36dd98335535c5faee13fdb09ecb94/fetchable-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b8808e73de60f334e612745af5bb10a", "sha256": "740f200fd8c1adce38d87a1087fcff9fb3a2651fb1aab2e6960909c607482795" }, "downloads": -1, "filename": "fetchable-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6b8808e73de60f334e612745af5bb10a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7086, "upload_time": "2019-09-05T22:26:09", "url": "https://files.pythonhosted.org/packages/41/bd/03f401536abae9a60442094f13cc0ad0fde4cb9a180dad8d5fee16323e31/fetchable-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8bdcd71860c2bebbcacf5d74a8fa39b8", "sha256": "e5849d41f9ef5738faccda638d85776c6a9fe84ec7c56215e917922faf5d7c35" }, "downloads": -1, "filename": "fetchable-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "8bdcd71860c2bebbcacf5d74a8fa39b8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10787, "upload_time": "2019-09-06T19:17:08", "url": "https://files.pythonhosted.org/packages/91/ce/710f87f2be413c3c4f549326f7f65b5ff586dd53ebf3a114d3f8fa6aaae9/fetchable-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1d194dce886daa87fc1d38c5529cfa8", "sha256": "995cc822a1074f60ef7e3b3adf50d427b439c1e86dd73faf4b302298a3e6c32a" }, "downloads": -1, "filename": "fetchable-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f1d194dce886daa87fc1d38c5529cfa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7149, "upload_time": "2019-09-06T19:17:10", "url": "https://files.pythonhosted.org/packages/03/aa/58ff4b6778544a31a211b7a127570f2a91fef260fa014685d940776408bd/fetchable-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7d04c370cee8a5381ce2d853511f4250", "sha256": "d4c681b0afcd728b5ff4ae14b67a51f0cf56e931f92ddf7adc425119b4d234f5" }, "downloads": -1, "filename": "fetchable-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "7d04c370cee8a5381ce2d853511f4250", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10769, "upload_time": "2019-09-06T22:03:06", "url": "https://files.pythonhosted.org/packages/2c/b9/97c1b1cdc19e39def17980d030fb6e0ae778432726cf7d549a09bef309ef/fetchable-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3cfcf40ec3a96ae17370d318fdda66e0", "sha256": "e5c8c4fa1974ad7195522e0d9751c4eaf08d25f617a80eba9f367cc1bdfc417b" }, "downloads": -1, "filename": "fetchable-0.1.3.tar.gz", "has_sig": false, "md5_digest": "3cfcf40ec3a96ae17370d318fdda66e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7142, "upload_time": "2019-09-06T22:03:08", "url": "https://files.pythonhosted.org/packages/42/53/c12bbc8cca35f414a5b149c9c3d216cc0eb7aee43d0c52cf2587fc2ba392/fetchable-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "79914128e038496146088ec3e4430980", "sha256": "b721bd6c69e2d7895bc23d51cefdbfe860be2da838ffedaa2b55628f8c08995f" }, "downloads": -1, "filename": "fetchable-0.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "79914128e038496146088ec3e4430980", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 10991, "upload_time": "2019-09-07T17:16:50", "url": "https://files.pythonhosted.org/packages/d2/22/a4b7e080839a96c2873ac20b2207dbbf9a73cdcbf7e84f86257a71d3dec1/fetchable-0.1.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "524a9a7d0f476c4e5e9cc4c4853430df", "sha256": "929bd2429f7a4d9bd5bde0594f3215b6709df6f12ede5a6038bb9f085f7cede7" }, "downloads": -1, "filename": "fetchable-0.1.4.tar.gz", "has_sig": false, "md5_digest": "524a9a7d0f476c4e5e9cc4c4853430df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7352, "upload_time": "2019-09-07T17:16:52", "url": "https://files.pythonhosted.org/packages/af/07/4215569f8ce6f682cadd2d19f43d7e2d47f2e747430123437a0deff1fb59/fetchable-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "f66c5ade1055f02b76a8c05f3cd33352", "sha256": "7b61dacdef525b7176eca7bc6fd44ae5b8ab2bc6b75cdaa8d51507111945bd31" }, "downloads": -1, "filename": "fetchable-0.1.5-py2-none-any.whl", "has_sig": false, "md5_digest": "f66c5ade1055f02b76a8c05f3cd33352", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11038, "upload_time": "2019-09-09T18:50:21", "url": "https://files.pythonhosted.org/packages/7f/27/a065367a4ec1d27bdc7322959ff5b0c45c7e0680b9732958b23271b75f21/fetchable-0.1.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bf01d8e7c761b21eb262bc54b3c53ed", "sha256": "e2253c4bbd1dddccfb00a957120f2d8fc2e70374ae64bda24cdb3b2ddc4d914f" }, "downloads": -1, "filename": "fetchable-0.1.5.tar.gz", "has_sig": false, "md5_digest": "2bf01d8e7c761b21eb262bc54b3c53ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7468, "upload_time": "2019-09-09T18:50:23", "url": "https://files.pythonhosted.org/packages/c9/d2/5c456dc8342bdc6e9ba780373c849b1f5f7d89c942beb29bc83340766fc3/fetchable-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f66c5ade1055f02b76a8c05f3cd33352", "sha256": "7b61dacdef525b7176eca7bc6fd44ae5b8ab2bc6b75cdaa8d51507111945bd31" }, "downloads": -1, "filename": "fetchable-0.1.5-py2-none-any.whl", "has_sig": false, "md5_digest": "f66c5ade1055f02b76a8c05f3cd33352", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 11038, "upload_time": "2019-09-09T18:50:21", "url": "https://files.pythonhosted.org/packages/7f/27/a065367a4ec1d27bdc7322959ff5b0c45c7e0680b9732958b23271b75f21/fetchable-0.1.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bf01d8e7c761b21eb262bc54b3c53ed", "sha256": "e2253c4bbd1dddccfb00a957120f2d8fc2e70374ae64bda24cdb3b2ddc4d914f" }, "downloads": -1, "filename": "fetchable-0.1.5.tar.gz", "has_sig": false, "md5_digest": "2bf01d8e7c761b21eb262bc54b3c53ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7468, "upload_time": "2019-09-09T18:50:23", "url": "https://files.pythonhosted.org/packages/c9/d2/5c456dc8342bdc6e9ba780373c849b1f5f7d89c942beb29bc83340766fc3/fetchable-0.1.5.tar.gz" } ] }