{ "info": { "author": "Nipun Talukdar", "author_email": "nipunmlist@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Datachunkpy\n============\nDataChunk is an useful library for proessing messages in a stream where messages are sent in\na stream as shown below:\n....\nmsg-size is a 4 byte integer (little-endian)\nwhenever a complete message is read, DataChunk calls the handle_msg method of the handler.\n\nA message may come in fragments. Sometimes many messages may come in a single data packet. \nAll we need to do is to call process_chunk method of DataChunk and DataChunk object will take care \nof re-assembling the messages as and when needed.\n\n\nBasic example\n-------------\n\n\n .. code:: python\n\n from __future__ import print_function\n from struct import pack\n import random\n from datachunkpy.datachunk import DataChunk, MessageHandler\n\n # A message handler class \n class MyMsgHandler(MessageHandler):\n def __init__(self):\n self.msg_processed = 0\n self.bytes_processed = 0\n\n def handle_msg(self, data):\n print('I am handling', data)\n self.msg_processed += 1\n self.bytes_processed += len(data)\n\n \n datach = DataChunk(MyMsgHandler())\n\n i = 0\n random.seed()\n mydata = b''\n total_bytes = 0\n while i < 10000:\n i += 1\n j = random.randint(1,50)\n mydata += pack('i', j)\n mydata += b'a' * j\n total_bytes += j\n datach.process_chunk(mydata)", "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/nipuntalukdar/datachunkpy", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "datachunkpy", "package_url": "https://pypi.org/project/datachunkpy/", "platform": "all", "project_url": "https://pypi.org/project/datachunkpy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/nipuntalukdar/datachunkpy" }, "release_url": "https://pypi.org/project/datachunkpy/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "An utility library for separating individual messages in a stream", "version": "1.0.0" }, "last_serial": 2335856, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4432bfb137266ba37ff794146758a3b7", "sha256": "d1bbf648ab0309fef6697e3ac88a0b15902585196fa3f7623ea08a731a9a2673" }, "downloads": -1, "filename": "datachunkpy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4432bfb137266ba37ff794146758a3b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3127, "upload_time": "2016-09-11T06:24:00", "url": "https://files.pythonhosted.org/packages/2b/84/690f69310fd526dc4a6c8756926762d21ebf16c510c17c779b83c5b37454/datachunkpy-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4432bfb137266ba37ff794146758a3b7", "sha256": "d1bbf648ab0309fef6697e3ac88a0b15902585196fa3f7623ea08a731a9a2673" }, "downloads": -1, "filename": "datachunkpy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4432bfb137266ba37ff794146758a3b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3127, "upload_time": "2016-09-11T06:24:00", "url": "https://files.pythonhosted.org/packages/2b/84/690f69310fd526dc4a6c8756926762d21ebf16c510c17c779b83c5b37454/datachunkpy-1.0.0.tar.gz" } ] }