In SmartyPy -
record = sp.record(x=1,y=3,z="something")
bytes = sp.pack(record)
pprint(vars(bytes))
gives something like -
{'__initialized': True,
'_f': 'pack',
'_l': [(record ("my_contract.py" 6) (x (literal (intOrNat 1) ("my_contract.py" 6))) (y (literal (intOrNat 3) ("my_contract.py" 6))) (z (literal (string "something") ("my_contract.py" 6)))),
<smartpy.LineNo object at 0x103593340>],
'attributes': {},
'onUpdateHandlers': [],
'opens': {}}
In taquito Michel codec package we have pack and packDataBytes, see example below -
const data: MichelsonData = {
prim: 'Pair', args: [{ int: '1' }, { int: '3' }, { string:"something" }]
};
const typ: MichelsonType = {
prim: 'pair', args: [{ prim: 'int' }, { prim: 'int' }, { prim:"string" }]
};
const packedBytes = packDataBytes(data, typ);
// { bytes: "0507070707000100030100000009736f6d657468696e67" }
both give you different format in terms of bytes. I would like to understand your needs and how you want to equate taquito bytes representation with SmartPy's representation.
Kunal