{ "info": { "author": "Olli Jarva", "author_email": "olli@jarva.fi", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Libraries" ], "description": "Browser user-agent detection\n============================\n\nThis library parses browser user-agent strings with data from [user-agent-string.info](http://user-agent-string.info/).\n\nThis library is loosely based on the work by Hicro Kee (hicrokee AT gmail DOT com) and Michal Molhanec (http://molhanec.net).\n\nUsage:\n\n::\n\n from uaparser import UA, UAParser\n parser = UAParser()\n parser.update_data()\n ua = UA(parser, user_agent_string)\n print ua.is_robot() # returns empty dictionary if robot is not detected\n print ua.get_browser_details() # returns empty dictionary, or browser details\n print ua.get_device_type() # returns dict containing device type fields\n print ua.get_os_details()\n # Or alternatively,\n print ua.parse() # returns all parsed fields for the UA string\n\nDjango integration\n------------------\n\nAs running a large number of regexes takes a long time, Django integration uses caching.\n\nUsage:\n\n::\n\n from uaparser.django.caching_ua_parser import parse_user_agent\n parsed = parse_user_agent(request.META.get(\"HTTP_USER_AGENT\"))\n\n``parse_user_agent`` fetches all user-agent fields (i.e it calls ``ua.parse()``).\n\nSettings:\n\n- ``UA_CACHE_DIRECTORY``: directory for data file (\"cache.pickle\"). Mandatory.\n- ``UA_CACHE_NAME``: defaults to \"default\". Defines custom Django cache name.\n- ``UA_CACHE_PREFIX``: defaults to \"parse_ua\". Key prefix for cache.\n- ``UA_CACHE_TIMEOUT``: defaults to 48 hours. Cache key timeout in seconds.\n\nMiddleware: add ``uaparser.django.middleware.UAParserMiddleware`` to ``MIDDLEWARE_CLASSES``.\n\nContext processor: to add ``parsed_ua`` variable to context, add ``uaparser.django.context_processor.add_parsed_ua`` to ``CONTEXT_PROCESSORS``. This does nothing if ``UAParserMiddleware`` is not enabled.\n\n\nLicense\n-------\n\nLicensed under the MIT license.\n\nCopyright (c) 2014 Olli Jarva \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ojarva/ua-detection-python", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ojarva/ua-detection-python", "keywords": "browser user-agent parser", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "uaparser", "package_url": "https://pypi.org/project/uaparser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/uaparser/", "project_urls": { "Download": "https://github.com/ojarva/ua-detection-python", "Homepage": "https://github.com/ojarva/ua-detection-python" }, "release_url": "https://pypi.org/project/uaparser/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Library for parsing browser user agents", "version": "0.1.0" }, "last_serial": 1040981, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4ce7fabbfdeea3f5f61ab9813845e334", "sha256": "509e17a5b19b077e307cfbee767e2eb5a0e2dea5f64d06ee93dcb57a4ce1aac5" }, "downloads": -1, "filename": "uaparser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4ce7fabbfdeea3f5f61ab9813845e334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6188, "upload_time": "2014-03-25T19:00:56", "url": "https://files.pythonhosted.org/packages/2d/34/005c13082426b78e8bad3ce2c5ae7d969887e11779ebd35146c40a4551b3/uaparser-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ce7fabbfdeea3f5f61ab9813845e334", "sha256": "509e17a5b19b077e307cfbee767e2eb5a0e2dea5f64d06ee93dcb57a4ce1aac5" }, "downloads": -1, "filename": "uaparser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4ce7fabbfdeea3f5f61ab9813845e334", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6188, "upload_time": "2014-03-25T19:00:56", "url": "https://files.pythonhosted.org/packages/2d/34/005c13082426b78e8bad3ce2c5ae7d969887e11779ebd35146c40a4551b3/uaparser-0.1.0.tar.gz" } ] }