skillfed

pymobiledetect

Detect mobile and tablet browsers

pymobiledetect v1.3.2 141.3K downloads/30d#11,243 on PyPI
AGPL license AGPL Abandoned released

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 pymobiledetect

uv

uv add pymobiledetect

poetry

poetry add pymobiledetect

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)Programming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: WSGI :: MiddlewareTopic :: Software Development :: Libraries

Tags

mobile device detectionuser agent parsingdetect mobile browsertablet detectionmobile phone identifieruser agent classifierbrowser type detection
abandoneduser-agent-parsing

More Libraries packages