No project description provided
Project description
irl
irl
is a URL parser library that has a mixture of very strict rules around
a URL's host and port section but very relaxed in all other sections making it
the ideal balance of secure, tolerant, and performant.
It's primary use-case is for being used in HTTP client libraries as they have to deal with the Internet and lots URLs that are definitely not compliant but users expect them to work anyways!
Installation
Supports Python 3.6 or later.
python -m pip install irl
Usage
>>> import irl
>>> url = irl.URL.parse("https://user:pass@example.com:1234/path?q=ue&r=&y#frag")
>>> print(repr(url))
URL(scheme="https", userinfo="user:pass", host="example.com", port=1234, path="/path", query="q=ue&r=&y", fragment="frag")
>>> url.target()
b"/path?qu=e&r=&y"
>>> url.host_header()
b"example.com:1234"
>>> url.query_to_items()
[("q", "ue"), ("r", ""), ("y", None)
>>> url.address()
("example.com", 1234)
Standards Implemented
Acknowledgements
This URL parser library wouldn't be possible without the rfc3986 library or the test suite from urllib3. This parser is based heavily on techniques used in both libraries and they directly inspired this libraries creation.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file irl-0.2.tar.gz
.
File metadata
- Download URL: irl-0.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cad62a72ac5869f6d93d715526b6edf4debc117bc2d0964ed33bd35c12e0413 |
|
MD5 | e6e2f4b94589ba4274ee35a83a7febab |
|
BLAKE2b-256 | df8a52ca4930681e43c9cfdb4a4de3c29537a804aa322b94026bd6f9b5c63842 |
File details
Details for the file irl-0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: irl-0.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4ecfbcb371784f4539710916eebb9888c76154cdcf6b9ae6cd5a8ac419ce22a |
|
MD5 | 68a23afa7303bdd15813296bcb31d4ca |
|
BLAKE2b-256 | efab033187a7ef9658d9e23618ad0a1eba23057c08c5ec392f8576e4f9482015 |