Name | user-agent JSON |
Version |
0.1.11
JSON |
| download |
home_page | None |
Summary | Library to build content for User-Agent HTTP header |
upload_time | 2025-09-08 15:31:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=2.7 |
license | The MIT License (MIT) Copyright (c) 2015-2025, Gregory Petukhov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
user agent
browser
web crawling
web scraping
web crawler
web scraper
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Documentation for user_agent package
[](https://github.com/lorien/user_agent/actions/workflows/test.yml)
[](https://github.com/lorien/user_agent/actions/workflows/test.yml)
[](https://github.com/lorien/user_agent/actions/workflows/mypy.yml)
[](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
```
>>> 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
```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
Run `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": null,
"name": "user-agent",
"maintainer": null,
"docs_url": null,
"requires_python": ">=2.7",
"maintainer_email": null,
"keywords": "user agent, browser, web crawling, web scraping, web crawler, web scraper",
"author": null,
"author_email": "Gregory Petukhov <lorien@lorien.name>",
"download_url": "https://files.pythonhosted.org/packages/82/55/7ff07e8978f2422f275daf3bd802ddabfcc39d6ed35a048780ba1974dc02/user_agent-0.1.11.tar.gz",
"platform": null,
"description": "# Documentation for user_agent package\n\n\n[](https://github.com/lorien/user_agent/actions/workflows/test.yml)\n[](https://github.com/lorien/user_agent/actions/workflows/test.yml)\n[](https://github.com/lorien/user_agent/actions/workflows/mypy.yml)\n[](http://user-agent.readthedocs.org)\n\n\n## What is user_agent module for?\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\n## Usage Example\n\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\n## Command Line Usage\n\n```shell\n$ ua\nMozilla/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\n## Installation\n\nRun `pip install -U user_agent`\n\n\n## Documentation\n\nDocumentation is available at http://user-agent.readthedocs.org\n\n\n## Contribution\n\nUse github to submit bug,fix or wish request: https://github.com/lorien/user_agent/issues\n",
"bugtrack_url": null,
"license": "The MIT License (MIT) Copyright (c) 2015-2025, Gregory Petukhov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Library to build content for User-Agent HTTP header",
"version": "0.1.11",
"project_urls": {
"homepage": "http://github.com/lorien/user_agent"
},
"split_keywords": [
"user agent",
" browser",
" web crawling",
" web scraping",
" web crawler",
" web scraper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82557ff07e8978f2422f275daf3bd802ddabfcc39d6ed35a048780ba1974dc02",
"md5": "cd8865dc2b786f831f079147fc9dbb9c",
"sha256": "adad44bb960b1eb934aa07ad8aefd43e0a20d9028d65d8e03f692c959ede8dfc"
},
"downloads": -1,
"filename": "user_agent-0.1.11.tar.gz",
"has_sig": false,
"md5_digest": "cd8865dc2b786f831f079147fc9dbb9c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 22484,
"upload_time": "2025-09-08T15:31:00",
"upload_time_iso_8601": "2025-09-08T15:31:00.644484Z",
"url": "https://files.pythonhosted.org/packages/82/55/7ff07e8978f2422f275daf3bd802ddabfcc39d6ed35a048780ba1974dc02/user_agent-0.1.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 15:31:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lorien",
"github_project": "user_agent",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "user-agent"
}