Skip to content

chadsr/iribaker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IRI Baker

Simple library for baking RFC3987 compliant IRIs from IRI-like strings.

Installation

Simply do pip install iribaker

Or, download this package and run python setup.py install

Usage

  • Import the package (import iribaker)
  • Call iribaker.to_iri(string) with the string you want to check (utf-8 and unicode supported)
  • For example: iri = iribaker.to_iri('http://example.com/€eéf')
  • The function returns:
    • The same (unicode) string, if it is a valid IRI
    • A string where each invalid character is replaced with an underscore (_). This means no roundtripping!
    • A quoted version of the string (using the standard urllib.quote)

License

This software is made available under the MIT license (see LICENSE for details)

About

Safely convert IRI-like string to IRI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%