device-detector
Python3 port of matomo's Device Detector
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
(unclear) — 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.
last release 2026-08-11 (3 days) · last repo commit 2026-08-11 · 148 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 251,566 downloads/mo, #8,576 on PyPI
Alternatives
Verify before relying
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- 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.
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 on this page. Verify before relying on it.
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
device-detector on PyPI
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 the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesahocorasick-rsregexyaml-rsbackports.strenumtyping_extensions |
| Maintenance | Actively maintained 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 251,566 / month, #8,576 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules |
Evidence: device_detector-6.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “device detection”
- device-detectorParses user agent strings and client hints to detect the browser,…
- user-agentsParses browser user agent strings to identify device type (mobile,…
- pymobiledetectDetects mobile phones and tablets from HTTP user-agent strings and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also crawlerdetect · user-agents · httpagentparser · ua-parser · pymobiledetect · django-user-agents · ua-generator · browserforge · play-scraper · Adafruit-PlatformDetect