Metadata-Version: 1.1
Name: destructify
Version: 0.0.1
Summary: A Pythonic way to define, parse and modify binary structures
Home-page: https://github.com/ralphje/destructify
Author: Ralph Broenink
Author-email: ralph@ralphbroenink.net
License: MIT
Download-URL: https://github.com/ralphje/destructify/tarball/v0.0.1
Description: Destructify
        ===========
        
        Destructify is a Pythonic and pure-Python 3 method to express binary data, allowing you to read and write binary
        structures. You simply specify a structure by creating a class as follows::
        
            class ExampleStructure(destructify.Structure):
                some_number = destructify.BEIntegerField()
                length = destructify.UnsignedByteField(default=0, override=lambda s, v: len(s.data))
                data = destructify.FixedLengthField(length='length')
        
        Now you can parse your own binary data::
        
            example = ExampleStructure.from_bytes(b"\x01\x02\x03\x04\x0BHello world")
            print(example.data)  # b'Hello world'
        
        Or write your own data::
        
            example2 = ExampleStructure(data=b'How are you doing?')
            print(bytes(example2))  # b'\x00\x00\x00\x00\x12How are you doing?'
        
        
Keywords: struct,bytes
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
