{ "info": { "author": "Louis Thibault", "author_email": "louist87@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "eXpMPP\n======\n\nXMPP notifications for psychology experiments\n\nInstallation\n======\n\n##With pip (recommended)\n\nThe latest stable binaries are available via pip. Simply run `pip install expmpp --user`\n\n##From github\n\n1. `git clone https://github.com/louist87/expmpp.git`\n2. `cd expmpp`\n3. `python setup.py develop --user`\n\nUsage\n======\n\n##Setting up a client\n\nIn order to begin receiving notifications, we must first initialize a client.\nThis should be done **exactly once** in your application and the resultant `Client` instance can then be imported by various submodules.\n\n```python\nfrom expmpp.client import Client\n\nmy_listeners = ['mylistener@domain.com'] # ID of the account being notified\nclient = Client('myuser@domain.com', 'mypassword', listeners=my_listeners)\n```\n\n##Sending notifications\n\nOnce you've initialized your client, you can begin sending arbitrary notifications.\n\n```python\nclient.notify('This is a test.')\n```\n\n##Monitoring functions\n\nSometimes it is useful to be notified when a specific function returns. A common use-case is to send a notificaiton to the experimentor when the function responsible for running an experimental block has completed. This use-case motivates the following example:\n\n```python\n@client.monitor(\"Block Complete\")\ndef run_block():\n # logic to run the block\n```\n\nWhen the function `run_block` returns, eXpMPP will send a notification containing the text `Block Complete`.\n\nIt is often desirable to provide information about the return value of the monitored function. By default, `Client.monitor` attempts to fill a [python-formatted string](https://docs.python.org/2/library/stdtypes.html#str.format) with the return value of the monitored function. Thus,\n\n```python\n@client.monitor(\"Block {0} Complete\")\ndef run_block():\n # logic to run block\n return block_num\n```\n\nis expected to return a string such as `Block 1 Complete`, assuming `run_block` returns an integer.\n\nFor functions that return multiple values (or iterable containers), the `unpack` flag, when set to `True`, will attempt to map each variable in the returned container to its respective placeholder. For instance:\n\n```python\n@client.monitor(\"Subject {0}, Block {1} Complete\", unpack=True)\ndef run_block():\n # logic to run block\n return sub_num, block_num\n```\n\nThe above example is expected to return a string such as `Subject 1, Block 3 Complete`.\n\nIf the function returns a dictionary, setting `unpack=True` will map the the values of the dictionary to named placeholders as follows:\n\n```python\n@client.monitor(\"Subject {sub}, Block {block} Complete\")\ndef run_block():\n # logic to run block\n return {'sub': sub_num, 'block': block_num}\n```\n\nThe above example is expected to return a string similar to the one in the preceding example.\n\n###Transforming output for notification\n\nOn occasion, a function will return a value that is either non-human-readable or whose default formatting is sinfully ugly. For these cases, a function can be passed to the `transformer` keyword argument, which allows a developer to transform the output before notification. Note that the `transformer` parameter does **not** change the function's final return value; it only changes what gets sent over the wire.\n\n```python\ndef check_err(ret_val):\n if ret_val is None:\n return \"Block complete. No errors.\"\n else:\n return \"Error: {0}\".format(ret_val)\n\n\n@client.monitor('{0}', transformer=check_err)\ndef run_block():\n # logic to run block\n return ret_val\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/louist87/expmpp", "keywords": "experiment,psychology,XMPP,google talk", "license": "GPLv3.0", "maintainer": null, "maintainer_email": null, "name": "eXpMPP", "package_url": "https://pypi.org/project/eXpMPP/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/eXpMPP/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/louist87/expmpp" }, "release_url": "https://pypi.org/project/eXpMPP/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "XMPP notifications for psychology experiments", "version": "1.0.3" }, "last_serial": 1316323, "releases": { "1.0.0": [ { "comment_text": "built for Linux-3.11.0-15-generic-x86_64-with-glibc2.4", "digests": { "md5": "9952bc166bdbed5d9e019c7a9fb7b460", "sha256": "24741389951f89baa0874aec6965efd5f877c635b52f38ed36b928ad76b3af96" }, "downloads": -1, "filename": "eXpMPP-1.0.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "9952bc166bdbed5d9e019c7a9fb7b460", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4110, "upload_time": "2014-11-10T18:23:37", "url": "https://files.pythonhosted.org/packages/c4/21/2ef3edde18b4f683388e9e58415e36ffec48268d531a562cbf5b64d1965f/eXpMPP-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "771e4c83c2e06b4b0b953fba3e1e9141", "sha256": "8dbcd840a02aab34e429a4622a6e1ae51e4ecea4f4337b88d11d5560a38e93e7" }, "downloads": -1, "filename": "eXpMPP-1.0.0.tar.gz", "has_sig": false, "md5_digest": "771e4c83c2e06b4b0b953fba3e1e9141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3028, "upload_time": "2014-11-10T18:23:34", "url": "https://files.pythonhosted.org/packages/78/08/3d73c240d0ba40343e43a1326461256f7ff5a6f57c971122fdb64b622ff2/eXpMPP-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "built for Linux-3.11.0-15-generic-x86_64-with-glibc2.4", "digests": { "md5": "40539e286775b6e6effdfd5f8c98a212", "sha256": "a71544e97cddc3995997f1515a23664a2d5bf5303d52a8aaa67493e8c801a488" }, "downloads": -1, "filename": "eXpMPP-1.0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "40539e286775b6e6effdfd5f8c98a212", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4144, "upload_time": "2014-11-11T10:01:26", "url": "https://files.pythonhosted.org/packages/40/86/cb110cd8b4b16923a567089ce7f2f3751cfc0613d4cd3f9a18c47ffa29e9/eXpMPP-1.0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "2f75260832dccf5739271e7ec93d9c5a", "sha256": "a62bc2f0a69f04155603221c360d07806e859395e99c108fa17f1fa90584b679" }, "downloads": -1, "filename": "eXpMPP-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2f75260832dccf5739271e7ec93d9c5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3052, "upload_time": "2014-11-11T10:01:23", "url": "https://files.pythonhosted.org/packages/e9/7e/af4fa0355c4ab897a36915e501b36db051b834ad07dee7b308d8613e8a25/eXpMPP-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "built for Linux-3.11.0-15-generic-x86_64-with-glibc2.4", "digests": { "md5": "8bf725dc8767b2e865d453582723cd1e", "sha256": "5618386538b2c2e22f8ed0d77a99436889e31e72052ef5ef0a2f68454cf406fa" }, "downloads": -1, "filename": "eXpMPP-1.0.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "8bf725dc8767b2e865d453582723cd1e", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 4859, "upload_time": "2014-11-11T10:16:35", "url": "https://files.pythonhosted.org/packages/2b/3d/d4889658d147cf8cf38afe6d066db4faba67afd45b54197b274ec9db47b3/eXpMPP-1.0.2.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "be88adf601d98fcef32fcd77028a1782", "sha256": "b74cc1393459c57e0bdb00762f9a7e2e1b091f56c7f2b4abf79529d3ae76d8ec" }, "downloads": -1, "filename": "eXpMPP-1.0.2.tar.gz", "has_sig": false, "md5_digest": "be88adf601d98fcef32fcd77028a1782", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3588, "upload_time": "2014-11-11T10:16:32", "url": "https://files.pythonhosted.org/packages/39/00/057e4c6740818886b0121f1220b0bd18eb1a51e1107abb27ab5ea94bc39a/eXpMPP-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "built for Linux-3.11.0-15-generic-x86_64-with-glibc2.4", "digests": { "md5": "a785f13559089c21416048a73bbc5ae9", "sha256": "0829fb33ce3bfbcea06e05930dff8b43750c162662d5c2a5a687180417029cdf" }, "downloads": -1, "filename": "eXpMPP-1.0.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "a785f13559089c21416048a73bbc5ae9", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 5000, "upload_time": "2014-11-21T17:43:45", "url": "https://files.pythonhosted.org/packages/b6/ae/2294434f3fc792ec9130d604cad7b892c00e05d0fd97d7ad425d4ba7445c/eXpMPP-1.0.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "2bd150050c1a39c8b0aae66e76746fe0", "sha256": "450db20eaa9a89fa68be51f1b510fdaa671dc0d85068aed2f8a1ccc2f9422f01" }, "downloads": -1, "filename": "eXpMPP-1.0.3.tar.gz", "has_sig": false, "md5_digest": "2bd150050c1a39c8b0aae66e76746fe0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3662, "upload_time": "2014-11-21T17:43:42", "url": "https://files.pythonhosted.org/packages/1d/bb/033623e0d256358e88a658e21d0bc026aea4ef2eacbdcd147c075be26899/eXpMPP-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.11.0-15-generic-x86_64-with-glibc2.4", "digests": { "md5": "a785f13559089c21416048a73bbc5ae9", "sha256": "0829fb33ce3bfbcea06e05930dff8b43750c162662d5c2a5a687180417029cdf" }, "downloads": -1, "filename": "eXpMPP-1.0.3.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "a785f13559089c21416048a73bbc5ae9", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 5000, "upload_time": "2014-11-21T17:43:45", "url": "https://files.pythonhosted.org/packages/b6/ae/2294434f3fc792ec9130d604cad7b892c00e05d0fd97d7ad425d4ba7445c/eXpMPP-1.0.3.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "2bd150050c1a39c8b0aae66e76746fe0", "sha256": "450db20eaa9a89fa68be51f1b510fdaa671dc0d85068aed2f8a1ccc2f9422f01" }, "downloads": -1, "filename": "eXpMPP-1.0.3.tar.gz", "has_sig": false, "md5_digest": "2bd150050c1a39c8b0aae66e76746fe0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3662, "upload_time": "2014-11-21T17:43:42", "url": "https://files.pythonhosted.org/packages/1d/bb/033623e0d256358e88a658e21d0bc026aea4ef2eacbdcd147c075be26899/eXpMPP-1.0.3.tar.gz" } ] }