Skip to main content

miniuri is a universal URI parser class.

Only 145 lines of Python (400 lines if you count unit tests).

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.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miniuri 1.0.9
File Size Uploaded
miniuri-1.0.9.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for miniuri 1.0.9
File Interpreter ABI Platform
miniuri-1.0.9-py3.10.egg Legacy Egg format - - Details

Total release size: 14.3 kB

Release files / miniuri-1.0.9.tar.gz

Download URL miniuri-1.0.9.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c56b6ec0a12176bd070e9a5b00a857a475f52c1b77b0c04fe0e62f647b0b7faa
BLAKE2b-256 checksum
How to use checksums
8703a5068ca652cd3b5074dd5bc5476d9e99d4b3016694e1b3c2e3a326481278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / miniuri-1.0.9-py3.10.egg

Download URL miniuri-1.0.9-py3.10.egg
Size 9.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
058b49cc5d15a01c39d5c86815d4436c6b359f839424ccdccb2912b47fccb408
BLAKE2b-256 checksum
How to use checksums
24e8be3cb1d3993ee86a9168ee4c4145cd52d5f1d94c4feba0220be27560fe27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

1 release file

This release

1.0.9 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page