Metadata-Version: 2.4
Name: emulating-user-agent
Version: 1.0.8
Summary: Generate realistic and diverse user agents for desktop, mobile, and web automation testing
Author-email: Raz Andr <tahiniavorazanadahy@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/razanadahy/EmulatingUserAgent
Project-URL: Documentation, https://github.com/razanadahy/EmulatingUserAgent#readme
Project-URL: Repository, https://github.com/razanadahy/EmulatingUserAgent.git
Project-URL: Issues, https://github.com/razanadahy/EmulatingUserAgent/issues
Keywords: user-agent,user agents,user agent threads
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.15,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=41.0.0
Requires-Dist: python-dotenv>=1.0.0
Dynamic: license-file

# Emulating User Agent

Generate realistic and diverse user agents for desktop, mobile, and web automation testing.

## Features

- 🖥️ **Desktop User Agents** — Windows, macOS with Chrome, Firefox, Safari, Edge
- 📱 **Android User Agents** — 100+ realistic Android devices (Samsung, Google Pixel, OnePlus, Xiaomi, etc.)
- 🎯 **Locale Support** — 30+ languages and regions
- 🔄 **Random Generation** — Generate diverse agents for testing and web scraping
- 📊 **Device Details** — Include viewport, DPI, model, Android version, and more

## Installation

```bash
pip install emulating-user-agent
```

## Quick Start

```python
from Emulating.AndroidUserAgent import get_random_agent, get_android_user_agent
from Emulating.DeskTopUserAgent import USER_AGENTS

# Get a random agent (desktop or mobile, English locale)
device_name, agent_data = get_random_agent(isEn=True)
print(agent_data['ua'])  # User-Agent string
print(agent_data['viewport'])  # Viewport dimensions

# Get a specific Android device
agent = get_android_user_agent(isEN=True, device_name="Samsung Galaxy S25 Ultra")
print(agent['ua'])
print(agent['model'])
print(agent['android'])
```

## Usage Examples

### Get Random Android Device
```python
from Emulating.AndroidUserAgent import get_random_android_device, list_android_devices

# List all available devices
devices = list_android_devices()

# Get random device
name, agent = get_random_android_device(isEn=True)
print(f"Device: {name}")
print(f"User-Agent: {agent['ua']}")
print(f"Viewport: {agent['viewport']}")
```

### Access Desktop Agents
```python
from Emulating.DeskTopUserAgent import USER_AGENTS

for device_name, agent_data in USER_AGENTS.items():
    print(f"{device_name}: {agent_data['ua']}")
```

## API Reference

### `get_random_agent(isEn: bool) -> tuple`
Returns a random agent (desktop or mobile).
- **isEn**: If True, use English locale; otherwise random locale

### `get_android_user_agent(isEN: bool, device_name: str | None = None) -> dict`
Returns an Android user agent with full device details.
- **isEN**: English locale flag
- **device_name**: Optional specific device (see `list_android_devices()`)

### `get_random_android_device(isEn: bool) -> tuple[str, dict]`
Returns device name and Android agent.

### `list_android_devices() -> list[str]`
Lists all available Android device names.

## Supported Android Devices

- **Samsung**: Galaxy S25, S24, S23, S20, Note 20, Z Fold 5, Z Flip 7, Galaxy A series
- **Google Pixel**: 11, 10, 9 Pro, 8 Pro, 7 Pro, 7, 6a
- **OnePlus**: 13, 12, 11, 10 Pro, Nord 4
- **Xiaomi**: 15, 14, 13, 12, Redmi Note series
- **OPPO/realme**: Find X8, X6, GT series
- **Sony Xperia**, **Motorola**, **Asus ROG**, **Huawei**, and more

## License

MIT License - See LICENSE file for details

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Author

Raz Andr
