my-fake-useragent


Namemy-fake-useragent JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/a358003542/my-fake-useragent
Summarycreate a fake useragent
upload_time2023-05-02 18:20:25
maintainerwanze
docs_urlNone
authorwanze
requires_python
licenseMIT
keywords useragent python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # my-fake-useragent
generate your random fake useragent.


## description:
create your fake useragent

## install
```
python setup.py install
```

or
```text
pip install my_fake_useragent
```
    
## usage

```python
from my_fake_useragent import UserAgent

ua = UserAgent(family='chrome')

res = ua.random()

```

### family参数可用:
可以设置列表还匹配多种情况

- chrome
- firefox
- edge
- ie
- opera
- safari

### os_family参数可用
可以设置列表还匹配多种情况

- android
- windows
- linux
- mac
- ios
- chrome os

### phone参数可用

- None 不过滤
- True 要求是移动端
- False 要求不是移动端

移动端的判据如下:
如果device family检测到:

```
[
    'BlackBerry',
    'BlackBerry 9700',
    'BlackBerry 9800',
    'Generic Feature Phone',
    'Generic Smartphone',
    'Generic Tablet',
    'HTC Desire',
    'HTC DesireHD A9191',
    'HTC DesireS S510e',
    'HTC DesireZ A7272',
    'HTC HD2_T8585',
    'HTC IncredibleS S710e',
    'HTC Legend',
    'HTC P715a',
    'HTC Pyramid',
    'HTC Sensation',
    'HTC Vision',
    'LG-L160L',
    'LG-LU3000',
    'LG-P505R',
    'Nintendo Wii',
    'Nokia 2730c-1',
    'SprintPPC-6700',
    'SprintPPC-6700)',
    'SprintPPC-i830',
    'SprintSCH-i320',
    'SprintSCH-i830',
    'SprintSPH-ip320',
    'SprintSPH-ip830w',
    'T-Mobile myTouch 3G Slide',
    'iPad',
    'iPhone',
    'iPod']
```

则认为是移动端,同时还补充 认为 android操作系统和ios操作系统也是移动端。


一个符合过滤例子如下:

要求 linux操作系统的的chrome 浏览器:

```
from my_fake_useragent import UserAgent
ua = UserAgent(family='chrome', os_family='linux')
```

## CHANGELOG
### 0.2.1
更新了最新的数据,看了一下,就Chrome firefox等增加了一些新的版本。项目很久没接触了,其他的没做修改。

浏览器现在变动得也比较少了,本项目就生成一些随机的useragent基本上够用了,打算封存了。

### 0.2.0
make the parsed_data.json file to a .py file which will make this package more compatible with the pyinstaller package.

### 0.1.6
nothing change on the source code, but add the pypi wheel to speed up installation.

### 0.1.1
this module does not need any third module at all.

