XEP-0292: vCard4 Over XMPP

class slixmpp.plugins.xep_0292.XEP_0292(xmpp, config=None)[source]

vCard4 over XMPP

Does not implement the IQ semantics that neither movim does gajim implement, cf https://xmpp.org/extensions/xep-0292.html#self-iq-retrieval and https://xmpp.org/extensions/xep-0292.html#self-iq-publication

Does not implement the “empty pubsub event item” as a notification mechanism, that neither gajim nor movim implement https://xmpp.org/extensions/xep-0292.html#sect-idm45744791178720

Relies on classic pubsub semantics instead.

dependencies: ClassVar[Set[str]] = {'xep_0030', 'xep_0060', 'xep_0163'}

Some plugins may depend on others in order to function properly. Any plugin names included in dependencies will be initialized as needed if this plugin is enabled.

description: str = 'vCard4 Over XMPP'

A longer name for the plugin, describing its purpose. For example, a plugin for XEP-0030 would use ‘Service Discovery’ as its description value.

name: str = 'xep_0292'

A short name for the plugin based on the implemented specification. For example, a plugin for XEP-0030 would use ‘xep_0030’.

publish_vcard(full_name=None, given=None, surname=None, birthday=None, nickname=None, phone=None, note=None, url=None, email=None, country=None, locality=None, impp=None, **pubsubkwargs)[source]

Publish a vcard using PEP

retrieve_vcard(jid, **pubsubkwargs)[source]

Retrieve a vcard using PEP

session_bind(jid)[source]

Initialize plugin state based on the bound JID.

Stanza elements

class slixmpp.plugins.xep_0292.stanza.Adr(xml=None, parent=None)[source]
interfaces: ClassVar[Set[str]] = {'country', 'locality'}

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'adr'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'adr'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'country', 'locality'}

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0292.stanza.BDay(xml=None, parent=None)[source]
get_date()[source]
interfaces: ClassVar[Set[str]] = {'date'}

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'bday'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'bday'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
set_date(date)[source]
class slixmpp.plugins.xep_0292.stanza.Date(xml=None, parent=None)[source]
name: ClassVar[str] = 'date'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

class slixmpp.plugins.xep_0292.stanza.Email(xml=None, parent=None)[source]
name: ClassVar[str] = 'email'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'email'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.Fn(xml=None, parent=None)[source]
name: ClassVar[str] = 'fn'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'fn'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.Impp(xml=None, parent=None)[source]
name: ClassVar[str] = 'impp'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'impp'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.N(xml=None, parent=None)[source]
interfaces: ClassVar[Set[str]] = {'additional', 'given', 'surname'}

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'n'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'n'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
sub_interfaces: ClassVar[Set[str]] = {'additional', 'given', 'surname'}

A subset of interfaces which maps interfaces to direct subelements of the underlying XML object. Using this set, the text of these subelements may be set, retrieved, or removed without needing to define custom methods.

class slixmpp.plugins.xep_0292.stanza.Nickname(xml=None, parent=None)[source]
name: ClassVar[str] = 'nickname'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'nickname'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.Note(xml=None, parent=None)[source]
name: ClassVar[str] = 'note'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'note'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.Parameters(xml=None, parent=None)[source]
name: ClassVar[str] = 'parameters'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'parameters'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugin_attrib_map: ClassVar[Dict[str, Type[ElementBase]]] = {'type_': <class 'slixmpp.plugins.xep_0292.stanza.Type'>}

A mapping of the plugin_attrib values of registered plugins to their respective classes.

plugin_iterables: ClassVar[Set[Type[ElementBase]]] = {}

The set of stanza classes that can be iterated over using the ‘substanzas’ interface. Classes are added to this set when registering a plugin with iterable=True:

register_stanza_plugin(DiscoInfo, DiscoItem, iterable=True)

Added in version 1.0-Beta5.

plugin_overrides: ClassVar[Dict[str, str]] = {}

A map of interface operations to the overriding functions. For example, after overriding the set operation for the interface body, plugin_overrides would be:

{'set_body': <some function>}
plugin_tag_map: ClassVar[Dict[str, Type[ElementBase]]] = {'{urn:ietf:params:xml:ns:vcard-4.0}type': <class 'slixmpp.plugins.xep_0292.stanza.Type'>}

A mapping of root element tag names (in '{namespace}elementname' format) to the plugin classes responsible for them.

class slixmpp.plugins.xep_0292.stanza.Tel(xml=None, parent=None)[source]
name: ClassVar[str] = 'tel'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'tel'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugin_attrib_map: ClassVar[Dict[str, Type[ElementBase]]] = {'parameters': <class 'slixmpp.plugins.xep_0292.stanza.Parameters'>}

A mapping of the plugin_attrib values of registered plugins to their respective classes.

plugin_iterables: ClassVar[Set[Type[ElementBase]]] = {}

The set of stanza classes that can be iterated over using the ‘substanzas’ interface. Classes are added to this set when registering a plugin with iterable=True:

register_stanza_plugin(DiscoInfo, DiscoItem, iterable=True)

Added in version 1.0-Beta5.

plugin_overrides: ClassVar[Dict[str, str]] = {}

A map of interface operations to the overriding functions. For example, after overriding the set operation for the interface body, plugin_overrides would be:

