This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

DataChunk is an useful library for proessing messages in a stream where messages are sent in a stream as shown below: <msg-size><msg-bytes><msg-size><msg-bytes><msg-size>…. msg-size is a 4 byte integer (little-endian) whenever a complete message is read, DataChunk calls the handle_msg method of the handler.

A message may come in fragments. Sometimes many messages may come in a single data packet. All we need to do is to call process_chunk method of DataChunk and DataChunk object will take care of re-assembling the messages as and when needed.

Basic example

from __future__ import print_function
from struct import pack
import random
from datachunkpy.datachunk import DataChunk, MessageHandler

# A message handler class
class MyMsgHandler(MessageHandler):
    def __init__(self):
        self.msg_processed = 0
        self.bytes_processed = 0

    def handle_msg(self, data):
        print('I am handling', data)
        self.msg_processed += 1
        self.bytes_processed += len(data)

datach = DataChunk(MyMsgHandler())

i = 0
mydata = b''
total_bytes = 0
while i < 10000:
    i += 1
    j = random.randint(1,50)
    mydata += pack('i', j)
    mydata += b'a' * j
    total_bytes += j
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
datachunkpy-1.0.0.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Sep 11, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting