pymobiledetect
Detect mobile and tablet browsers
What it is and what it does
pymobiledetect is a Python wrapper that parses HTTP user-agent strings to classify whether a request comes from a mobile phone, tablet, or desktop browser. It takes a user-agent string (typically from an HTTP request header) and provides methods to query device type. The package depends only on six for Python 2/3 compatibility.
The library is marked as Production/Stable but has been abandoned since its latest release on 2018-05-10, with no commits or maintenance since then. While it has low install friction and no known security vulnerabilities, the unmaintained status means user-agent detection patterns will drift from modern devices and browsers. It remains suitable for legacy systems or where device classification is non-critical, but new projects should evaluate actively maintained alternatives.
Use it for:
- Serve mobile-optimized layouts or stylesheets based on device type in web frameworks
- Log or analyze traffic patterns by device category in web server middleware
- Route API requests to different backends depending on whether the client is a mobile device
- Implement responsive fallbacks or feature gates that depend on device classification
- Track user-agent patterns in legacy systems where device detection is already in place
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects mobile phones and tablets from HTTP user-agent strings and headers, classifying browser types for web applications.
No, unless you are maintaining legacy code already using this package. The library is abandoned (last release 2018-05-10) and user-agent detection patterns will not reflect modern devices. For new projects, choose an actively maintained mobile detection library. If you must use it, accept that device classification accuracy will degrade over time and plan for eventual replacement.
Install
pymobiledetect on PyPI
pip
pip install pymobiledetectuv
uv add pymobiledetectpoetry
poetry add pymobiledetectInstalling pymobiledetect
Before you install
Low install friction with a single lightweight dependency (six), but the package has been abandoned since 2018 with no recent maintenance or commits. Use only if you accept the risk of an unmaintained codebase.
License in practice
Licensed under AGPL, which requires that any modifications or derivative works be distributed under the same license and that source code be made available to users. This is a copyleft license with strong reciprocal obligations; review your project's licensing strategy before adopting.
Quickstart
pip install pymobiledetect
from pymobiledetect import MobileDetect
detect = MobileDetect(user_agent='Mozilla/5.0 (iPhone; CPU iPhone OS')
if detect.is_mobile():
print('Mobile device detected')
Verify before relying
- Whether user-agent detection patterns remain accurate for modern devices and browsers released after 2018
- Compatibility with current Python versions beyond what classifiers declare
- Whether the underlying Mobile-Detect library it wraps has been updated independently
Package facts
| License | AGPL (agpl) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 3,018 days since the last release |
| First released | |
| Downloads | 141,277/month — #11,243 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymobiledetect-1.3.2-py2-none-any.whl; pymobiledetect-1.3.2-py3-none-any.whl
Keywords: mobile, tabled, detect, browser
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
user-agentsParses browser user agent strings to identify…
permissive · top 5,000 on PyPI
django-user-agentsParses HTTP User-Agent headers in Django to…
permissive · top 15,000 on PyPI
device-detectorParses user agent strings and client hints to…
unclear · top 15,000 on PyPI
wootheeWoothee parses user-agent strings to identify…
permissive · top 15,000 on PyPI
ua-parserParses user-agent strings to extract browser,…
permissive · top 1,000 on PyPI
httpagentparserParses HTTP User-Agent strings to extract and…
unclear · top 15,000 on PyPI
browserforgeGenerates realistic browser headers and device…
permissive · top 5,000 on PyPI
user-agentGenerates random, valid web user agent strings…
permissive · top 15,000 on PyPI
fake-useragentGenerates random or browser-specific user-agent…
permissive · top 5,000 on PyPI
random-user-agentProvides random user agent strings filtered by…
permissive · top 15,000 on PyPI