File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ A python implementation of the UA Parser (https://github.com/ua-parser, formerly
7
7
8
8
##Installing
9
9
10
+ ### Install via pip
11
+ Just run:
12
+ ```
13
+ $ pip install ua-parse
14
+ ```
15
+
16
+ ### Manual install
10
17
In the top-level directory run:
11
18
```
12
19
$ make
16
23
17
24
### retrieve data on a user-agent string
18
25
```
19
- >>> import user_agent_parser
26
+ >>> from ua_parser import user_agent_parser
20
27
>>> import pprint
21
28
>>> pp = pprint.PrettyPrinter(indent=4)
22
29
>>> 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'
39
46
### extract browser data from user-agent string
40
47
41
48
```
42
- >>> import user_agent_parser
49
+ >>> from ua_parser import user_agent_parser
43
50
>>> import pprint
44
51
>>> pp = pprint.PrettyPrinter(indent=4)
45
52
>>> 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'
54
61
### extract OS information from user-agent string
55
62
56
63
```
57
- >>> import user_agent_parser
64
+ >>> from ua_parser import user_agent_parser
58
65
>>> import pprint
59
66
>>> pp = pprint.PrettyPrinter(indent=4)
60
67
>>> 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'
71
78
72
79
73
80
```
74
- >>> import user_agent_parser
81
+ >>> from ua_parser import user_agent_parser
75
82
>>> import pprint
76
83
>>> pp = pprint.PrettyPrinter(indent=4)
77
84
>>> 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'
You can’t perform that action at this time.
0 commit comments