@@ -10,40 +10,34 @@ Build Status
1010.. image :: https://github.com/ua-parser/uap-python/actions/workflows/ci.yml/badge.svg
1111 :alt: CI on the master branch
1212
13- ⚠️ THIS IS NOT THE DOCUMENTATION YOU ARE LOOKING FOR (probably) ⚠️
14- ------------------------------------------------------------------
15-
16- This is the readme for the `future 1.0 <https://github.com/ua-
17- parser/uap-python/milestone/1> `_.
18-
19- For the current releases, see `the 0.x branch
20- <https://github.com/ua-parser/uap-python/tree/0.x#uap- python> `_.
21-
2213Installing
2314----------
2415
25- Just add ``ua-parser `` to your project's dependencies, or run
16+ Add ``ua-parser[regex] `` to your project's dependencies, or run
2617
2718.. code-block :: sh
2819
29- $ pip install ua-parser
20+ $ pip install ' ua-parser[regex] '
3021
3122 to install in the current environment.
3223
33- Installing `ua-parser-rs <https://pypi.org/project/ua-parser-rs >`_ or
34- `google-re2 <https://pypi.org/project/google-re2/ >`_ is *strongly *
35- recommended as they yield *significantly * better performances. This
36- can be done directly via the ``regex `` and ``re2 `` optional
37- dependencies respectively:
24+ ua-parser supports CPython 3.9 and newer, recent pypy (supporting
25+ 3.10), and GraalPy 24.
3826
39- .. code-block :: sh
27+ .. note ::
28+
29+ The ``[regex] `` feature is *strongly * recommended:
4030
41- $ pip install ' ua_parser[regex]'
42- $ pip install ' ua_parser[re2]'
31+ - ``[re2] `` is slightly slower and only works with cpython, though
32+ it is still a great option then (and is more memory-efficient).
33+ - Pure python (no feature) is *significantly * slower, especially on
34+ non-cpython runtimes, but it is the most memory efficient even
35+ with caches.
4336
44- If either dependency is already available (e.g. because the software
45- makes use of re2 for other reasons) ``ua-parser `` will use the
46- corresponding resolver automatically.
37+ See `builtin resolvers `_ for more explanation of the tradeoffs
38+ between the different options.
39+
40+ .. _builtin resolvers : https://readthedocs.org/ua-parser/uap-python/guides#builtin-resolvers
4741
4842Quick Start
4943-----------
@@ -109,3 +103,10 @@ Extract device information from user-agent string
109103 >> > 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'
110104 >> > parse_device(ua_string)
111105 Device(family = ' Mac' , brand = ' Apple' , model = ' Mac' )
106+
107+ Upgrading
108+ -------- -
109+
110+ Upgrading from 0. x? See `the upgrade guide` _.
111+
112+ .. _the upgrade guide: https:// readthedocs.org/ ua- parser/ uap- python/ advanced/ migration
0 commit comments