urlparse3
Urlparse3 is simple and powerful url parsing tool. Example:
import urlparse3
url = 'http://admin:secret@local-domain.com:8000/path?q=123#anchor'
parsed_url = urlparse3.parse_url(url)
print parsed_url.scheme # http
print parsed_url.username # admin
print parsed_url.password # secret
print parsed_url.domain # domain.com
print parsed_url.port # 8000
print parsed_url.path # path
# query is converted into dictionary
print parsed_url.query # {'q': '123'}
print parsed_url.fragment # anchor
# now add new GET parameter
parsed_url.query['name'] = 'alex'
# and get url back to string representation
print parsed_url.geturl() #
http://admin:secret@local-domain.com:8000/path?q=123&name=alex#anchor
Changes:
Version 1.0.4. Fix parsing url path with slashes
Version 1.0.5. Fix parsing url query with slashes
Version 1.0.6. Fix urls with port. Add port property to ParsedUrl. Add test for check url with ports.
Version 1.0.7. Fix urls with dashes. Add test.
Version 1.0.8. Fix queries with dashes.
Version 1.0.9. Fix queries with “@” and “+” symbols.
Version 1.0.10. Fix url fragment regexp.
Version 1.1. Query parameters retain the order in which they were added.
Release files for urlparse3 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| urlparse3-1.1.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| urlparse3-1.1.linux-x86_64.tar.gz | Details |
Total release size: 10.9 kB
Release files / urlparse3-1.1.tar.gz
| Download URL | urlparse3-1.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e2989f3ba54723d9c6607e72a71100b9b6d6efaacb0800480e6b7ef5f5ff5d0
|
|
BLAKE2b-256 checksum How to use checksums |
100e7645258aada05f6145ff60ee4d117d06400afea1039d3d15a18b71a06176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / urlparse3-1.1.linux-x86_64.tar.gz
| Download URL | urlparse3-1.1.linux-x86_64.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a50a8f5bcb3a2b828e4316479db39daac59a9e05c31a57627ab2c90a9c2b3a43
|
|
BLAKE2b-256 checksum How to use checksums |
f834211c6737a02bac2ac203c8c31120ba939cab5fb41f33e304dc6669e2d405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |