Code or library to encode in STEIM12


is the code or library used to convert miniSEED payloads to STEIM available somewhere?

I found the libmseed library obspy/obspy/io/mseed/src/libmseed at master · obspy/obspy · GitHub

Any tips on how to encode data into STEIM without writing it inside a miniSEED packet using the library? I would like to encode a data array into STEIM1/2 from obspy/Python but without having to save the data into miniSEED