-
Notifications
You must be signed in to change notification settings - Fork 158
Convert README to rst #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include README.md | ||
include README.rst | ||
global-exclude *~ |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
uap-python | ||
========== | ||
|
||
A python implementation of the UA Parser (https://github.com/ua-parser, | ||
formerly https://github.com/tobie/ua-parser) | ||
|
||
Build Status | ||
------------ | ||
|
||
.. image:: https://travis-ci.org/ua-parser/uap-python.svg | ||
:target: https://travis-ci.org/ua-parser/uap-python | ||
|
||
Installing | ||
---------- | ||
|
||
Install via pip | ||
~~~~~~~~~~~~~~~ | ||
|
||
Just run: | ||
|
||
.. code-block:: sh | ||
|
||
$ pip install ua-parser | ||
|
||
Manual install | ||
~~~~~~~~~~~~~~ | ||
|
||
In the top-level directory run: | ||
|
||
.. code-block:: sh | ||
|
||
$ python setup.py install | ||
|
||
Getting Started | ||
--------------- | ||
|
||
Retrieve data on a user-agent string | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code-block:: python | ||
|
||
>>> from ua_parser import user_agent_parser | ||
>>> import pprint | ||
>>> pp = pprint.PrettyPrinter(indent=4) | ||
>>> ua_string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36' | ||
>>> parsed_string = user_agent_parser.Parse(ua_string) | ||
>>> pp.pprint(parsed_string) | ||
{ 'device': { 'brand': None, 'family': 'Other', 'model': None}, | ||
'os': { 'family': 'Mac OS X', | ||
'major': '10', | ||
'minor': '9', | ||
'patch': '4', | ||
'patch_minor': None}, | ||
'string': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36', | ||
'user_agent': { 'family': 'Chrome', | ||
'major': '41', | ||
'minor': '0', | ||
'patch': '2272'}} | ||
|
||
Extract browser data from user-agent string | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code-block:: python | ||
|
||
>>> from ua_parser import user_agent_parser | ||
>>> import pprint | ||
>>> pp = pprint.PrettyPrinter(indent=4) | ||
>>> ua_string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36' | ||
>>> parsed_string = user_agent_parser.ParseUserAgent(ua_string) | ||
>>> pp.pprint(parsed_string) | ||
{ 'family': 'Chrome', | ||
'major': '41', | ||
'minor': '0', | ||
'patch': '2272'} | ||
|
||
Extract OS information from user-agent string | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code-block:: python | ||
|
||
>>> from ua_parser import user_agent_parser | ||
>>> import pprint | ||
>>> pp = pprint.PrettyPrinter(indent=4) | ||
>>> ua_string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36' | ||
>>> parsed_string = user_agent_parser.ParseOS(ua_string) | ||
>>> pp.pprint(parsed_string) | ||
{ 'family': 'Mac OS X', | ||
'major': '10', | ||
'minor': '9', | ||
'patch': '4', | ||
'patch_minor': None} | ||
|
||
Extract Device information from user-agent string | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code-block:: python | ||
|
||
>>> from ua_parser import user_agent_parser | ||
>>> import pprint | ||
>>> pp = pprint.PrettyPrinter(indent=4) | ||
>>> ua_string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36' | ||
>>> parsed_string = user_agent_parser.ParseDevice(ua_string) | ||
>>> pp.pprint(parsed_string) | ||
{ 'brand': None, | ||
'family': 'Other', | ||
'model': None} | ||
|
||
Copyright | ||
--------- | ||
|
||
Copyright 2008 Google Inc. See ua\_parser/LICENSE for more information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
[tox] | ||
envlist = py26, py27, pypy, py31, py32, py33, py34, py35, docs, pep8, py3pep8 | ||
envlist = py26, py27, pypy, py31, py32, py33, py34, py35, docs | ||
|
||
[testenv] | ||
deps = | ||
pyyaml | ||
commands = | ||
python setup.py develop | ||
python ua_parser/user_agent_parser_test.py | ||
|
||
[testenv:docs] | ||
deps = docutils | ||
Pygments | ||
commands = | ||
python setup.py check -s --restructuredtext --metadata |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove these? This is breaking CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because they don't have any
testenv
defined intox.ini
so they just rerun the testsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed from
.travis.yml