Package openid :: Package yadis :: Module xri
[frames] | no frames]

Module xri

source code

Utility functions for handling XRIs.


See Also: XRI Syntax v2.0 at the OASIS XRI Technical Committee

Functions
 
identifierScheme(identifier)
Determine if this identifier is an XRI or URI.
source code
 
toIRINormal(xri)
Transform an XRI to IRI-normal form.
source code
 
escapeForIRI(xri)
Escape things that need to be escaped when transforming to an IRI.
source code
 
toURINormal(xri)
Transform an XRI to URI normal form.
source code
 
iriToURI(iri)
Transform an IRI to a URI by escaping unicode.
source code
bool
providerIsAuthoritative(providerID, canonicalID)
Is this provider ID authoritative for this XRI?
source code
unicode
rootAuthority(xri)
Return the root authority for an XRI.
source code
 
XRI(xri)
An XRI object allowing comparison of XRI.
source code
Variables
  XRI_AUTHORITIES = ['!', '=', '@', '+', '$', '(']
  UCSCHAR = [(160, 55295), (63744, 64975), (65008, 65519)]
  IPRIVATE = [(57344, 63743)]
Function Details

identifierScheme(identifier)

source code 

Determine if this identifier is an XRI or URI.

Returns:
"XRI" or "URI"

rootAuthority(xri)

source code 

Return the root authority for an XRI.

Example:

   rootAuthority("xri://@example") == "xri://@"
Parameters:
  • xri (unicode)
Returns: unicode

XRI(xri)

source code 

An XRI object allowing comparison of XRI.

Ideally, this would do full normalization and provide comparsion operators as per XRI Syntax. Right now, it just does a bit of canonicalization by ensuring the xri scheme is present.

Parameters:
  • xri (unicode) - an xri string