--- id: user-agent version: "0.1.14" license: The MIT License (MIT) Copyright (c) 2015-2025, Gregory Petukhov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # user-agent — Library to build content for User-Agent HTTP header License: permissive · Maintenance: aging · Downloads: 315.9K/mo ## What it is and what it does user_agent is a library for generating realistic, randomized user agent strings and navigator object properties. It produces valid HTTP User-Agent header content and JavaScript navigator object data across a range of browsers and operating systems. The package exposes functions like generate_user_agent() and generate_navigator() that return either raw strings or structured dictionaries, and includes a command-line tool (ua) for one-off generation. The library is commonly used in web scraping, web crawling, and testing scenarios where rotating or spoofing user agents helps avoid detection or simulate diverse client environments. It depends on six and pytz for Python 2/3 compatibility and timezone handling. The package supports Python 2.7 through 3.13, though its aging maintenance status means the underlying user agent database may lag behind the latest browser releases. Use it for: - Rotate user agents in web scrapers to avoid bot detection and IP blocking - Generate realistic navigator objects for browser automation and headless testing - Simulate diverse client environments in load testing and stress testing scenarios - Populate User-Agent headers in HTTP requests for web crawlers and API clients - Test web applications' handling of different browsers and operating systems ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates random, valid web user agent strings for HTTP headers and browser navigator objects across multiple operating systems and browsers. Yes, if you need basic user agent generation for web scraping or testing. The low install friction, permissive MIT license, and broad Python version support make it straightforward to add. However, be aware that maintenance is aging (338 days since last release) and the user agent database may not reflect the latest browser versions—verify that generated agents match your target environment before relying on it for production bot detection evasion. ## Install pip install user-agent uv add user-agent poetry add user-agent ## Installing user-agent Before you install: Low install friction with only two lightweight runtime dependencies (six and pytz). Maintenance status is aging—last release was 338 days ago—but the repository remains active with recent commits and no archived status. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal obligations, making it suitable for both open-source and commercial projects. Quickstart: pip install user-agent from user_agent import generate_user_agent, generate_navigator generate_user_agent() # 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.3; Win64; x64)' generate_navigator() Verify before relying: - Whether the generated user agents remain current with modern browser versions and OS releases - How frequently the user agent database is updated to reflect real-world browser landscape changes ## Package facts - License: The MIT License (MIT) Copyright (c) 2015-2025, Gregory Petukhov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 315.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags random user agent generator, user agent string generation, browser user agent faker, web scraping user agent, http header user agent, navigator object generator, fake browser agent, web-scraping, testing, user-agent [View on SkillFed](https://skillfed.io/packages/user-agent) · [View on PyPI](https://pypi.org/project/user-agent/)