Features
- Fast
- Detects OS and Browser. Does not aim to be a full featured agent parser
- Will not turn into django-httpagentparser ;)
Usage
>>> import httpagentparser
>>> s = "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) \
Chrome/5.0.307.11 Safari/532.9"
>>> print(httpagentparser.simple_detect(s))
('Linux', 'Chrome 5.0.307.11')
>>> print(httpagentparser.detect(s))
{'os': {'name': 'Linux'},
'browser': {'version': '5.0.307.11', 'name': 'Chrome'}}
>>> s = "Mozilla/5.0 (Linux; U; Android 2.3.5; en-in; HTC_DesireS_S510e Build/GRJ90) \
AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
>>> print(httpagentparser.simple_detect(s))
('Android Linux 2.3.5', 'Safari 4.0')
>>> print(httpagentparser.detect(s))
{'dist': {'version': '2.3.5', 'name': 'Android'},
'os': {'name': 'Linux'},
'browser': {'version': '4.0', 'name': 'Safari'}}
History
http://stackoverflow.com/questions/927552/parsing-http-user-agent-string/1151956#1151956
Metadata
Release files for httpagentparser 1.9.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| httpagentparser-1.9.9.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| httpagentparser-1.9.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / httpagentparser-1.9.9.tar.gz
| Download URL | httpagentparser-1.9.9.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23bcaf09325b17af7634283ca64da23f485c5d83b9481ff6d88413a7c5bc6de9
|
|
BLAKE2b-256 checksum How to use checksums |
f844028b51ff3a2a5c67af2ea929ead36f2d90e9efda1932ff4e45a36aae58eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / httpagentparser-1.9.9-py3-none-any.whl
| Download URL | httpagentparser-1.9.9-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
755898cc96e796f6bf5327b604a81502622fd00637ef319af133a6ffd1a3e753
|
|
BLAKE2b-256 checksum How to use checksums |
95ca50ca912f58807e14b6e993d1b75d2a951e014ed82fe42779947ca3e6a159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for httpagentparser 1.9.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.