Skip to main content

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

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

Metadata

Release files for miniuri 1.0.4

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.4
File Size Uploaded
miniuri-1.0.4.tar.gz 3.0 kB Details

Built distribution (wheel)

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

Total release size: 8.2 kB

Release files / miniuri-1.0.4.tar.gz

Download URL miniuri-1.0.4.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
95e987e150cad0f7353dea5141be588b26114bc9e9923e2882530fafa0846b2c
BLAKE2b-256 checksum
How to use checksums
5c6b49654ce96066f4eb7e058fd28008d43d917272897085db46541551faac05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL miniuri-1.0.4-py2.7.egg
Size 5.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
7a967a5946c9b3b8310ce16c8bb78278b2b9cecaf160c0a072266f7718221ab2
BLAKE2b-256 checksum
How to use checksums
f734b4e4a10d4c4b1426b51272cdf5c29e3dead059f6e9e7f49256efdb04cd06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

1 release file

1.0.9

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

This release

1.0.4 This release

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