Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

miniuri: The Universal URI Parser

Project Description

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

Release History

Release History

This version
History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
miniuri-1.0.5-py2.7.egg (5.2 kB) Copy SHA256 Checksum SHA256 2.7 Egg Dec 10, 2017
miniuri-1.0.5.tar.gz (3.0 kB) Copy SHA256 Checksum SHA256 Source Dec 10, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting