httpagentparser


Namehttpagentparser JSON
Version 1.9.5 PyPI version JSON
download
home_pagehttps://github.com/shon/httpagentparser
SummaryExtracts OS Browser etc information from http user agent string
upload_time2022-10-19 05:55:40
maintainer
docs_urlNone
authorShekhar Tiwatne
requires_python
licensehttp://www.opensource.org/licenses/mit-license.php
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            .. image:: http://pepy.tech/badge/httpagentparser
        :target: http://pepy.tech/project/httpagentparser

.. image:: https://img.shields.io/pypi/v/httpagentparser.svg
        :target: https://pypi.python.org/pypi/httpagentparser

.. image:: https://img.shields.io/travis/shon/httpagentparser.svg
        :target: https://travis-ci.org/shon/httpagentparser


.. image:: https://img.shields.io/travis/shon/httpagentparser.svg
        :target: https://travis-ci.org/shon/httpagentparser

Features
--------

- Fast
- Detects OS and Browser. Does not aim to be a full featured agent parser
- Will not turn into django-httpagentparser ;)

Usage
-----

.. code-block:: python

    >>> import httpagentparser
    >>> s = "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) \
            Chrome/5.0.307.11 Safari/532.9"
    >>> print(httpagentparser.simple_detect(s))
    ('Linux', 'Chrome 5.0.307.11')
    >>> print(httpagentparser.detect(s))
    {'os': {'name': 'Linux'},
     'browser': {'version': '5.0.307.11', 'name': 'Chrome'}}

    >>> s = "Mozilla/5.0 (Linux; U; Android 2.3.5; en-in; HTC_DesireS_S510e Build/GRJ90) \
            AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
    >>> print(httpagentparser.simple_detect(s))
    ('Android Linux 2.3.5', 'Safari 4.0')
    >>> print(httpagentparser.detect(s))
    {'dist': {'version': '2.3.5', 'name': 'Android'},
    'os': {'name': 'Linux'},
    'browser': {'version': '4.0', 'name': 'Safari'}}

History
-------

http://stackoverflow.com/questions/927552/parsing-http-user-agent-string/1151956#1151956



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shon/httpagentparser",
    "name": "httpagentparser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Shekhar Tiwatne",
    "author_email": "pythonic@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/4d/1fc46c8a2c9a0ceb9e9580d7ce92bf764c373deb7af61fde2fd7b5516495/httpagentparser-1.9.5.tar.gz",
    "platform": null,
    "description": ".. image:: http://pepy.tech/badge/httpagentparser\n        :target: http://pepy.tech/project/httpagentparser\n\n.. image:: https://img.shields.io/pypi/v/httpagentparser.svg\n        :target: https://pypi.python.org/pypi/httpagentparser\n\n.. image:: https://img.shields.io/travis/shon/httpagentparser.svg\n        :target: https://travis-ci.org/shon/httpagentparser\n\n\n.. image:: https://img.shields.io/travis/shon/httpagentparser.svg\n        :target: https://travis-ci.org/shon/httpagentparser\n\nFeatures\n--------\n\n- Fast\n- Detects OS and Browser. Does not aim to be a full featured agent parser\n- Will not turn into django-httpagentparser ;)\n\nUsage\n-----\n\n.. code-block:: python\n\n    >>> import httpagentparser\n    >>> s = \"Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) \\\n            Chrome/5.0.307.11 Safari/532.9\"\n    >>> print(httpagentparser.simple_detect(s))\n    ('Linux', 'Chrome 5.0.307.11')\n    >>> print(httpagentparser.detect(s))\n    {'os': {'name': 'Linux'},\n     'browser': {'version': '5.0.307.11', 'name': 'Chrome'}}\n\n    >>> s = \"Mozilla/5.0 (Linux; U; Android 2.3.5; en-in; HTC_DesireS_S510e Build/GRJ90) \\\n            AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\"\n    >>> print(httpagentparser.simple_detect(s))\n    ('Android Linux 2.3.5', 'Safari 4.0')\n    >>> print(httpagentparser.detect(s))\n    {'dist': {'version': '2.3.5', 'name': 'Android'},\n    'os': {'name': 'Linux'},\n    'browser': {'version': '4.0', 'name': 'Safari'}}\n\nHistory\n-------\n\nhttp://stackoverflow.com/questions/927552/parsing-http-user-agent-string/1151956#1151956\n\n\n",
    "bugtrack_url": null,
    "license": "http://www.opensource.org/licenses/mit-license.php",
    "summary": "Extracts OS Browser etc information from http user agent string",
    "version": "1.9.5",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc4d1fc46c8a2c9a0ceb9e9580d7ce92bf764c373deb7af61fde2fd7b5516495",
                "md5": "34613e7d4b05731abf15d1e26607aa4e",
                "sha256": "53cefd9d65990f6fe59c0378cad8ea1b9df8f770d2e8bd9d8762edae033be80a"
            },
            "downloads": -1,
            "filename": "httpagentparser-1.9.5.tar.gz",
            "has_sig": false,
            "md5_digest": "34613e7d4b05731abf15d1e26607aa4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7692,
            "upload_time": "2022-10-19T05:55:40",
            "upload_time_iso_8601": "2022-10-19T05:55:40.027909Z",
            "url": "https://files.pythonhosted.org/packages/bc/4d/1fc46c8a2c9a0ceb9e9580d7ce92bf764c373deb7af61fde2fd7b5516495/httpagentparser-1.9.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-10-19 05:55:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "shon",
    "github_project": "httpagentparser",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "httpagentparser"
}
        
Elapsed time: 0.05136s