Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

krux/python-useragentutils

python-useragentutils

A python port of the user-agent-utils Java library

Installation

pip install useragentutils

Usage

from useragentutils import UserAgent

uaString = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14"

ua = UserAgent(uaString)

browser = ua.browser
print(browser)
print(browser.version(uaString))
print(browser.manufacturer)
print(browser.renderingEngine)
print(browser.browserType)

os = ua.operatingSystem
print(os)
print(os.version(uaString))
print(os.manufacturer)
print(os.deviceType)

Developing

Setup vagrant in the usual way (see: vagrant-setup).

Setup your environment:

cd $PROJECT_DIR
mkvirtualenv python-useragentutils
setvirtualenvproject .
pip install --upgrade pip==1.4.1
pip install -r requirements.pip

Run the tests:

nosetests

Write some code including tests..

Run the tests:

nosetests

File PRs against master w/ a new semantic version. When it merges jenkins will put the package in our pip repo.

About

(obs python2) User agent parser

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages