Skip to content
Back to top
View this page

# XEP-0292: vCard4 Over XMPP

XEP-0292 on xmpp.org

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

  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.

  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)

    Publish a vcard using PEP

  retrieve_vcard(jid, **pubsubkwargs)

    Retrieve a vcard using PEP

## Stanza elements

class slixmpp.plugins.xep_0292.stanza.Adr(xml=None, parent=None)
  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)
  get_date()
  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)

class slixmpp.plugins.xep_0292.stanza.Date(xml=None, parent=None)
  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)
  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)
  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)
  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)
  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)
  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)
  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)
  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.Pronouns(xml=None, parent=None)
  name: ClassVar[str] = 'pronouns'

    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] = 'pronouns'

    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.Tel(xml=None, parent=None)
  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)
  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)
  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)
  add_address(country=None, locality=None)
  add_email(email)
  add_impp(impp)
  add_nickname(nick)
  add_note(note)
  add_tel(number, name=None)
  add_url(url)
  get_birthday()
  get_full_name()
  get_given()
  get_surname()
  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'>, 'pronouns': <class 'slixmpp.plugins.xep_0292.stanza.Pronouns'>, '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}pronouns': <class 'slixmpp.plugins.xep_0292.stanza.Pronouns'>, '{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)
  set_full_name(full_name)
  set_given(given)
  set_surname(surname)

slixmpp.plugins.xep_0292.stanza.p

  alias of `Adr`