--- id: device-detector version: "6.4.0" license: unclear license_treatment: unclear maintenance: active --- # device-detector — Python3 port of matomo's Device Detector License: unclear · Maintenance: active · Downloads: 251.6K/mo ## What it is and what it does DeviceDetector is a Python user agent parser that identifies browsers, operating systems, device types (desktop, mobile, tablet, TV, console, etc.), and hardware brands and models from HTTP user agent strings and client hints. It is a port of the Matomo Universal Device Detection library and uses the same regex YAML database, so it benefits from updates to the original project. The package is optimized for speed through in-memory caching and provides both a full DeviceDetector class for comprehensive detection and a lighter SoftwareDetector class for OS and browser extraction only. The package depends on ahocorasick-rs, regex, yaml-rs, backports.strenum, and typing_extensions. It supports Python 3.10 and later and is actively maintained with recent releases. The main caveat is that the license treatment is unclear—no SPDX identifier or license text is declared in the package metadata. Use it for: - Classify incoming HTTP requests by device type to serve responsive or device-specific content. - Detect bot traffic using the is_bot() method to filter automated requests from analytics or logs. - Extract browser and OS details from user agent strings for analytics, logging, or compatibility checks. - Parse client hints headers to identify the application or browser making requests, especially for mobile apps. - Build device-aware feature flags or A/B tests by detecting hardware brand, model, or OS version. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses user agent strings and client hints to detect the browser, operating system, device type, brand, and model of client requests. Yes, with a caveat on license clarity. The package is actively maintained, has low install friction, supports Python 3.10–3.14, and solves a real problem. However, verify the actual license in the repository before use in proprietary or restricted-license contexts, since the package metadata declares no license. ## Install pip install device-detector uv add device-detector poetry add device-detector ## Installing device-detector Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release and steady commit activity. Supports Python 3.10 through 3.14. License in practice: License status is unclear; the package declares no SPDX identifier or raw license text in its metadata. Verify the actual license terms in the repository before use in proprietary or restricted contexts. Quickstart: from device_detector import DeviceDetector ua = 'Mozilla/5.0 (Linux; Android 4.3; C5502 Build/10.4.1.B.0.101) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.136 Mobile Safari/537.36' device = DeviceDetector(ua).parse() print(device.device_brand()) # Sony print(device.device_type()) # smartphone Verify before relying: - Whether the package's actual license (if any) is permissive or restrictive—metadata shows no license declaration. - Performance characteristics and detection accuracy compared to the original Matomo library. - Whether the in-memory caching mentioned in the description is configurable or automatic. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 251.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags user agent parser, device detection, browser detection, client hints parsing, device type classifier, mobile vs desktop detection, operating system detection, user-agent-parsing, device-classification [View on SkillFed](https://skillfed.io/packages/device-detector) · [View on PyPI](https://pypi.org/project/device-detector/)