{'set_body': <some function>}
plugin_tag_map: ClassVar[Dict[str, Type[ElementBase]]] = {'{urn:ietf:params:xml:ns:vcard-4.0}parameters': <class 'slixmpp.plugins.xep_0292.stanza.Parameters'>}

A mapping of root element tag names (in '{namespace}elementname' format) to the plugin classes responsible for them.

class slixmpp.plugins.xep_0292.stanza.Type(xml=None, parent=None)[source]
name: ClassVar[str] = 'type'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'type_'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.Url(xml=None, parent=None)[source]
name: ClassVar[str] = 'url'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'url'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
class slixmpp.plugins.xep_0292.stanza.VCard4(xml=None, parent=None)[source]
add_address(country=None, locality=None)[source]
add_email(email)[source]
add_impp(impp)[source]
add_nickname(nick)[source]
add_note(note)[source]
add_tel(number, name=None)[source]
add_url(url)[source]
get_birthday()[source]
get_full_name()[source]
get_given()[source]
get_surname()[source]
interfaces: ClassVar[Set[str]] = {'birthday', 'full_name', 'given', 'surname'}

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

name: ClassVar[str] = 'vcard'

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

plugin_attrib: ClassVar[str] = 'vcard'

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugin_attrib_map: ClassVar[Dict[str, Type[ElementBase]]] = {'adr': <class 'slixmpp.plugins.xep_0292.stanza.Adr'>, 'bday': <class 'slixmpp.plugins.xep_0292.stanza.BDay'>, 'email': <class 'slixmpp.plugins.xep_0292.stanza.Email'>, 'fn': <class 'slixmpp.plugins.xep_0292.stanza.Fn'>, 'impp': <class 'slixmpp.plugins.xep_0292.stanza.Impp'>, 'n': <class 'slixmpp.plugins.xep_0292.stanza.N'>, 'nickname': <class 'slixmpp.plugins.xep_0292.stanza.Nickname'>, 'note': <class 'slixmpp.plugins.xep_0292.stanza.Note'>, 'tel': <class 'slixmpp.plugins.xep_0292.stanza.Tel'>, 'url': <class 'slixmpp.plugins.xep_0292.stanza.Url'>}

A mapping of the plugin_attrib values of registered plugins to their respective classes.

plugin_iterables: ClassVar[Set[Type[ElementBase]]] = {<class 'slixmpp.plugins.xep_0292.stanza.Adr'>, <class 'slixmpp.plugins.xep_0292.stanza.BDay'>, <class 'slixmpp.plugins.xep_0292.stanza.Email'>, <class 'slixmpp.plugins.xep_0292.stanza.Fn'>, <class 'slixmpp.plugins.xep_0292.stanza.Impp'>, <class 'slixmpp.plugins.xep_0292.stanza.N'>, <class 'slixmpp.plugins.xep_0292.stanza.Nickname'>, <class 'slixmpp.plugins.xep_0292.stanza.Note'>, <class 'slixmpp.plugins.xep_0292.stanza.Tel'>, <class 'slixmpp.plugins.xep_0292.stanza.Url'>}

The set of stanza classes that can be iterated over using the ‘substanzas’ interface. Classes are added to this set when registering a plugin with iterable=True:

register_stanza_plugin(DiscoInfo, DiscoItem, iterable=True)

Added in version 1.0-Beta5.

plugin_overrides: ClassVar[Dict[str, str]] = {}

A map of interface operations to the overriding functions. For example, after overriding the set operation for the interface body, plugin_overrides would be:

{'set_body': <some function>}
plugin_tag_map: ClassVar[Dict[str, Type[ElementBase]]] = {'{urn:ietf:params:xml:ns:vcard-4.0}adr': <class 'slixmpp.plugins.xep_0292.stanza.Adr'>, '{urn:ietf:params:xml:ns:vcard-4.0}bday': <class 'slixmpp.plugins.xep_0292.stanza.BDay'>, '{urn:ietf:params:xml:ns:vcard-4.0}email': <class 'slixmpp.plugins.xep_0292.stanza.Email'>, '{urn:ietf:params:xml:ns:vcard-4.0}fn': <class 'slixmpp.plugins.xep_0292.stanza.Fn'>, '{urn:ietf:params:xml:ns:vcard-4.0}impp': <class 'slixmpp.plugins.xep_0292.stanza.Impp'>, '{urn:ietf:params:xml:ns:vcard-4.0}n': <class 'slixmpp.plugins.xep_0292.stanza.N'>, '{urn:ietf:params:xml:ns:vcard-4.0}nickname': <class 'slixmpp.plugins.xep_0292.stanza.Nickname'>, '{urn:ietf:params:xml:ns:vcard-4.0}note': <class 'slixmpp.plugins.xep_0292.stanza.Note'>, '{urn:ietf:params:xml:ns:vcard-4.0}tel': <class 'slixmpp.plugins.xep_0292.stanza.Tel'>, '{urn:ietf:params:xml:ns:vcard-4.0}url': <class 'slixmpp.plugins.xep_0292.stanza.Url'>}

A mapping of root element tag names (in '{namespace}elementname' format) to the plugin classes responsible for them.

set_birthday(birthday)[source]
set_full_name(full_name)[source]
set_given(given)[source]
set_surname(surname)[source]
slixmpp.plugins.xep_0292.stanza.p

alias of Adr