Up-to-date simple user-agent faker with real world database
Project description
forge-useragent
Forked version of fake-useragent.
- Supports Python 3.10 or higher
Introduction
Installation
# pypi name change to `forge-useragent`
pip install forge-useragent
# check version
pip list | grep -i forge-useragent
python -c "import fake_useragent; print(fake_useragent.__version__)"
Usage
package name is same fake_useragent:
from fake_useragent import UserAgent
ua = UserAgent()
# Get a random browser user-agent string
print(ua.random)
# Or get user-agent string from a specific browser
print(ua.chrome)
print(ua.firefox)
print(ua.safari)
print(ua.opera)
print(ua.edge)
print(ua['Chrome'])
More
# names are case-sensitive!
from fake_useragent import UserAgent
# browsers
ua = UserAgent(browsers=['Edge', 'Chrome'])
ua.random
# os
ua = UserAgent(os='Linux')
ua.random
# platforms: desktop / mobile / tablet
ua = UserAgent(platforms='mobile')
ua.random
from fake_useragent import UserAgent
ua = UserAgent(platforms='desktop')
ua.random
# get only user agents that have a minimum version of 120.0:
from fake_useragent import UserAgent
ua = UserAgent(min_version=120.0)
ua.random
User-agent Python Dictionary
Warning Raw JSON objects (in a Python dictionaries) are returned "as is". Meaning, this data structure could change in the future!
Be aware that these "get" properties below might not return the same key/value pairs in the future. Use
ua.randomor alike as mentioned above, if you want to use a stable interface.INCOMPATIBLE PROPERTY NAME CHANGED!
from fake_useragent import UserAgent
ua = UserAgent()
# Random user-agent dictionary (object)
ua.get_random # old version: ua.getRandom
# More get properties:
ua.get_f_irefox # ua.getFirefox
ua.get_chrome # ua.getChrome
ua.get_safari # ua.getSafari
ua.get_edge # ua.getEdge
# And a method with an argument.
ua.get_browser('firefox') # ua.getBrowser('firefox')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forge_useragent-3.0.1.tar.gz.
File metadata
- Download URL: forge_useragent-3.0.1.tar.gz
- Upload date:
- Size: 276.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f8d38941126eeb22717d38a4bb0bcff66051ad232e8096f63a6f2415c1c0fca
|
|
| MD5 |
bb7cc6303d026edaf1009ffeb504d49d
|
|
| BLAKE2b-256 |
dca2a2e1574d2721ba1e33d4d24761172207db8ea0cab510fca1352ac80f76d3
|
Provenance
The following attestation bundles were made for forge_useragent-3.0.1.tar.gz:
Publisher:
python-publish.yml on hantang/python-ua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_useragent-3.0.1.tar.gz -
Subject digest:
5f8d38941126eeb22717d38a4bb0bcff66051ad232e8096f63a6f2415c1c0fca - Sigstore transparency entry: 1572116032
- Sigstore integration time:
-
Permalink:
hantang/python-ua@233025831b699def04e16edeb7c9e9ca95e0fad9 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/hantang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@233025831b699def04e16edeb7c9e9ca95e0fad9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file forge_useragent-3.0.1-py3-none-any.whl.
File metadata
- Download URL: forge_useragent-3.0.1-py3-none-any.whl
- Upload date:
- Size: 277.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7c814706e94129643d0c1159d6d244a6d2fa07ab9f37cb716cdceff581c9a31
|
|
| MD5 |
9b5d4d797332007cb2a3d2b6b094704e
|
|
| BLAKE2b-256 |
1cec0b3c9d0e3cd4f3e5cf174762428db0cd55acfe6e6211095b4d9dd8f41064
|
Provenance
The following attestation bundles were made for forge_useragent-3.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on hantang/python-ua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forge_useragent-3.0.1-py3-none-any.whl -
Subject digest:
e7c814706e94129643d0c1159d6d244a6d2fa07ab9f37cb716cdceff581c9a31 - Sigstore transparency entry: 1572116060
- Sigstore integration time:
-
Permalink:
hantang/python-ua@233025831b699def04e16edeb7c9e9ca95e0fad9 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/hantang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@233025831b699def04e16edeb7c9e9ca95e0fad9 -
Trigger Event:
push
-
Statement type: