1.0 Documentation

Jabber IDs (JID)

«  Exceptions   ::   Contents   ::   Stanza Objects  »

Jabber IDs (JID)

class sleekxmpp.xmlstream.jid.JID(jid=None, **kwargs)

A representation of a Jabber ID, or JID.

Each JID may have three components: a user, a domain, and an optional resource. For example: user@domain/resource

When a resource is not used, the JID is called a bare JID. The JID is a full JID otherwise.

JID Properties:
jid:Alias for full.
full:The string value of the full JID.
bare:The string value of the bare JID.
user:The username portion of the JID.
username:Alias for user.
local:Alias for user.
node:Alias for user.
domain:The domain name portion of the JID.
server:Alias for domain.
host:Alias for domain.
resource:The resource portion of the JID.
Parameters:
  • jid (string) – A string of the form '[user@]domain[/resource]'.
  • local (string) – Optional. Specify the local, or username, portion of the JID. If provided, it will override the local value provided by the jid parameter. The given local value will also be escaped if necessary.
  • domain (string) – Optional. Specify the domain of the JID. If provided, it will override the domain given by the jid parameter.
  • resource (string) – Optional. Specify the resource value of the JID. If provided, it will override the domain given by the jid parameter.
Raises InvalidJID:
 

regenerate()

No-op

Deprecated since version 1.1.10.

reset(data)

Start fresh from a new JID string.

Parameters:data (string) – A string of the form '[user@]domain[/resource]'.

Deprecated since version 1.1.10.

unescape()

Return an unescaped JID object.

Using an unescaped JID is preferred for displaying JIDs to humans, and they should NOT be used for any other purposes than for presentation.

Returns:UnescapedJID

New in version 1.1.10.

«  Exceptions   ::   Contents   ::   Stanza Objects  »