Python 3 library to parse User-Agent strings and detect browser, OS and device details
Project description
⭐ If you find this project useful, please star it on GitHub!
Python User Agent Parser
user_agent_parser is a Python 3 library that provides an easy way to identify/detect devices from user agent string
- User agent is a mobile or computer
- User agent Browser name and versions
- User agent Device name
user_agent_parser hosted on PyPI and can be installed as such:
pip install install user-agent-parser
Alternatively, you can also get the latest source code from Github and install it manually.
from user_agent_parser import Parser
iphone_ua_str = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/92.0.4515.90 Mobile/15E148 Safari/604.1"
parser = Parser(iphone_ua_str)
# Calling parser
browser, browser_version, os, os_version, device_type, device_name, device_host = parser()
# or you can call directly properties
parser.device_name
Running Tests
python -m unittest discover
Changelog
Version 0.1.1
- Doc added
Version 0.1
- Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file user_agent_parser-0.1.6.tar.gz.
File metadata
- Download URL: user_agent_parser-0.1.6.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7dccab408e4e375e265df7ddd56fb07c41e2c04469fd7454849f4d10282c656
|
|
| MD5 |
5d82805cc143f3888bef7076e8a7aadb
|
|
| BLAKE2b-256 |
ad4ad9849ab469efdaf85aec74cbf5c4423475db8d77ecb84d6c6f385a5324ba
|
File details
Details for the file user_agent_parser-0.1.6-py3-none-any.whl.
File metadata
- Download URL: user_agent_parser-0.1.6-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6941990daa4e30d08e06b5f3bfacf4f73d7e6c65126f9de86fe454b873ec7f6
|
|
| MD5 |
541778b90d861ca335b50c5b419c0d5d
|
|
| BLAKE2b-256 |
c36e4de80520e794b6dda9543c28f44c0e6fb1eb6af89c670621db32cc331a37
|