Skip to main content

Extracts OS Browser etc information from http user agent string

Project description

>>> 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.detect(s)
('Android Linux 2.3.5', 'Safari 4.0')
>>> print httpagentparser.simple_detect(s)
{'dist': {'version': '2.3.5', 'name': 'Android'}, 'os': {'name': 'Linux'}, 'browser': {'version': '4.0', 'name': 'Safari'}}

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

httpagentparser-1.0.5.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file httpagentparser-1.0.5.tar.gz.

File metadata

File hashes

Hashes for httpagentparser-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b1a69d4444debb5deb5ca78c90e4f1955215c89aea9b7ef9c28b94ca09294bf2
MD5 e3ef2ad23db4458d935eb2808ce12346
BLAKE2b-256 08ecfc83ff4eaf34cc9a2e70f895da45caf5440a1be74621f55a80a287868094

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page