Skip to main content

Simple library for generating random user agents

Project description

get_ua

Overview

get_ua is a Python library for generating random user agents. It provides a simple interface to retrieve user agents based on different criteria such as browser, operating system, and device.

Installation

You can install the library using pip:

pip install get-ua

Usage

import get_ua

# Create an instance of the user agent generator
ua = get_ua.ua()

# Generate a random user agent
random_ua = ua.random()
print("Random User Agent:", random_ua)

# Get a random user agent for a specific browser, OS, and device type
random_agent = ua.random(browser='Chrome', os='Windows', device='desktop')
print("Random User Agent (filtered):", random_agent)

# Generate a random user agent based on browser
chrome_ua = ua.by_browser('Chrome')
print("Chrome User Agent:", chrome_ua)

# Generate a random user agent based on operating system
windows_ua = ua.by_os('Windows')
print("Windows User Agent:", windows_ua)

# Generate a random user agent based on device
iphone_ua = ua.by_device('iPhone')
print("iPhone User Agent:", iphone_ua)

# Get a list of user agents for a specific browser
firefox_agents = ua.list_by_browser('Firefox')
print("Firefox User Agents:", firefox_agents)

# Get a list of user agents for a specific operating system
linux_agents = ua.list_by_os('Linux')
print("Linux User Agents:", linux_agents)

# Get a list of user agents for a specific device
tablet_agents = ua.list_by_device('Tablet')
print("Tablet User Agents:", tablet_agents)

# Get a list of all available user agents
all_agents = ua.list_all()
print("All User Agents:", all_agents)

.random() Possible Filters:

Browsers:

  • "Chrome"
  • "Edge"
  • "Firefox"
  • "Internet Explorer"
  • "Safari"

Device Types:

  • "desktop"
  • "mobile"

Operating Systems:

  • "Android"
  • "iOS"
  • "macOS"
  • "Windows"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_ua-20231212.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file get_ua-20231212.tar.gz.

File metadata

  • Download URL: get_ua-20231212.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for get_ua-20231212.tar.gz
Algorithm Hash digest
SHA256 d3387a88150e815c6e6fc933e22b2588500605a959e552a71b9373cb3ef3c033
MD5 d3ec0a2da341ed9c093ebe5f4a4e7510
BLAKE2b-256 866870d8204284bc96c7fb214123558b52005fb27d6b2b54ac6a5af2ded12f87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page