Is there a consistent way of reading a c struct from a file back into a Python Dataclass?
E.g.
I have this c struct
struct boh {
uint32_t a;
int8_t b;
boolean c;
};
And I want to read it's data into its own python Dataclass
@dataclass
class Boh:
a: int
b: int
c: bool
Is there a way to decorate this class to make this somehow possible?
Note: for I've been reading bytes and offsetting them manually into the class when I'm creating it, I would like to know if there is a better option.