{ "info": { "author": "elegans.io Ltd", "author_email": "info@elegans.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Information Technology", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "*******************************************\nA web app to use the cold-start-recommender\n*******************************************\n\nThis is a basic [tornado](http://www.tornadoweb.org/) application which provide a web interface to the [cold-start-recommender](https://github.com/elegans-io/cold-start-recommender)\n\n# Dependencies\n\n* [tornado](http://www.tornadoweb.org/)\n* [cold-start-recommender](https://github.com/elegans-io/cold-start-recommender) version >= 4.0.0\n\n# Installation\n\npip install csrec-webapp\n\n# Running the application\n\ncsrec_webapp.py --port=8888\n\n# APIs\n\n## Item data Input\n\nItems must have at least the following fields:\n\n* A unique identifier. No matter if it is a string or an int, but must be unique.\n* A type identifier. The recommender must be able to recognise which type of item is dealing with (program, series, news etc).\n* Informative fields. Prior to use, the recommender must know which fields are the informative ones\n\n## User behaviour data input\n\nThe application must tell which action is performed by which user on which item.\n\n## Output\n\nFor each user, the recommender can recommend different types of items.\n\nNote that:\n\n* The recommender does not consider which programs/series are scheduled for a certain day.\n* Items for a certain period must be filtered by the user after the query.\n* The recommender can filter the type of items (eg if programs or series or news should be recommended to a certain user), but cannot recommend the informative fields (eg \"this user likes running shoes\").\n* Whenever not enough information is available, the recommender recommends the most popular items.\n\n## Functions\n\n### Update items table\n\nInsert or modify items.\n\n#### methods\n\nPOST\n\n#### URL Params\n\n##### Required\n\n* unique_id: the name of the field used as unique id for the item\n\n#### Data Params\n\nA list of items with type and category informations e.g.:\n\n```\n[{ \"_id\" : \"item1\", \"type\": \"lady\", \"category\" : \"high_heels\"},\n { \"_id\" : \"item2\", \"type\": \"male\", \"category\" : \"mocassino\"},\n { \"_id\" : \"item3\", \"type\": \"unisex\", \"category\" : \"mocassino\"},\n { \"_id\" : \"item4\", \"type\": \"male\", \"category\" : \"mocassino\"}]\n```\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '[{ \"_id\" : \"item1\", \"type\": \"lady\", \"category\" : \"high_heels\"}, { \"_id\" : \"item2\", \"type\": \"male\", \"category\" : \"mocassino\"}, { \"_id\" : \"item3\", \"type\": \"unisex\", \"category\" : \"mocassino\"}, { \"_id\" : \"item4\", \"type\": \"male\", \"category\" : \"mocassino\"}]' 'http://elegans.it:8000/insertitems?unique_id=_id'\n```\n\n### Post user action on an item\n\n#### methods\n\nPOST\n\n#### URL Params\n\n##### Required\n\n* item: the item id (program, series etc)\n* user: This could be the value of rating, or could correspond to different actions (e.g. hated: -1, loved: +1)\n* code: the rating\n\n##### Optional\n\n* only_info: true or false, default is false\n\n#### Description\n\nUpdate/insert an action identified by code performed by {uid} on {item_id}. If users or item are not found they are created in the database.\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{ \"item_info\" : [\"type\", \"category\"]}' 'http://elegans.it:8000/itemaction?item=item1&user=User1&code=1&only_info=false'\n```\n\n### Post a social action (users to users)\n\n#### methods\n\nPOST\n\n#### Description\n\nStores information about action performed by {uid} on {other_uid}, like \"follow\", \"like\" etc. If id's are not found they are created in the database.\n\n#### URL Params\n\n##### Required\n\n* user: email or session_id of the user. NB Always use email if available.\n* code: This could be the liking factor, or could correspond to different actions (e.g. downvote: -1, follow: +1)\n* user_to: the other user's id\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X POST 'http://elegans.it:8000/socialaction?user=User1&user_to=User2&code=3'\n```\n\n### Get recommended items for a user\n\n#### methods\n\nGET\n\n#### Description\n\nProvide a list of recommended item_ids.\n\n#### URL Params\n\n##### Required\n\n* user: email or session_id of the user. NB Always use email if available.\n\n##### Optional\n\n* fast: if set to any value, uses faster and less accurate algorithm\n* limit: integer, number of items to return, default is 10\n* type: type of items to be returned. NB: if a non-existent key is provided the recommender will return an empty list\n\n#### Success Response\n\nCode: 200\n\nContent: a list of items e.g.: ```[\"item4\", \"item1\", \"item3\", \"item2\", \"User2\"]```\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X GET 'http://elegans.it:8000/recommend?user=User1&limit=10'\n```\n\n### Reconcile session_id with user ID\n\n#### methods\n\nPOST\n\n#### Description\n\nWhenever a user logs in not in the first session, the app should tell which session_id s/he was using during the previous sessions. All action associated to user_old will be associated to user_new.\n\n#### URL Params\n\n##### Required\n\n* user_old: old user id\n* user_new: new user id\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X POST 'http://elegans.it:8000/reconcile?user_old=User1&user_new=User2\n```\n\n### Get action of a user\n\n#### methods\n\nGET\n\n#### Description\n\nReturn a dictionary with two lists:\n\n#### URL Params\n\n* itemaction: actions performed on items\n* socialaction: actions performed on other users\n\n#### URL Params\n\n##### Required\n\n* user: email or session_id of the user. NB Always use email if available..\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X GET 'http://elegans.it:8000/info/user?user=User1'\n```\n\n### Get interactions on an item\n\n#### methods\n\nGET\n\n#### Description\n\nList of user who performed any action on the item, and which action\n\n#### URL Params\n\n##### Required\n\n* item: id of the item\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X GET 'http://localhost:8000/info/item?item=item1'\n```\n\n### Serialize the data on files\n\n#### methods\n\nGET\n\n#### Description\n\nserialize data on file\n\n#### URL Params\n\n##### Optional\n\n* filename: the path where to serialize the data, default is /tmp/dump.bin\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X GET 'http://localhost:8000/serialize?filename=/tmp/dump.bin'\n```\n\n### Restore data from file\n \n#### methods\n\nGET\n\n#### Description\n\nrestore data from file\n\n#### URL Params\n\n##### Optional\n\n* filename: the path of the file which contains the serialized data\n\n#### Success Response\n\nCode: 200\n\nContent: {}\n\n#### Error Response\n\nCode: 404\n\nContent: {}\n\n#### Sample Call\n\n```bash\ncurl -X GET 'http://localhost:8000/restore?filename=/tmp/dump.bin'\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/elegans-io/csrec-webapp", "keywords": "recommendations,recommender,recommendation engine", "license": "GPL v2", "maintainer": null, "maintainer_email": null, "name": "cold-start-recommender-webapp", "package_url": "https://pypi.org/project/cold-start-recommender-webapp/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cold-start-recommender-webapp/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/elegans-io/csrec-webapp" }, "release_url": "https://pypi.org/project/cold-start-recommender-webapp/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "Webapp for the cold start recommender", "version": "0.4.1" }, "last_serial": 1935296, "releases": { "0.4.0": [], "0.4.1": [ { "comment_text": "", "digests": { "md5": "a61f207adcefb82911220b6e1c1b36ec", "sha256": "8000a28afef8748d988d6383f00f67ed0d228be8d4b0beb923a09bf545992b59" }, "downloads": -1, "filename": "cold-start-recommender-webapp-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a61f207adcefb82911220b6e1c1b36ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6691, "upload_time": "2016-02-02T09:35:48", "url": "https://files.pythonhosted.org/packages/79/4c/9d3c553107f3db9fee9af9d8d4b5233e14a1ec5251aea20c032e2b7566c2/cold-start-recommender-webapp-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a61f207adcefb82911220b6e1c1b36ec", "sha256": "8000a28afef8748d988d6383f00f67ed0d228be8d4b0beb923a09bf545992b59" }, "downloads": -1, "filename": "cold-start-recommender-webapp-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a61f207adcefb82911220b6e1c1b36ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6691, "upload_time": "2016-02-02T09:35:48", "url": "https://files.pythonhosted.org/packages/79/4c/9d3c553107f3db9fee9af9d8d4b5233e14a1ec5251aea20c032e2b7566c2/cold-start-recommender-webapp-0.4.1.tar.gz" } ] }