Skip to main content

miniuri is a universal URI parser class.

Only 150 lines of Python (486 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniuri-1.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miniuri-1.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file miniuri-1.2.0.tar.gz.

File metadata

  • Download URL: miniuri-1.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for miniuri-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7d93b4996fa8f46e111f132ce082ed965b574d00135c010e69b8572245576b9b
MD5 0ca02c68fd5d15c8781ae99550fb7689
BLAKE2b-256 4d574141542143598169061e808f2d72eae945da9014310a60db877a3c46903d

See more details on using hashes here.

File details

Details for the file miniuri-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: miniuri-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for miniuri-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13e2591608557b0008ffe026ae344c10c0eb50cc15430884f6d0294c44365a3c
MD5 4bdc943f1558047c02f99e8dc24caaab
BLAKE2b-256 97cdcdca0d769f771eb3c6293d6cda04d57576f1dd872aceec2969af2be92181

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.0

1 file

1.0.9

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.2

2 files

0.0.1

2 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