### 0.1.0
init



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/a358003542/my-fake-useragent",
    "name": "my-fake-useragent",
    "maintainer": "wanze",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "a358003542@gmail.com",
    "keywords": "useragent,python",
    "author": "wanze",
    "author_email": "a358003542@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/64/358def34ed2ba6b775d1f7891cf67ca65653ef2435f84f56c5e4cabb8b39/my_fake_useragent-0.2.1.tar.gz",
    "platform": null,
    "description": "# my-fake-useragent\r\ngenerate your random fake useragent.\r\n\r\n\r\n## description:\r\ncreate your fake useragent\r\n\r\n## install\r\n```\r\npython setup.py install\r\n```\r\n\r\nor\r\n```text\r\npip install my_fake_useragent\r\n```\r\n    \r\n## usage\r\n\r\n```python\r\nfrom my_fake_useragent import UserAgent\r\n\r\nua = UserAgent(family='chrome')\r\n\r\nres = ua.random()\r\n\r\n```\r\n\r\n### family\u53c2\u6570\u53ef\u7528\uff1a\r\n\u53ef\u4ee5\u8bbe\u7f6e\u5217\u8868\u8fd8\u5339\u914d\u591a\u79cd\u60c5\u51b5\r\n\r\n- chrome\r\n- firefox\r\n- edge\r\n- ie\r\n- opera\r\n- safari\r\n\r\n### os_family\u53c2\u6570\u53ef\u7528\r\n\u53ef\u4ee5\u8bbe\u7f6e\u5217\u8868\u8fd8\u5339\u914d\u591a\u79cd\u60c5\u51b5\r\n\r\n- android\r\n- windows\r\n- linux\r\n- mac\r\n- ios\r\n- chrome os\r\n\r\n### phone\u53c2\u6570\u53ef\u7528\r\n\r\n- None \u4e0d\u8fc7\u6ee4\r\n- True \u8981\u6c42\u662f\u79fb\u52a8\u7aef\r\n- False \u8981\u6c42\u4e0d\u662f\u79fb\u52a8\u7aef\r\n\r\n\u79fb\u52a8\u7aef\u7684\u5224\u636e\u5982\u4e0b\uff1a\r\n\u5982\u679cdevice family\u68c0\u6d4b\u5230\uff1a\r\n\r\n```\r\n[\r\n    'BlackBerry',\r\n    'BlackBerry 9700',\r\n    'BlackBerry 9800',\r\n    'Generic Feature Phone',\r\n    'Generic Smartphone',\r\n    'Generic Tablet',\r\n    'HTC Desire',\r\n    'HTC DesireHD A9191',\r\n    'HTC DesireS S510e',\r\n    'HTC DesireZ A7272',\r\n    'HTC HD2_T8585',\r\n    'HTC IncredibleS S710e',\r\n    'HTC Legend',\r\n    'HTC P715a',\r\n    'HTC Pyramid',\r\n    'HTC Sensation',\r\n    'HTC Vision',\r\n    'LG-L160L',\r\n    'LG-LU3000',\r\n    'LG-P505R',\r\n    'Nintendo Wii',\r\n    'Nokia 2730c-1',\r\n    'SprintPPC-6700',\r\n    'SprintPPC-6700)',\r\n    'SprintPPC-i830',\r\n    'SprintSCH-i320',\r\n    'SprintSCH-i830',\r\n    'SprintSPH-ip320',\r\n    'SprintSPH-ip830w',\r\n    'T-Mobile myTouch 3G Slide',\r\n    'iPad',\r\n    'iPhone',\r\n    'iPod']\r\n```\r\n\r\n\u5219\u8ba4\u4e3a\u662f\u79fb\u52a8\u7aef\uff0c\u540c\u65f6\u8fd8\u8865\u5145 \u8ba4\u4e3a android\u64cd\u4f5c\u7cfb\u7edf\u548cios\u64cd\u4f5c\u7cfb\u7edf\u4e5f\u662f\u79fb\u52a8\u7aef\u3002\r\n\r\n\r\n\u4e00\u4e2a\u7b26\u5408\u8fc7\u6ee4\u4f8b\u5b50\u5982\u4e0b\uff1a\r\n\r\n\u8981\u6c42 linux\u64cd\u4f5c\u7cfb\u7edf\u7684\u7684chrome \u6d4f\u89c8\u5668:\r\n\r\n```\r\nfrom my_fake_useragent import UserAgent\r\nua = UserAgent(family='chrome', os_family='linux')\r\n```\r\n\r\n## CHANGELOG\r\n### 0.2.1\r\n\u66f4\u65b0\u4e86\u6700\u65b0\u7684\u6570\u636e\uff0c\u770b\u4e86\u4e00\u4e0b\uff0c\u5c31Chrome firefox\u7b49\u589e\u52a0\u4e86\u4e00\u4e9b\u65b0\u7684\u7248\u672c\u3002\u9879\u76ee\u5f88\u4e45\u6ca1\u63a5\u89e6\u4e86\uff0c\u5176\u4ed6\u7684\u6ca1\u505a\u4fee\u6539\u3002\r\n\r\n\u6d4f\u89c8\u5668\u73b0\u5728\u53d8\u52a8\u5f97\u4e5f\u6bd4\u8f83\u5c11\u4e86\uff0c\u672c\u9879\u76ee\u5c31\u751f\u6210\u4e00\u4e9b\u968f\u673a\u7684useragent\u57fa\u672c\u4e0a\u591f\u7528\u4e86\uff0c\u6253\u7b97\u5c01\u5b58\u4e86\u3002\r\n\r\n### 0.2.0\r\nmake the parsed_data.json file to a .py file which will make this package more compatible with the pyinstaller package.\r\n\r\n### 0.1.6\r\nnothing change on the source code, but add the pypi wheel to speed up installation.\r\n\r\n### 0.1.1\r\nthis module does not need any third module at all.\r\n\r\n### 0.1.0\r\ninit\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "create a fake useragent",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/a358003542/my-fake-useragent"
    },
    "split_keywords": [
        "useragent",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "632dffec5d49c6f5e7a8f62d71c36de02601251c2e26db41a1c90e7ff0db6981",
                "md5": "39f8200a4ffca19be66b720028c995dc",
                "sha256": "48add6b06dd038cacba234b96fe8a50a1a7df376cf90830fc9640e7226ec507a"
            },
            "downloads": -1,
            "filename": "my_fake_useragent-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "39f8200a4ffca19be66b720028c995dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 69592,
            "upload_time": "2023-05-02T18:20:22",
            "upload_time_iso_8601": "2023-05-02T18:20:22.899190Z",
            "url": "https://files.pythonhosted.org/packages/63/2d/ffec5d49c6f5e7a8f62d71c36de02601251c2e26db41a1c90e7ff0db6981/my_fake_useragent-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1264358def34ed2ba6b775d1f7891cf67ca65653ef2435f84f56c5e4cabb8b39",
                "md5": "78f0effb0908fa0d9d82174712439526",
                "sha256": "64840ebf4c10cfc07af04313a6000d9802f72bbc7579095d75e02f25ed346387"
            },
            "downloads": -1,
            "filename": "my_fake_useragent-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "78f0effb0908fa0d9d82174712439526",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 67345,
            "upload_time": "2023-05-02T18:20:25",
            "upload_time_iso_8601": "2023-05-02T18:20:25.113290Z",
            "url": "https://files.pythonhosted.org/packages/12/64/358def34ed2ba6b775d1f7891cf67ca65653ef2435f84f56c5e4cabb8b39/my_fake_useragent-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-02 18:20:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "a358003542",
    "github_project": "my-fake-useragent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "my-fake-useragent"
}
        
Elapsed time: 0.09132s