Skip to main content

fakeua

Python module made as a wrapper of fake-useragent.

Rationale:

fake-useragent package (https://github.com/hellysmile/fake-useragent) have an API which is brittle and too verbose for cases when you just want predictability and the work done without unnecesary headaches.

Installation

Install with uv

uv add fakeua

Usage

FakeUA can be used from the shell too.

fakeua -h

Or importing its functions.

In [1]: import fakeua

# Update useragent DB in a json file (~/.fakeua_databrowsers.json)
In [2]: fakeua.update_useragent_db()
Out[2]: True

In [3]: fakeua.get_useragent_list()
Out[3]: 
['Mozilla/5.0 (X11; Linux i686; rv:64.0) Gecko/20100101 Firefox/64.0',
 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0',
 'Mozilla/5.0 (X11; Linux i586; rv:63.0) Gecko/20100101 Firefox/63.0',
 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:63.0) Gecko/20100101 Firefox/63.0',
 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.10; rv:62.0) Gecko/20100101 Firefox/62.0']

In [4]: fakeua.load_useragent_db()                                                 
Out[4]: ...
# It throws a dict containing the browsers scraped by fake-useragent.

In [5]: fakeua.get_random_ua()
Out[5]: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:63.0) Gecko/20100101 Firefox/63.0'

Metadata

Release files for fakeua 0.2.0

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

Source distribution (sdist)

Source distribution for fakeua 0.2.0
File Size Uploaded
fakeua-0.2.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fakeua 0.2.0
File Interpreter ABI Platform
fakeua-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / fakeua-0.2.0.tar.gz

Download URL fakeua-0.2.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e21ad9b3c7f87d0485d461d2c999f3a290de83e344ad137b0a00a17971c3172b
BLAKE2b-256 checksum
How to use checksums
34d00c491f4eead1418a0797b6ffd1194d322e643b4e7cfd32f77752982e0d55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / fakeua-0.2.0-py3-none-any.whl

Download URL fakeua-0.2.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bc5a18d188c18d1e6a6baea233b95a87fadd71d56a5ecbb6443756555d9164c
BLAKE2b-256 checksum
How to use checksums
272326ace3a988475c60ed3055a354669fa46d8138ebe3145230ab59556e7034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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