pyxmpp

Package pyxmpp |
[show private | hide private]
[frames | no frames]

## Package pyxmpp

PyXMPP is object-oriented, most of its fetures are implemented via classes, defined in various pyxmpp modules. The API is very asynchronous -- often requested objects are not returned immediately, but instead a callback is called when the object is available or an event occurs.

As python is not a strongly-typed language so the parameter and attribute types shown in this documentation are not enforced, but those types are expected by the package and others may simply not work or stop working in future releases of PyXMPP.

# Module hierarchy

Base XMPP features (RFC 3920, RFC 3921) are implemented in direct submodules of `pyxmpp` package. Most JSF defined extensions are defined in `pyxmpp.jabber` package and modules for server components are placed in `pyxmpp.jabberd`.

For convenience most important names (classes for application use) may be imported into `pyxmpp`, `pyxmpp.jabber` or `pyxmpp.jabberd` packages. To do that `pyxmpp.all`, `pyxmpp.jabber.all` or `pyxmpp.jabberd.all` must be imported. One doesn't have to remember any other module name then.

# Constructors

Most of PyXMPP object constructors are polymorphic. That means they accept different types and number of arguments to create object from various input. Usually the first argument may be an XML node to parse/wrap into the object or parameters needed to create a new object from scratch. E.g. `pyxmpp.stanza.Stanza` constructor accepts single `libxml2.xmlNode` argument with XML stanza or set of keyword arguments (from_jid, to_jid, stanza_type, etc.) to create such XML stanza. Most of the constructors will also accept instance of their own class to create a copy of it.

# Property access

Elements of XMPP protocol (like various stanza, roster or JSF extensions' objects) have various properties, like addresses, values, types etc. Those are values of apropriate elements or attributes in the XML protocol. In PyXMPP such elements are stored as parsed XML nodes (subtrees) or just the properties, however the API is supposed to consistent, whatever is the internal representation (which may change sometimes).

Common properties are accessible as object attributes and/or via get_* and set_* functions. Attributes access gives direct access to the internal storage or the cached value and will be usually faster, but for object using XML node as internal representation only get_* functions result is always up-to-date (attribute value may become invalid after the node is modified directly using `libxml2` API).

# Common methods

Most objects describing elements of the XMPP protocol or its extensions have method as_xml() providing their XML representations.

Submodules
`all`: Convenience module containing most important objects from pyxmpp package. `cache`: Caching proxy for Jabber/XMPP objects. `client`: Basic XHTML-IM client implementation. `clientstream`: Client stream handling. `error`: XMPP error handling. `expdict`: Dictionary with item expiration. `iq`: Iq XMPP stanza handling `jabber`: JSF defined XMPP extension and legacy Jabber protocol elements `all`: Convenience module containing most important objects from pyxmpp.jabber package. `client`: Basic Jabber client functionality implementation. `clientstream`: XMPP stream support with fallback to legacy non-SASL Jabber authentication. `dataforms`: Jabber Data Forms support. `delay`: Delayed delivery mark (jabber:x:delay) handling. `disco`: Jabber Service Discovery support. `muc`: Jabber Multi-User Chat implementation. `muccore`: Jabber Multi-User Chat implementation. `register`: In-band registration (jabber:iq:register) handling. `simple`: Simple API for simple things like sendig messages or single stanzas. `vcard`: Jabber vCard and MIME (RFC 2426) vCard implementation. `jabberd`: Facilities for jabber server implementation specific features, like components. `all`: Convenience module containing most important objects fr pyxmpp.jabberd package. `component`: Jabberd external component interface (jabber:component:accept). `componentstream`: Component (jabber:component:accept) stream handling. `jid`: jid -- Jabber ID handling `message`: Message XMPP stanza handling `objects`: General base classes for PyXMPP objects. `presence`: Presence XMPP stanza handling `resolver`: DNS resolever with SRV record support. `roster`: XMPP-IM roster handling. `sasl`: SASL authentication implementaion for PyXMPP. `core`: Base classes for PyXMPP SASL implementation. `digest_md5`: DIGEST-MD5 authentication mechanism for PyXMPP SASL implementation. `plain`: PLAIN authentication mechanism for PyXMPP SASL implementation. `stanza`: General XMPP Stanza handling. `stanzaprocessor`: Handling of XMPP stanzas. `stream`: Generic XMPP stream implementation. `streambase`: Core XMPP stream functionality. `streamsasl`: SASL support XMPP streams. `streamtls`: TLS support for XMPP streams. `utils`: Utility functions for the pyxmpp package. `version` `xmlextra`: Extension to libxml2 for XMPP stream and stanza processing `xmppstringprep`: Nodeprep and resourceprep stringprep profiles.

Variable Summary
`str` | `__revision__` = `'$Id: __init__.py 616 2005-12-26 15:28:56...`

Imported modules:
  `pyxmpp.all`, `pyxmpp.cache`, `pyxmpp.client`, `pyxmpp.clientstream`, `pyxmpp.error`, `pyxmpp.expdict`, `pyxmpp.iq`, `pyxmpp.jabber`, `pyxmpp.jabberd`, `pyxmpp.jid`, `pyxmpp.message`, `pyxmpp.objects`, `pyxmpp.presence`, `pyxmpp.resolver`, `pyxmpp.roster`, `pyxmpp.sasl`, `pyxmpp.stanza`, `pyxmpp.stanzaprocessor`, `pyxmpp.stream`, `pyxmpp.streambase`, `pyxmpp.streamsasl`, `pyxmpp.streamtls`, `pyxmpp.utils`, `pyxmpp.version`, `pyxmpp.xmlextra`, `pyxmpp.xmppstringprep`
Imported classes:
  `Client`, `ClientStream`, `Iq`, `JID`, `Message`, `Presence`, `Roster`, `RosterItem`, `Stream`, `TLSSettings`
Imported exceptions:
  `ClientError`, `ClientStreamError`, `FatalStreamError`, `JIDError`, `StanzaError`, `StreamEncryptionRequired`, `StreamError`, `StreamParseError`
Imported variables:
  `tls_available`

Variable Details

    ### __revision__ Type: `str` Value:
        '$Id: __init__.py 616 2005-12-26 15:28:56Z jajcus $'