{ "info": { "author": "Lucas Lira Gomes", "author_email": "x8lucas8x@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Communications", "Topic :: Internet", "Topic :: System :: Networking" ], "description": "Zeroless\n========\n\n.. _badges_start:\n\n|Build Status| |Coverage Status| |Codacy| |PyPi| |Docs| |License|\n\n.. _badges_end:\n\nYet another \u00d8MQ_ wrapper for Python. However, differing from PyZMQ_, which\ntries to stay very close to the C++ implementation, this project aims to\nmake distributed systems employing \u00d8MQ_ as pythonic as possible.\n\nBeing simpler to use, Zeroless doesn't supports all of the fine aspects\nand features of \u00d8MQ_. However, you can expect to find all the message\npassing patterns you were accustomed to (i.e. pair, request/reply,\npublisher/subscriber, push/pull). Depite that, the only transport\navailable is TCP, as threads are not as efficient in Python due to the\nGIL and IPC is unix-only.\n\nInstallation\n------------\n\n.. _install_content_start:\n\n.. code-block:: bash\n\n $ pip install zeroless\n\n.. _install_content_end:\n\nPython API\n----------\n\n.. _python_api_content_start:\n\nIn the ``zeroless`` module, two classes can be used to define how distributed\nentities are related (i.e. ``Server`` and ``Client``). To put it bluntly, with\nthe exception of the pair pattern, a client may be connected to multiple\nservers, while a server may accept incoming connections from multiple clients.\n\nBoth servers and clients are able to create a *callable* and/or *iterable*,\ndepending on the message passing pattern. So that you can iterate over incoming\nmessages and/or call to transmit a message.\n\n.. _python_api_content_end:\n\nAll examples assume:\n\n.. code:: python\n\n from zeroless import (Server, Client)\n\nPush-Pull\n~~~~~~~~~\n\n.. _push_pull_content_start:\n\nUseful for distributing the workload among a set of workers. A common\npattern in the Stream Processing field, being the cornestone of\napplications like Apache Storm for instance. Also, it can be seen as a\ngeneralisation of the Map-Reduce pattern.\n\n.. _push_pull_content_end:\n\n.. code:: python\n\n # Binds the pull server to port 12345\n # And assigns an iterable to wait for incoming messages\n listen_for_push = Server(port=12345).pull()\n\n for msg in listen_for_push:\n print(msg)\n\n.. code:: python\n\n # Connects the client to as many servers as desired\n client = Client()\n client.connect_local(port=12345)\n\n # Initiate a push client\n # And assigns a callable to push messages\n push = client.push()\n\n for msg in [b\"Msg1\", b\"Msg2\", b\"Msg3\"]:\n push(msg)\n\nPublisher-Subscriber\n~~~~~~~~~~~~~~~~~~~~\n\n.. _pub_sub_content_start:\n\nUseful for broadcasting messages to a set of peers. A common pattern for\nallowing real-time notifications at the client side, without having to\nresort to inneficient approaches like pooling. Online services like\nPubNub or IoT protocols like MQTT are examples of this pattern usage.\n\n.. _pub_sub_content_end:\n\n.. code:: python\n\n # Binds the publisher server to port 12345\n # And assigns a callable to publish messages with the topic 'sh'\n pub = Server(port=12345).pub(topic=b'sh', embed_topic=True)\n\n # Gives publisher some time to get initial subscriptions\n sleep(1)\n\n for msg in [b\"Msg1\", b\"Msg2\", b\"Msg3\"]:\n pub(msg)\n\n.. code:: python\n\n # Connects the client to as many servers as desired\n client = Client()\n client.connect_local(port=12345)\n\n # Initiate a subscriber client\n # Assigns an iterable to wait for incoming messages with the topic 'sh'\n listen_for_pub = client.sub(topics=[b'sh'])\n\n for topic, msg in listen_for_pub:\n print(topic, ' - ', msg)\n\n.. _pub_sub_appendix_start:\n\nNote: ZMQ's topic filtering capabilities are publisher side since ZMQ 3.0.\n\nLast but not least, SUB sockets that bind will not get any message before they\nfirst ask for via the provided generator, so prefer to bind PUB sockets if\nmissing some messages is not an option.\n\n.. _pub_sub_appendix_end:\n\nRequest-Reply\n~~~~~~~~~~~~~\n\n.. _req_rep_content_start:\n\nUseful for RPC style calls. A common pattern for clients to request data\nand receive a response associated with the request. The HTTP protocol is\nwell-known for adopting this pattern, being it essential for Restful\nservices.\n\n.. _req_rep_content_end:\n\n.. code:: python\n\n # Binds the reply server to port 12345\n # And assigns a callable and an iterable\n # To both transmit and wait for incoming messages\n reply, listen_for_request = Server(port=12345).reply()\n\n for msg in listen_for_request:\n print(msg)\n reply(msg)\n\n.. code:: python\n\n # Connects the client to as many servers as desired\n client = Client()\n client.connect_local(port=12345)\n\n # Initiate a request client\n # And assigns a callable and an iterable\n # To both transmit and wait for incoming messages\n request, listen_for_reply = client.request()\n\n for msg in [b\"Msg1\", b\"Msg2\", b\"Msg3\"]:\n request(msg)\n response = next(listen_for_reply)\n print(response)\n\nPair\n~~~~\n\n.. _pair_content_start:\n\nMore often than not, this pattern will be unnecessary, as the above ones\nor the mix of them suffices most use cases in distributed computing.\nRegarding its capabilities, this pattern is the most similar alternative\nto usual posix sockets among the aforementioned patterns. Therefore,\nexpect one-to-one and bidirectional communication.\n\n.. _pair_content_end:\n\n.. code:: python\n\n # Binds the pair server to port 12345\n # And assigns a callable and an iterable\n # To both transmit and wait for incoming messages\n pair, listen_for_pair = Server(port=12345).pair()\n\n for msg in listen_for_pair:\n print(msg)\n pair(msg)\n\n.. code:: python\n\n # Connects the client to a single server\n client = Client()\n client.connect_local(port=12345)\n\n # Initiate a pair client\n # And assigns a callable and an iterable\n # To both transmit and wait for incoming messages\n pair, listen_for_pair = client.pair()\n\n for msg in [b\"Msg1\", b\"Msg2\", b\"Msg3\"]:\n pair(msg)\n response = next(listen_for_pair)\n print(response)\n\nLogging\n-------\n\n.. _logging_content_start:\n\nThe ``zeroless`` module allows logging via a global `Logger object `__.\n\n.. code:: python\n\n from zeroless import log\n\nTo enable it, just add an `Handler object `__ and set an appropriate `logging level `__.\n\n.. _logging_content_end:\n\nTesting\n-------\n\n.. _testing_content_start:\n\nTo run individual tests:\n\n.. code-block:: bash\n\n $ py.test tests/test_desired_module.py\n\nTo run all the tests:\n\n.. code-block:: bash\n\n $ python setup.py test\n\nAlternatively, you can use tox:\n\n.. code-block:: bash\n\n $ tox\n\n.. _testing_content_end:\n\nNeed help?\n----------\n\nFor more information, please see our documentation_.\n\nLicense\n-------\n\n.. _license_content_start:\n\nCopyright 2014 Lucas Lira Gomes x8lucas8x@gmail.com\n\nThis library is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation; either version 2.1 of the License, or (at\nyour option) any later version.\n\nThis library is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with this library. If not, see http://www.gnu.org/licenses/.\n\n.. _license_content_end:\n\n.. _available_badges_start:\n\n.. |Build Status| image:: https://img.shields.io/travis/zmqless/python-zeroless.svg?style=flat\n :target: https://travis-ci.org/zmqless/python-zeroless\n.. |Coverage Status| image:: https://coveralls.io/repos/zmqless/python-zeroless/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/zmqless/python-zeroless?branch=master\n.. |Docs| image:: https://readthedocs.org/projects/python-zeroless/badge/?version=latest\n :target: https://readthedocs.org/projects/python-zeroless/?badge=latest\n.. |License| image:: https://img.shields.io/pypi/l/zeroless.svg?style=flat\n :target: https://www.gnu.org/licenses/lgpl-2.1.html\n.. |Codacy| image:: https://www.codacy.com/project/badge/8499be83359e4eccaa363b14cda4cbe0\n :target: https://www.codacy.com/app/x8lucas8x/python-zeroless\n.. |PyPi| image:: https://img.shields.io/pypi/v/zeroless.svg?style=flat\n :target: https://pypi.python.org/pypi/zeroless\n\n.. _available_badges_end:\n\n.. _\u00d8MQ: http://www.zeromq.org\n.. _PyZMQ: https://www.github.com/zeromq/pyzmq\n.. _documentation: http://python-zeroless.readthedocs.org/en/latest/", "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/zmqless/python-zeroless", "keywords": "pyzmq zeromq zmq \u00d8MQ networking distributed socket client server p2p publish subscribe request reply push pull communication internet backend microservices", "license": "LGPLv2+", "maintainer": null, "maintainer_email": null, "name": "zeroless", "package_url": "https://pypi.org/project/zeroless/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zeroless/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/zmqless/python-zeroless" }, "release_url": "https://pypi.org/project/zeroless/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "ZeroMQ for Pythonistas\u2122", "version": "1.0.0" }, "last_serial": 1669116, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2177410e7bf66f5ec30d9e2ab25419e8", "sha256": "fc9e0908d4fcfd806748979fe6733d83cf332933e5f7d0e2d883cf1e05d4c900" }, "downloads": -1, "filename": "zeroless-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2177410e7bf66f5ec30d9e2ab25419e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4166, "upload_time": "2014-12-23T21:16:23", "url": "https://files.pythonhosted.org/packages/1c/23/639069b0fcc2ce2de4adfbe579e9fb5eb921d82fbacd4f072b280de052c7/zeroless-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f30da569a81e3e01c27cae910dbef946", "sha256": "017f22df04acdba1d6d0778dc5d8da09c6486d10ab14da5ab4ab14656330d388" }, "downloads": -1, "filename": "zeroless-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f30da569a81e3e01c27cae910dbef946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4171, "upload_time": "2014-12-23T21:23:13", "url": "https://files.pythonhosted.org/packages/14/9d/1db2067fc2a5e4e91998784c433bb1fd9b50d1ddc8252f73e113e716fcc2/zeroless-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a30bb8e1fa2c1fe300eb17215077e631", "sha256": "0f51f2a3108e2ed37b5b5dde71658eb992f0824c9a15adbff85bc816803dd26e" }, "downloads": -1, "filename": "zeroless-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a30bb8e1fa2c1fe300eb17215077e631", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4485, "upload_time": "2014-12-25T20:01:56", "url": "https://files.pythonhosted.org/packages/97/b0/0ac48507c04c5b9df8e03539e4c0ddbb67c528a021824cc27c12c81be727/zeroless-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1f332e9cf335b9bc5fa9541787aea949", "sha256": "5486c217c0f1a2e1bf5cdc28b7891dfe6872e5cc899e6ab72462bf4f2f15e5c5" }, "downloads": -1, "filename": "zeroless-0.3.0.tar.gz", "has_sig": false, "md5_digest": "1f332e9cf335b9bc5fa9541787aea949", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6361, "upload_time": "2014-12-31T01:40:14", "url": "https://files.pythonhosted.org/packages/7e/3e/ebc21735eab538168680f9f948d882b98e010a17285e61e84e31dc507a75/zeroless-0.3.0.tar.gz" } ], "0.4.0": [], "0.5.0": [ { "comment_text": "", "digests": { "md5": "f7af99afc73a605f3daccd754f820083", "sha256": "122523945866912cf06f7628f054b6317f5c49bc1a609d34cf424dd67d3b5efa" }, "downloads": -1, "filename": "zeroless-0.5.0.tar.gz", "has_sig": false, "md5_digest": "f7af99afc73a605f3daccd754f820083", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8438, "upload_time": "2015-03-27T21:24:44", "url": "https://files.pythonhosted.org/packages/8c/7f/d662f055fa76933c967de92b7d687ad0688dacf9576c1ae0d26338e6322a/zeroless-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "72fef75fc0bf5f23098bc330da191c75", "sha256": "942aebaed7bc94c08759ebf14f9f9c9738e9afd17d45727a60942cc6cf012dbc" }, "downloads": -1, "filename": "zeroless-0.6.0.tar.gz", "has_sig": false, "md5_digest": "72fef75fc0bf5f23098bc330da191c75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19793, "upload_time": "2015-05-02T13:16:13", "url": "https://files.pythonhosted.org/packages/0c/df/4a40535317d9a0c2e8090847263e46dda6fb72cafc62538aa0a15fc64d1e/zeroless-0.6.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "46fbeb4edd3684d09b197ac23f4d3cdc", "sha256": "8c0c87bf9024fbb92403b39444332406559f758311358aa59855945471660d63" }, "downloads": -1, "filename": "zeroless-1.0.0.tar.gz", "has_sig": false, "md5_digest": "46fbeb4edd3684d09b197ac23f4d3cdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8343, "upload_time": "2015-08-08T00:19:49", "url": "https://files.pythonhosted.org/packages/6d/4f/03e785a2dd2d9bf0122c45a536a9299035a1a46da0b36d959318140f7085/zeroless-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "46fbeb4edd3684d09b197ac23f4d3cdc", "sha256": "8c0c87bf9024fbb92403b39444332406559f758311358aa59855945471660d63" }, "downloads": -1, "filename": "zeroless-1.0.0.tar.gz", "has_sig": false, "md5_digest": "46fbeb4edd3684d09b197ac23f4d3cdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8343, "upload_time": "2015-08-08T00:19:49", "url": "https://files.pythonhosted.org/packages/6d/4f/03e785a2dd2d9bf0122c45a536a9299035a1a46da0b36d959318140f7085/zeroless-1.0.0.tar.gz" } ] }