Skip to main content

my-fake-useragent

generate your random fake useragent.

description:

create your fake useragent

install

python setup.py install

or

pip install my_fake_useragent

usage

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

Metadata

Release files for my-fake-useragent 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for my-fake-useragent 0.2.1
File Size Uploaded Provenance
my_fake_useragent-0.2.1.tar.gz 67.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for my-fake-useragent 0.2.1
File Interpreter ABI Platform
my_fake_useragent-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 136.9 kB

Release files / my_fake_useragent-0.2.1.tar.gz

Download URL my_fake_useragent-0.2.1.tar.gz
Size 67.3 kB
Tags Source
SHA-256 checksum
How to use checksums
64840ebf4c10cfc07af04313a6000d9802f72bbc7579095d75e02f25ed346387
BLAKE2b-256 checksum
How to use checksums
1264358def34ed2ba6b775d1f7891cf67ca65653ef2435f84f56c5e4cabb8b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / my_fake_useragent-0.2.1-py3-none-any.whl

Download URL my_fake_useragent-0.2.1-py3-none-any.whl
Size 69.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48add6b06dd038cacba234b96fe8a50a1a7df376cf90830fc9640e7226ec507a
BLAKE2b-256 checksum
How to use checksums
632dffec5d49c6f5e7a8f62d71c36de02601251c2e26db41a1c90e7ff0db6981
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for my-fake-useragent 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page