miniuri
miniuri is a universal URI parser class.
It is written in 128 lines of Python.
Installation
pip install miniuri
What does it do?
The parser grants access to the following attributes:
foo://username:password@test.com:808/go/to/index.php?pet=cat&name=bam#eye
\_/ \_______________/ \______/ \_/ \___/ \_/ \_______________/\_/
| | | | | | | |
| userinfo hostname | | | query fragment
| \___________________________|/\________|____|_/
| | | | | |
scheme authority | path | extension
| |
port filename
Tutorial
This example shows how you can set and get any of the URI attributes:
>>> from miniuri import Uri
>>> u = Uri( "http://www.foxhop.net/samsung/HL-T5087SA/red-LED-failure" )
>>> u.uri = "https://fox:pass@www.foxhop.net:81/path/filename.jpg?p=2#5"
>>> print(u.uri)
'https://fox:pass@www.foxhop.net:81/path/filename.jpg?p=2#5'
>>> print(u.hostname)
'www.foxhop.net'
>>> print(u.scheme)
'https'
>>> u.username = 'max'
>>> print(u)
'https://max:pass@www.foxhop.net:81/path/filename.jpg?p=2#5'
>>> print(u.relative_uri)
'/path/filename.jpg?p=2#5'
How do I thank you?
You should follow me on http://twitter.com/russellbal
License
Public Domain
Public Revision Control
Metadata
Release files for miniuri 1.0.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 | |
|---|---|---|---|
| miniuri-1.0.5.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| miniuri-1.0.5-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 8.2 kB
Release files / miniuri-1.0.5.tar.gz
| Download URL | miniuri-1.0.5.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8374e85a84aa43abe74c03c51fcd7b1f8d4d2974db56fc4f209d403e16fd830e
|
|
BLAKE2b-256 checksum How to use checksums |
62f8174e8cb4d7b4f37429c2852a4df548ce3a4f8868ec8f5869e22e4f4774ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / miniuri-1.0.5-py2.7.egg
| Download URL | miniuri-1.0.5-py2.7.egg |
|---|---|
| Size | 5.2 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
2b7c38706b1c0a5eb37ea11b3fa96189409560c6bc0240c09b27d62ec418cfe8
|
|
BLAKE2b-256 checksum How to use checksums |
f7be553863f8261fbc6f210c279dede39cf583a161d45da5d55aa968c8bb6bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |