skillfed

httpagentparser

Extracts OS Browser etc information from http user agent string

httpagentparser v1.9.9 509.0K downloads/30d#6,274 on PyPI225
License unclear The MIT License (MIT) Copyright (c) 2013 Shekhar Tiwatne 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) Active released

What it is and what it does

httpagentparser is a lightweight User-Agent string parser that extracts operating system and browser information from HTTP User-Agent headers. It provides two detection modes: a simple function that returns a tuple of OS and browser name/version, and a more detailed function that returns a structured dictionary with separate OS, browser, and distribution information.

The package has no external runtime dependencies and is designed for speed and simplicity rather than comprehensive feature coverage. It supports Python 3.6 and later, has been actively maintained since 2009, and receives regular updates. The library is useful in web applications, analytics systems, and request logging where you need quick identification of client environment without the overhead of a full-featured agent parser.

Use it for:

  • Log client OS and browser information in web server request handlers or middleware
  • Implement browser-specific feature detection or compatibility warnings in web applications
  • Analyze traffic patterns by operating system and browser type in analytics pipelines
  • Serve device-appropriate content or styling based on detected OS and browser
  • Generate reports on client environment distribution for web application monitoring

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses HTTP User-Agent strings to extract and identify the operating system and browser name and version.

Yes. The package is lightweight, actively maintained, has no dependencies, and solves a straightforward parsing task. MIT licensing removes legal friction. Use it when you need quick OS and browser detection from User-Agent strings without the complexity of a full-featured parser. Verify that its detection accuracy meets your application's tolerance before relying on it for critical decisions.

Install

httpagentparser on PyPI

pip

pip install httpagentparser

uv

uv add httpagentparser

poetry

poetry add httpagentparser

Installing httpagentparser

Before you install

Low install friction with no runtime dependencies. Actively maintained with a recent release in March 2026 and steady repository activity.

License in practice

Licensed under the MIT License, which permits unrestricted use, modification, and distribution with only attribution and liability disclaimer requirements.

Quickstart

import httpagentparser

s = "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11 Safari/532.9"
print(httpagentparser.simple_detect(s))  # ('Linux', 'Chrome 5.0.307.11')
print(httpagentparser.detect(s))  # {'os': {'name': 'Linux'}, 'browser': {'version': '5.0.307.11', 'name': 'Chrome'}}

Verify before relying

  • Whether the parser handles modern User-Agent formats (e.g., the Sec-CH-UA header structure introduced in recent browsers)
  • Coverage and accuracy rates for less common operating systems and browsers
  • Performance characteristics when parsing high volumes of User-Agent strings

Package facts

License The MIT License (MIT) Copyright (c) 2013 Shekhar Tiwatne 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) (unclear)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 159 days since the last release
Last repo commit
First released
Downloads 509,023/month — #6,274 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: httpagentparser-1.9.9-py3-none-any.whl

Programming Language :: Python :: 3

Tags

user agent parserhttp user agent detectionbrowser detectionos detection from user agentparse user agent stringbrowser and os identification
user-agent-parsinghttp-headersbrowser-detection

More WWW/HTTP packages

Further reading