{ "info": { "author": "Samuele Santi", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4" ], "description": "Eventlite\n#########\n\nLight \"events\" for Python functions.\n\n.. image:: https://pypip.in/version/eventlite/badge.svg?text=version\n :target: https://pypi.python.org/pypi/eventlite/\n :alt: Latest PyPI version\n\n.. image:: https://pypip.in/download/eventlite/badge.svg?period=month\n :target: https://pypi.python.org/pypi/eventlite/\n :alt: Number of PyPI downloads\n\n.. image:: https://pypip.in/py_versions/eventlite/badge.svg\n :target: https://pypi.python.org/pypi/eventlite/\n :alt: Supported Python versions\n\n.. image:: https://pypip.in/status/eventlite/badge.svg\n :target: https://pypi.python.org/pypi/eventlite/\n :alt: Development Status\n\n.. image:: https://pypip.in/license/eventlite/badge.svg\n :target: https://pypi.python.org/pypi/eventlite/\n :alt: License\n\n\nAbstract\n========\n\nThe purpose of this library is to provide an \"abstract\" way for\nfunctions to \"report\" events, in a way similar to how a logging system\noperates.\n\nSome example applications:\n\n- A logging system: ``emit('log', 'My message', level='info')``\n- Reporting progress on some running operation ``emit('progress', current=20, total=100)``\n\nNote that the event structure is not imposed in any way; in fact, any\ncombination of arguments/keywords can be used, proven that the handler\nfunction is able to handle it.\n\n\nExample usage\n=============\n\n.. code-block:: python\n\n import eventlite\n\n def myfunction(foo):\n eventlite.emit(foo)\n\n def handler(foo):\n print('You said: {0}'.format('Hello'))\n\n with eventlite.handler(handler):\n myfunction('Hello')\n\n\nAPI Documentation\n=================\n\nThe library provides two functions:\n\n- ``eventlite.emit(*a, **kw)`` \"emits\" an \"event\" (represented by a\n variable number of arguments / keywords).\n\n- ``eventlite.handler(function)`` returns a context manager that makes\n events to be dispatched to a certain function, while the context is\n active.\n\n\nSo, in the example above, when ``eventlite.emit()`` is called with one\nargument, ``handler()`` will be called passing the single argument to\nit.\n\n\nInternals\n=========\n\nAll the magic is implemented using a ``LocalStack`` (borrowed from\nwerkzeug) which keeps a stack of handlers to be called, for the local\nproxy. The ``emit()`` functon simply looks for an handler in the stack\nto which to dispatch the event.\n\n**Note:** by default only the handler for the innermost context\nmanager is called; this might or might not be the desired behavior;\nsome way to change this will be added in the future.\n\n\nLinks\n=====\n\n- PyPI page: https://pypi.python.org/pypi/eventlite\n- Source code: https://github.com/rshk/eventlite\n\n\nHistory\n#######\n\nv0.1a\n=====\n\n- Initial version, with handling of simple events through a\n context-manager dispatching to \"contexts\" in a thread-local stack.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "PACKAGE_URL", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "eventlite", "package_url": "https://pypi.org/project/eventlite/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/eventlite/", "project_urls": { "Download": "UNKNOWN", "Homepage": "PACKAGE_URL" }, "release_url": "https://pypi.org/project/eventlite/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.1.1" }, "last_serial": 1364283, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "3507a21dba8c601cc083699410fc71b3", "sha256": "438aebdc5833a8e90c69f95f346b46ee700d847a2e69d28f00f7f2825b08e417" }, "downloads": -1, "filename": "eventlite-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3507a21dba8c601cc083699410fc71b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7161, "upload_time": "2014-12-29T21:15:45", "url": "https://files.pythonhosted.org/packages/96/c8/9ffe696b11a07cbc6b466499dabd19b36d90813ef250fe56c6055eae157e/eventlite-0.1.1.tar.gz" } ], "0.1a": [ { "comment_text": "", "digests": { "md5": "a46aebe9b7bef2d42f042170796a268f", "sha256": "ce818cbffca6c9f36c10303dee2f13bf6947cb77f477ffce0fd7278978b4daf8" }, "downloads": -1, "filename": "eventlite-0.1a.tar.gz", "has_sig": false, "md5_digest": "a46aebe9b7bef2d42f042170796a268f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6002, "upload_time": "2014-11-04T14:32:44", "url": "https://files.pythonhosted.org/packages/8a/d5/251435bdc92c876196b25beafa488a5e52b3e58b1ae8bdf0a43e85f422c7/eventlite-0.1a.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3507a21dba8c601cc083699410fc71b3", "sha256": "438aebdc5833a8e90c69f95f346b46ee700d847a2e69d28f00f7f2825b08e417" }, "downloads": -1, "filename": "eventlite-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3507a21dba8c601cc083699410fc71b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7161, "upload_time": "2014-12-29T21:15:45", "url": "https://files.pythonhosted.org/packages/96/c8/9ffe696b11a07cbc6b466499dabd19b36d90813ef250fe56c6055eae157e/eventlite-0.1.1.tar.gz" } ] }