11Python User Agents
22==================
33
4- `user_agents ` is a Python library that provides an easy way to identify devices like mobile phones,
4+ `` user_agents ` ` is a Python library that provides an easy way to identify devices like mobile phones,
55tablets and their capabilities by parsing (browser) user agent strings. The goal is to reliably
66detect whether:
77
88* User agent is a mobile, tablet or PC based device
99* User agent has touch capabilities (has touch screen)
1010
11- `user_agents ` relies on the excellent `ua-parser <https://github.com/tobie/ua-parser >`_ to do the
11+ `` user_agents ` ` relies on the excellent `ua-parser <https://github.com/tobie/ua-parser >`_ to do the
1212actual parsing of the raw user agent string.
1313
1414This library should be considered "alpha". Please post feature suggestions, bug or pull requests to
@@ -18,7 +18,10 @@ identify more devices on Github.
1818Installation
1919============
2020
21- WARNING: This library should be considered "alpha". Use this in production at your own risk.
21+ WARNING: This library should be considered "alpha". Use this in production at your own risk.
22+ ``user-agents `` is hosted on `PyPI <http://pypi.python.org/pypi/user-agents/ >`_ and can be installed as such::
23+
24+ pip install pyyaml ua-parser user-agents
2225
2326Usage
2427=====
@@ -50,16 +53,16 @@ and `os` attributes. For example:
5053 user_agent.device.family # returns 'iPhone'
5154
5255
53- `user_agents ` also expose a few other more "sophisticated" attributes that are derived from one or
56+ `` user_agents ` ` also expose a few other more "sophisticated" attributes that are derived from one or
5457more basic attributes defined above. As for now, these attributes should correctly identify
5558popular platforms/devices, pull requests to support smaller ones are always welcome.
5659
5760Currently these attributes are supported:
5861
59- * `is_mobile ` - whether user agent is identified as a mobile phone (iPhone, Android phones, Blackberry, Windows Phone devices etc)
60- * `is_tablet ` - whether user agent is identified as a tablet device (iPad, Kindle Fire, Nexus 7 etc)
61- * `is_pc ` - whether user agent is identified to be running a traditional "desktop" OS (Windows, OS X, Linux)
62- * `is_touch_capable ` - whether user agent has touch capabilities
62+ * `` is_mobile ``: whether user agent is identified as a mobile phone (iPhone, Android phones, Blackberry, Windows Phone devices etc)
63+ * `` is_tablet ``: whether user agent is identified as a tablet device (iPad, Kindle Fire, Nexus 7 etc)
64+ * `` is_pc ``: whether user agent is identified to be running a traditional "desktop" OS (Windows, OS X, Linux)
65+ * `` is_touch_capable ``: whether user agent has touch capabilities
6366
6467
6568For example:
0 commit comments