PKG-INFO 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. Metadata-Version: 1.1
  2. Name: sleekxmpp
  3. Version: 1.3.3
  4. Summary: SleekXMPP is an elegant Python library for XMPP (aka Jabber, Google Talk, etc).
  5. Home-page: http://github.com/fritzy/SleekXMPP
  6. Author: Nathanael Fritz
  7. Author-email: fritzy@netflint.net
  8. License: MIT
  9. Description: SleekXMPP
  10. #########
  11. SleekXMPP is an MIT licensed XMPP library for Python 2.6/3.1+,
  12. and is featured in examples in
  13. `XMPP: The Definitive Guide <http://oreilly.com/catalog/9780596521271>`_
  14. by Kevin Smith, Remko Tronçon, and Peter Saint-Andre. If you've arrived
  15. here from reading the Definitive Guide, please see the notes on updating
  16. the examples to the latest version of SleekXMPP.
  17. SleekXMPP's design goals and philosphy are:
  18. **Low number of dependencies**
  19. Installing and using SleekXMPP should be as simple as possible, without
  20. having to deal with long dependency chains.
  21. As part of reducing the number of dependencies, some third party
  22. modules are included with SleekXMPP in the ``thirdparty`` directory.
  23. Imports from this module first try to import an existing installed
  24. version before loading the packaged version, when possible.
  25. **Every XEP as a plugin**
  26. Following Python's "batteries included" approach, the goal is to
  27. provide support for all currently active XEPs (final and draft). Since
  28. adding XEP support is done through easy to create plugins, the hope is
  29. to also provide a solid base for implementing and creating experimental
  30. XEPs.
  31. **Rewarding to work with**
  32. As much as possible, SleekXMPP should allow things to "just work" using
  33. sensible defaults and appropriate abstractions. XML can be ugly to work
  34. with, but it doesn't have to be that way.
  35. Get the Code
  36. ------------
  37. Get the latest stable version from PyPI::
  38. pip install sleekxmpp
  39. The latest source code for SleekXMPP may be found on `Github
  40. <http://github.com/fritzy/SleekXMPP>`_. Releases can be found in the
  41. ``master`` branch, while the latest development version is in the
  42. ``develop`` branch.
  43. **Latest Release**
  44. - `1.3.1 <http://github.com/fritzy/SleekXMPP/zipball/1.3.1>`_
  45. **Develop Releases**
  46. - `Latest Develop Version <http://github.com/fritzy/SleekXMPP/zipball/develop>`_
  47. Installing DNSPython
  48. --------------------
  49. If you are using Python3 and wish to use dnspython, you will have to checkout and
  50. install the ``python3`` branch::
  51. git clone http://github.com/rthalley/dnspython
  52. cd dnspython
  53. git checkout python3
  54. python3 setup.py install
  55. Discussion
  56. ----------
  57. A mailing list and XMPP chat room are available for discussing and getting
  58. help with SleekXMPP.
  59. **Mailing List**
  60. `SleekXMPP Discussion on Google Groups <http://groups.google.com/group/sleekxmpp-discussion>`_
  61. **Chat**
  62. `sleek@conference.jabber.org <xmpp:sleek@conference.jabber.org?join>`_
  63. Documentation and Testing
  64. -------------------------
  65. Documentation can be found both inline in the code, and as a Sphinx project in ``/docs``.
  66. To generate the Sphinx documentation, follow the commands below. The HTML output will
  67. be in ``docs/_build/html``::
  68. cd docs
  69. make html
  70. open _build/html/index.html
  71. To run the test suite for SleekXMPP::
  72. python testall.py
  73. The SleekXMPP Boilerplate
  74. -------------------------
  75. Projects using SleekXMPP tend to follow a basic pattern for setting up client/component
  76. connections and configuration. Here is the gist of the boilerplate needed for a SleekXMPP
  77. based project. See the documetation or examples directory for more detailed archetypes for
  78. SleekXMPP projects::
  79. import logging
  80. from sleekxmpp import ClientXMPP
  81. from sleekxmpp.exceptions import IqError, IqTimeout
  82. class EchoBot(ClientXMPP):
  83. def __init__(self, jid, password):
  84. ClientXMPP.__init__(self, jid, password)
  85. self.add_event_handler("session_start", self.session_start)
  86. self.add_event_handler("message", self.message)
  87. # If you wanted more functionality, here's how to register plugins:
  88. # self.register_plugin('xep_0030') # Service Discovery
  89. # self.register_plugin('xep_0199') # XMPP Ping
  90. # Here's how to access plugins once you've registered them:
  91. # self['xep_0030'].add_feature('echo_demo')
  92. # If you are working with an OpenFire server, you will
  93. # need to use a different SSL version:
  94. # import ssl
  95. # self.ssl_version = ssl.PROTOCOL_SSLv3
  96. def session_start(self, event):
  97. self.send_presence()
  98. self.get_roster()
  99. # Most get_*/set_* methods from plugins use Iq stanzas, which
  100. # can generate IqError and IqTimeout exceptions
  101. #
  102. # try:
  103. # self.get_roster()
  104. # except IqError as err:
  105. # logging.error('There was an error getting the roster')
  106. # logging.error(err.iq['error']['condition'])
  107. # self.disconnect()
  108. # except IqTimeout:
  109. # logging.error('Server is taking too long to respond')
  110. # self.disconnect()
  111. def message(self, msg):
  112. if msg['type'] in ('chat', 'normal'):
  113. msg.reply("Thanks for sending\n%(body)s" % msg).send()
  114. if __name__ == '__main__':
  115. # Ideally use optparse or argparse to get JID,
  116. # password, and log level.
  117. logging.basicConfig(level=logging.DEBUG,
  118. format='%(levelname)-8s %(message)s')
  119. xmpp = EchoBot('somejid@example.com', 'use_getpass')
  120. xmpp.connect()
  121. xmpp.process(block=True)
  122. Credits
  123. -------
  124. **Main Author:** Nathan Fritz
  125. `fritzy@netflint.net <xmpp:fritzy@netflint.net?message>`_,
  126. `@fritzy <http://twitter.com/fritzy>`_
  127. Nathan is also the author of XMPPHP and `Seesmic-AS3-XMPP
  128. <http://code.google.com/p/seesmic-as3-xmpp/>`_, and a former member of
  129. the XMPP Council.
  130. **Co-Author:** Lance Stout
  131. `lancestout@gmail.com <xmpp:lancestout@gmail.com?message>`_,
  132. `@lancestout <http://twitter.com/lancestout>`_
  133. **Contributors:**
  134. - Brian Beggs (`macdiesel <http://github.com/macdiesel>`_)
  135. - Dann Martens (`dannmartens <http://github.com/dannmartens>`_)
  136. - Florent Le Coz (`louiz <http://github.com/louiz>`_)
  137. - Kevin Smith (`Kev <http://github.com/Kev>`_, http://kismith.co.uk)
  138. - Remko Tronçon (`remko <http://github.com/remko>`_, http://el-tramo.be)
  139. - Te-jé Rogers (`te-je <http://github.com/te-je>`_)
  140. - Thom Nichols (`tomstrummer <http://github.com/tomstrummer>`_)
  141. Platform: any
  142. Classifier: Intended Audience :: Developers
  143. Classifier: License :: OSI Approved :: MIT License
  144. Classifier: Programming Language :: Python
  145. Classifier: Programming Language :: Python :: 2.6
  146. Classifier: Programming Language :: Python :: 2.7
  147. Classifier: Programming Language :: Python :: 3.1
  148. Classifier: Programming Language :: Python :: 3.2
  149. Classifier: Programming Language :: Python :: 3.3
  150. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  151. Requires: dnspython
  152. Requires: pyasn1
  153. Requires: pyasn1_modules