Skip to main content

miniuri

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

https://bitbucket.org/russellballestrini/miniuri/overview

Metadata

Release files for miniuri 1.0.7

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.7
File Size Uploaded Provenance Actions
miniuri-1.0.7.tar.gz 3.1 kB Without provenance Details for miniuri-1.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for miniuri 1.0.7
File Interpreter ABI Platform Actions
miniuri-1.0.7-py2.7.egg Legacy Egg format - - Details for miniuri-1.0.7-py2.7.egg

Total release size: 8.5 kB

Release files / miniuri-1.0.7.tar.gz

Download URL miniuri-1.0.7.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9f60da7370d32f835cf61061b2120a2b457942acc4053db4928c8059845daca6
BLAKE2b-256 checksum
How to use checksums
b2afdabca5281ceb564c0356346b59c46cf93a5aac9cfc93cb6e961ccbfd4004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release files / miniuri-1.0.7-py2.7.egg

Download URL miniuri-1.0.7-py2.7.egg
Size 5.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
1c83cbd895f2db18741a0162cb58337160a615124417a17a223301f00f9286b1
BLAKE2b-256 checksum
How to use checksums
93f7e96d4216a934450b877d61c17fe678d54369c91c8a3813925a79c80986c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for miniuri 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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