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

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

Built distribution (wheel)

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

Total release size: 8.4 kB

Release files / miniuri-1.0.6.tar.gz

Download URL miniuri-1.0.6.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6932f57abcab4144c597210fb6b7ba2035eab6c4a02ba0e84c8b2a5c212604d4
BLAKE2b-256 checksum
How to use checksums
db34673d0bdff1c13a48f60b97605a68a96fc05d9fa077005a687fb294f09b11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

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

Download URL miniuri-1.0.6-py2.7.egg
Size 5.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
bf78070cdb97fdaf8438463fde56919d94b96ceff371d3130a7c40f7ec963114
BLAKE2b-256 checksum
How to use checksums
32b59e1e5d5f20974cb62fbd7e9fd0237b70d6a2ae017873516c75d1e01d4885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for miniuri 1.0.6

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