Extracts OS Browser etc information from http user agent string
Project description
Features
Works on Python 2.5+ and Python 3
Fast
Detects OS and Browser. Does not aim to be a full featured agent parser
Usage
>>> import httpagentparser >>> s = "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11 Safari/532.9" >>> print httpagentparser.simple_detect(s) ('Linux', 'Chrome 5.0.307.11') >>> print httpagentparser.detect(s) {'os': {'name': 'Linux'}, 'browser': {'version': '5.0.307.11', 'name': 'Chrome'}} >>> s = "Mozilla/5.0 (Linux; U; Android 2.3.5; en-in; HTC_DesireS_S510e Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" >>> print httpagentparser.simple_detect(s) ('Android Linux 2.3.5', 'Safari 4.0') >>> print httpagentparser.detect(s) {'dist': {'version': '2.3.5', 'name': 'Android'}, 'os': {'name': 'Linux'}, 'browser': {'version': '4.0', 'name': 'Safari'}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
httpagentparser-1.1.3.tar.gz
(3.9 kB
view details)
File details
Details for the file httpagentparser-1.1.3.tar.gz
.
File metadata
- Download URL: httpagentparser-1.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7984be73ae1d2dde7cb280ff9b3cf404a2872e9b71efe793db22784e49c84b |
|
MD5 | 4ca53fa8e14e410bfa1a087acc6cba55 |
|
BLAKE2b-256 | f84e1ae3404d83de38196f4f0d56f86568bde544a8ec06e820bce39e5c834a5e |