ccsdspy.utils.split_packet_bytes(file, include_primary_header=True)[source]

Retrieve a list of bytes objects corresponding to each packet in a file.

This function works with mixed files containing multiple APIDs, which may include both fixed length and variable length packets.

If end of last packet doesn’t align with end of file, a warning is issued.

filestr, file-like

Path to file on the local file system, or file-like object


If set to False, excludes the primary header bytes (the first six)

packet_byteslist of bytes

List of bytes objects associated with each packet as it appears in the file. When include_primary_header=False, each byte object will have its primary header bytes excluded.