ua
User-Agent parsing and creation
Installation
pip install ua
Usage
>>> import ua
Parsing
>>> user_agent = ua.parse('Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0')
>>>
>>> user_agent
UserAgent(
products=[
Product(name='Mozilla', version='5.0', comments=['X11', 'Linux x86_64', 'rv:88.0']),
Product(name='Gecko', version='20100101', comments=[]),
Product(name='Firefox', version='88.0', comments=[])
]
)
>>>
>>> str(user_agent)
'Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0'
Creation
>>> user_agent = ua.UserAgent(
products=[
ua.Product(
name='SomeProduct',
version='1.0',
comments=['SomeComment']
)
]
)
>>>
>>> str(user_agent)
'SomeProduct/1.0 (SomeComment)'
References
Metadata
Release files for ua 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ua-0.1.5.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ua-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / ua-0.1.5.tar.gz
| Download URL | ua-0.1.5.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01bda1d1ae3b9c90e693bb18fb72c8a513aff5c7c9009f03b5a997512beaae62
|
|
BLAKE2b-256 checksum How to use checksums |
a8ffe1d26615c067115ac61c31561142fb7bdb66c9cc2e8fd1cc15143efecf0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.8.10 Linux/5.4.0-100-generic
|
Release files / ua-0.1.5-py3-none-any.whl
| Download URL | ua-0.1.5-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d67cf3a8f63e62f34b912d456d27fbfaa691b3ec34fab78da66ce9050b9ca4e
|
|
BLAKE2b-256 checksum How to use checksums |
a6759890872c0f3c4fb1fccbbe595e2b7c05d8ce5bb07457730533e6d77c7016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.8.10 Linux/5.4.0-100-generic
|