gwangyi / pystr

Python Decodable Struct with cffi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pystr

Python Struct tool

Installation

git clone https://github.com/gwangyi/pystr
python setup.py install

Usage

from pystr import Struct

class BaseCommand(Struct):
    _layout_ = dict(
        opcode=dict(
            offset=0,
        ),
        fua=dict(
            offset=1,
            bit=0,
        ),
        lba=dict(
            offset=2,
            width=64,
            endian='be'
        ),
    )
    opcode: Opcode
    fua: bool
    lba: int

About

Python Decodable Struct with cffi

License:MIT License


Languages

Language:Python 100.0%