==========
user_agent
==========
.. image:: https://travis-ci.org/lorien/user_agent.png?branch=master
:target: https://travis-ci.org/lorien/user_agent?branch=master
.. image:: https://ci.appveyor.com/api/projects/status/jbyd2b9dfq99fvs3
:target: https://ci.appveyor.com/project/lorien/user-agent
.. image:: https://readthedocs.org/projects/user_agent/badge/?version=latest
:target: http://user-agent.readthedocs.org
What is user_agent module for?
-------------------------------
This module is for generating random, valid web user agents:
* content of "User-Agent" HTTP headers
* content of `window.navigator` JavaScript object
Usage Example
-------------
.. code:: python
>>> from user_agent import generate_user_agent, generate_navigator
>>> from pprint import pprint
>>> generate_user_agent()
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.3; Win64; x64)'
>>> generate_user_agent(os=('mac', 'linux'))
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:36.0) Gecko/20100101 Firefox/36.0'
>>> pprint(generate_navigator())
{'app_code_name': 'Mozilla',
'app_name': 'Netscape',
'appversion': '5.0',
'name': 'firefox',
'os': 'linux',
'oscpu': 'Linux i686 on x86_64',
'platform': 'Linux i686 on x86_64',
'user_agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686 on x86_64; rv:41.0) Gecko/20100101 Firefox/41.0',
'version': '41.0'}
>>> pprint(generate_navigator_js())
{'appCodeName': 'Mozilla',
'appName': 'Netscape',
'appVersion': '38.0',
'platform': 'MacIntel',
'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Firefox/38.0'}
Command Line Usage
------------------
.. code:: shell
$ ua
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:49.0) Gecko/20100101 Firefox/49.0
$ ua -n chrome -e
{
"oscpu": "Linux i686 on x86_64",
"appName": "Netscape",
"appCodeName": "Mozilla",
"appVersion": "55.0.2909.25",
"platform": "X11; Linux i686 on x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux i686 on x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2909.25 Safari/537.36"
}
Installation
------------
.. code:: shell
$ pip install -U user_agent
Documentation
-------------
Documentation is available at http://user-agent.readthedocs.org
Contribution
============
Use github to submit bug,fix or wish request: https://github.com/lorien/user_agent/issues
Raw data
{
"_id": null,
"home_page": "https://github.com/lorien/user_agent",
"name": "user-agent",
"maintainer": "Gregory Petukhov",
"docs_url": null,
"requires_python": "",
"maintainer_email": "lorien@lorien.name",
"keywords": "user agent browser navigator",
"author": "Gregory Petukhov",
"author_email": "lorien@lorien.name",
"download_url": "https://files.pythonhosted.org/packages/b5/db/559a95b7cc146b269a0cc4cb7a53471ddd270ce9b29f23a5ed5e118acd4e/user_agent-0.1.10.tar.gz",
"platform": "",
"description": "==========\nuser_agent\n==========\n\n.. image:: https://travis-ci.org/lorien/user_agent.png?branch=master\n :target: https://travis-ci.org/lorien/user_agent?branch=master\n\n.. image:: https://ci.appveyor.com/api/projects/status/jbyd2b9dfq99fvs3\n :target: https://ci.appveyor.com/project/lorien/user-agent\n\n.. image:: https://readthedocs.org/projects/user_agent/badge/?version=latest\n :target: http://user-agent.readthedocs.org\n\n\nWhat is user_agent module for?\n-------------------------------\n\nThis module is for generating random, valid web user agents:\n\n* content of \"User-Agent\" HTTP headers\n* content of `window.navigator` JavaScript object\n\n\nUsage Example\n-------------\n\n.. code:: python\n\n >>> from user_agent import generate_user_agent, generate_navigator\n >>> from pprint import pprint\n >>> generate_user_agent()\n 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.3; Win64; x64)'\n >>> generate_user_agent(os=('mac', 'linux'))\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:36.0) Gecko/20100101 Firefox/36.0'\n >>> pprint(generate_navigator())\n {'app_code_name': 'Mozilla',\n 'app_name': 'Netscape',\n 'appversion': '5.0',\n 'name': 'firefox',\n 'os': 'linux',\n 'oscpu': 'Linux i686 on x86_64',\n 'platform': 'Linux i686 on x86_64',\n 'user_agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686 on x86_64; rv:41.0) Gecko/20100101 Firefox/41.0',\n 'version': '41.0'}\n >>> pprint(generate_navigator_js())\n {'appCodeName': 'Mozilla',\n 'appName': 'Netscape',\n 'appVersion': '38.0',\n 'platform': 'MacIntel',\n 'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Firefox/38.0'}\n\n\nCommand Line Usage\n------------------\n\n.. code:: shell\n\n $ ua\n Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:49.0) Gecko/20100101 Firefox/49.0\n\n $ ua -n chrome -e\n {\n \"oscpu\": \"Linux i686 on x86_64\", \n \"appName\": \"Netscape\", \n \"appCodeName\": \"Mozilla\", \n \"appVersion\": \"55.0.2909.25\", \n \"platform\": \"X11; Linux i686 on x86_64\", \n \"userAgent\": \"Mozilla/5.0 (X11; Linux i686 on x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2909.25 Safari/537.36\"\n }\n\n\nInstallation\n------------\n\n.. code:: shell\n\n $ pip install -U user_agent\n\n\nDocumentation\n-------------\n\nDocumentation is available at http://user-agent.readthedocs.org\n\n\nContribution\n============\n\nUse github to submit bug,fix or wish request: https://github.com/lorien/user_agent/issues",
"bugtrack_url": null,
"license": "MIT License",
"summary": "User-Agent generator",
"version": "0.1.10",
"project_urls": {
"Download": "http://pypi.python.org/pypi/user_agent",
"Homepage": "https://github.com/lorien/user_agent"
},
"split_keywords": [
"user",
"agent",
"browser",
"navigator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b5db559a95b7cc146b269a0cc4cb7a53471ddd270ce9b29f23a5ed5e118acd4e",
"md5": "39e3af475e078fa1a6811b9cbac464e9",
"sha256": "b86537cb2a9d3bda0e2afcc654ec15b383502836877a67520654acadf73f1723"
},
"downloads": -1,
"filename": "user_agent-0.1.10.tar.gz",
"has_sig": false,
"md5_digest": "39e3af475e078fa1a6811b9cbac464e9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20965,
"upload_time": "2021-12-04T13:59:03",
"upload_time_iso_8601": "2021-12-04T13:59:03.834650Z",
"url": "https://files.pythonhosted.org/packages/b5/db/559a95b7cc146b269a0cc4cb7a53471ddd270ce9b29f23a5ed5e118acd4e/user_agent-0.1.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-12-04 13:59:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lorien",
"github_project": "user_agent",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "user-agent"
}