useragent-changer


Nameuseragent-changer JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/gitmori/useragent-changer
SummaryUser-Agent changing library for Python.
upload_time2023-09-12 08:10:23
maintainerYuki Moriya
docs_urlNone
authorYuki Moriya
requires_python>=3.6.5
licenseMIT
keywords useragent user_agent user-agent ua useragent_change useragent_changer useragent-changer useragent-change
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # useragent-changer
A library for changing user agents in order to verify the operation of web systems.

## Features
- This package contains User-Agent data for a total of 19,381 for the platforms listed below. 
- Android (2,144), Chrome (4,996), Edge (91), Firefox (2,132), iPad (45), iPhone (750), Mac (1,739), Safari (4,952), Windows (2,532)
- User-Agent corresponding to each platform is described in 9 CSV files in the data folder in this package.
- Supports Python 3.x

### Installation
Enter one of the following two commands:
```
pip3 install useragent-changer
```
```
pip3 install git+https://github.com/gitmori/useragent-changer
```

### Downloads
[![Downloads](https://static.pepy.tech/badge/useragent-changer)](https://pepy.tech/project/useragent-changer) [![Downloads](https://static.pepy.tech/badge/useragent-changer/month)](https://pepy.tech/project/useragent-changer) [![Downloads](https://static.pepy.tech/badge/useragent-changer/week)](https://pepy.tech/project/useragent-changer)

### Usage
```
from useragent_changer import UserAgent

ua = UserAgent('android')
print(ua.set())
# Dalvik/2.1.0 (Linux; U; Android 10; ASUS_Z01RD Build/QKQ1.191008.001)

ua = UserAgent('iphone')
print(ua.set())
# Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1

ua = UserAgent('ipad')
print(ua.set())
# Mozilla/5.0 (iPad; CPU OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/94.0.4606.76 Mobile/15E148 Safari/604.1

ua = UserAgent('windows')
print(ua.set())
# Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)

ua = UserAgent('mac')
print(ua.set())
# Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

ua = UserAgent('chrome')
print(ua.set())
# Mozilla / 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 74.0.3729.169 Safari / 537.36

ua = UserAgent('edge')
print(ua.set())
# Mozilla/5.0 (Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.9200

ua = UserAgent('safari')
print(ua.set())
# Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; ja) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.523 Mobile Safari/534.11+

ua = UserAgent('firefox')
print(ua.set())
# Dalvik/2.1.0 (Linux; U; Android 10; ASUS_Z01RD Build/QKQ1.191008.001)

ua = UserAgent()
print(ua.set())
# Get a random User-Agent
```

### Test
If you don't have Selenium installed, run the following command: `pip3 install selenium`
```
from selenium.webdriver import ChromeOptions, Chrome
from useragent_changer import UserAgent
from time import sleep

PLATFORM= 'firefox'
URL = 'https://develop.tools/env-variable/'

ua = UserAgent(PLATFORM)

options = ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--user-agent=' + ua.set())

driver = Chrome(options=options)
driver.get(URL)

SECONDS = 5
sleep(SECONDS)
driver.quit()
```

## Changelog
- 0.1.1 August 02, 2023
    - First push
- 0.3.2 September 12, 2023
    - Fixed comments in module file

## Author
Yuki Moriya ([gitmori](https://github.com/gitmori/))  
ym19820219@gmail.com

## Licence
Copyright (c) 2023 Yuki Moriya  
This software is released under the MIT License, see LICENSE.txt.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gitmori/useragent-changer",
    "name": "useragent-changer",
    "maintainer": "Yuki Moriya",
    "docs_url": null,
    "requires_python": ">=3.6.5",
    "maintainer_email": "ym19820219@gmail.com",
    "keywords": "useragent user_agent user-agent ua useragent_change useragent_changer useragent-changer useragent-change",
    "author": "Yuki Moriya",
    "author_email": "ym19820219@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/68/67b2957b5ec1b196401e01c4a87cc146e5a9035960c1be43e006681e08d1/useragent_changer-0.3.2.tar.gz",
    "platform": null,
    "description": "# useragent-changer\nA library for changing user agents in order to verify the operation of web systems.\n\n## Features\n- This package contains User-Agent data for a total of 19,381 for the platforms listed below. \n- Android (2,144), Chrome (4,996), Edge (91), Firefox (2,132), iPad (45), iPhone (750), Mac (1,739), Safari (4,952), Windows (2,532)\n- User-Agent corresponding to each platform is described in 9 CSV files in the data folder in this package.\n- Supports Python 3.x\n\n### Installation\nEnter one of the following two commands:\n```\npip3 install useragent-changer\n```\n```\npip3 install git+https://github.com/gitmori/useragent-changer\n```\n\n### Downloads\n[![Downloads](https://static.pepy.tech/badge/useragent-changer)](https://pepy.tech/project/useragent-changer) [![Downloads](https://static.pepy.tech/badge/useragent-changer/month)](https://pepy.tech/project/useragent-changer) [![Downloads](https://static.pepy.tech/badge/useragent-changer/week)](https://pepy.tech/project/useragent-changer)\n\n### Usage\n```\nfrom useragent_changer import UserAgent\n\nua = UserAgent('android')\nprint(ua.set())\n# Dalvik/2.1.0 (Linux; U; Android 10; ASUS_Z01RD Build/QKQ1.191008.001)\n\nua = UserAgent('iphone')\nprint(ua.set())\n# Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1\n\nua = UserAgent('ipad')\nprint(ua.set())\n# Mozilla/5.0 (iPad; CPU OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/94.0.4606.76 Mobile/15E148 Safari/604.1\n\nua = UserAgent('windows')\nprint(ua.set())\n# Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)\n\nua = UserAgent('mac')\nprint(ua.set())\n# Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0\n\nua = UserAgent('chrome')\nprint(ua.set())\n# Mozilla / 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 74.0.3729.169 Safari / 537.36\n\nua = UserAgent('edge')\nprint(ua.set())\n# Mozilla/5.0 (Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.9200\n\nua = UserAgent('safari')\nprint(ua.set())\n# Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; ja) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.523 Mobile Safari/534.11+\n\nua = UserAgent('firefox')\nprint(ua.set())\n# Dalvik/2.1.0 (Linux; U; Android 10; ASUS_Z01RD Build/QKQ1.191008.001)\n\nua = UserAgent()\nprint(ua.set())\n# Get a random User-Agent\n```\n\n### Test\nIf you don't have Selenium installed, run the following command: `pip3 install selenium`\n```\nfrom selenium.webdriver import ChromeOptions, Chrome\nfrom useragent_changer import UserAgent\nfrom time import sleep\n\nPLATFORM= 'firefox'\nURL = 'https://develop.tools/env-variable/'\n\nua = UserAgent(PLATFORM)\n\noptions = ChromeOptions()\noptions.add_argument('--ignore-certificate-errors')\noptions.add_argument('--user-agent=' + ua.set())\n\ndriver = Chrome(options=options)\ndriver.get(URL)\n\nSECONDS = 5\nsleep(SECONDS)\ndriver.quit()\n```\n\n## Changelog\n- 0.1.1 August 02, 2023\n    - First push\n- 0.3.2 September 12, 2023\n    - Fixed comments in module file\n\n## Author\nYuki Moriya ([gitmori](https://github.com/gitmori/))  \nym19820219@gmail.com\n\n## Licence\nCopyright (c) 2023 Yuki Moriya  \nThis software is released under the MIT License, see LICENSE.txt.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "User-Agent changing library for Python.",
    "version": "0.3.2",
    "project_urls": {
        "Download": "https://github.com/gitmori/useragent-changer",
        "Homepage": "https://github.com/gitmori/useragent-changer"
    },
    "split_keywords": [
        "useragent",
        "user_agent",
        "user-agent",
        "ua",
        "useragent_change",
        "useragent_changer",
        "useragent-changer",
        "useragent-change"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3876b2799ef92a77fca35ae5da12c2857bfb40cf20f30c7c0a4762bf2457bb05",
                "md5": "584a5fd0f5eecab2507b63e19af712bc",
                "sha256": "03ff69c6c1ebbba46fe12a9b4c68df58533530b095d921464b25df49be39a3d1"
            },
            "downloads": -1,
            "filename": "useragent_changer-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "584a5fd0f5eecab2507b63e19af712bc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6.5",
            "size": 157958,
            "upload_time": "2023-09-12T08:10:21",
            "upload_time_iso_8601": "2023-09-12T08:10:21.309817Z",
            "url": "https://files.pythonhosted.org/packages/38/76/b2799ef92a77fca35ae5da12c2857bfb40cf20f30c7c0a4762bf2457bb05/useragent_changer-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c96867b2957b5ec1b196401e01c4a87cc146e5a9035960c1be43e006681e08d1",
                "md5": "b1a01ded35d6b6fa9ffa04cdd3ab195c",
                "sha256": "e69b0f95b62a9a5e15f7b718c75ad238eb827b6dfd238d34ef212931cbec3d94"
            },
            "downloads": -1,
            "filename": "useragent_changer-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b1a01ded35d6b6fa9ffa04cdd3ab195c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.5",
            "size": 148398,
            "upload_time": "2023-09-12T08:10:23",
            "upload_time_iso_8601": "2023-09-12T08:10:23.306948Z",
            "url": "https://files.pythonhosted.org/packages/c9/68/67b2957b5ec1b196401e01c4a87cc146e5a9035960c1be43e006681e08d1/useragent_changer-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-12 08:10:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gitmori",
    "github_project": "useragent-changer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "useragent-changer"
}
        
Elapsed time: 0.11786s