Installation¶
Installation¶
- target:
- alt:
Documentation Status
Installing¶
Add ua-parser[regex] to your project’s dependencies, or run
$ pip install 'ua-parser[regex]'
to install in the current environment.
ua-parser supports CPython 3.9 and newer, recent pypy (supporting 3.10), and GraalPy 24.
Note
The [regex] feature is strongly recommended:
[re2]is slightly slower and only works with cpython, though it is still a great option then (and is more memory-efficient).Pure python (no feature) is significantly slower, especially on non-cpython runtimes, but it is the most memory efficient even with caches.
See builtin resolvers for more explanation of the tradeoffs between the different options.
Optional Dependencies¶
ua-parser currently has three optional dependencies, regex, google-re2 and
PyYaml. These dependencies will be detected and used augitomatically
if installed, but can also be installed via and alongside ua-parser:
$ pip install 'ua-parser[regex]'
$ pip install 'ua-parser[re2]'
$ pip install 'ua-parser[yaml]'
$ pip install 'ua-parser[regex,yaml]'
yaml enables the ability to load rulesets from yaml.
The other two features enable more efficient resolvers. By default,
ua-parser will select the fastest resolver it finds out of the
available set (regex > re2 > python).