esp_parser.types
Shared base types.
Classes:
|
An array of bytestrings. |
|
Base class for bytes subrecord types. |
|
Base class for cstring subrecord types - sequences of bytes prefixed with the size. |
Base class for collections of subrecords. |
|
|
Sequence of uint8 for FaceGen. |
|
Base class for float32 subrecords. |
|
An array of 4-byte long form IDs. |
|
Base class for 4-byte long form ID subrecord types. |
|
Base class for int16 subrecords. |
|
Base class for int32 subrecords. |
|
Base class for int8 subrecords. |
|
Base class for integer enums. |
|
Base class for int enum fields. |
|
Zero byte long marker. |
|
Used for unknown structures. |
|
Represents a record in an ESP file. |
Base class for records in ESP files. |
|
Base class for records in ESP files. |
|
|
Base class for uint16 subrecords. |
|
Base class for uint32 subrecords. |
|
Base class for uint8 subrecords. |
-
class
BytesArrayRecord(iterable=(), /)[source] Bases:
List[bytes],RecordTypeAn array of bytestrings.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
BytesRecordType(cstring: Union[str, bytes] = b'')[source] Bases:
RecordType,bytesBase class for bytes subrecord types.
Subclasses are responsible for parsing and unparsing.
-
class
CStringRecord(cstring: Union[str, bytes] = b'')[source] Bases:
BytesRecordTypeBase class for cstring subrecord types - sequences of bytes prefixed with the size.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Collection[source] Bases:
objectBase class for collections of subrecords.
Attributes:
Names of subrecords in this collection.
Methods:
parse_member(record_type, raw_bytes)Parse subrecords in this collection.
-
class
FaceGenRecord(iterable=(), /)[source] Bases:
ListSequence of uint8 for FaceGen.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Float32Record(*args, **kwargs)[source] Bases:
RecordType,floatBase class for float32 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
FormIDArrayRecord(iterable=(), /)[source] Bases:
BytesArrayRecordAn array of 4-byte long form IDs.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
FormIDRecord(cstring: Union[str, bytes] = b'')[source] Bases:
BytesRecordTypeBase class for 4-byte long form ID subrecord types.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Int16Record(*args, **kwargs)[source] Bases:
RecordType,intBase class for int16 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Int32Record(*args, **kwargs)[source] Bases:
RecordType,intBase class for int32 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Int8Record(*args, **kwargs)[source] Bases:
RecordType,intBase class for int8 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
MarkerRecord(*args, **kwargs)[source] Bases:
RecordTypeZero byte long marker.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
RawBytesRecord(cstring: Union[str, bytes] = b'')[source] Bases:
BytesRecordTypeUsed for unknown structures.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Record(flags, id, revision=0, version=15, unknown=b'\x00\x00', data=[])[source] Bases:
RecordTypeRepresents a record in an ESP file.
- Parameters
Attributes:
Subrecords of this record.
Record flags
4-byte form ID
Used for revision control by the Creation Kit, if enabled.
Form version
Methods:
parse(raw_bytes)Parse this record.
parse_subrecords(raw_bytes)Parse this record's subrecords.
unparse()Turn this record back into raw bytes for an ESP file.
-
data Type:
List[RecordType]Subrecords of this record.
-
protocol
RecordType[source] Bases:
ProtocolBase class for records in ESP files.
Classes that implement this protocol must have the following methods / attributes:
-
class
StructRecord[source] Bases:
RecordTypeBase class for records in ESP files.
Methods:
Returns a list of attributes on this class in the order they should be packed.
Returns the pack/unpack struct string and the corresponding size.
parse(raw_bytes)Parse this subrecord.
unparse()Turn this record back into raw bytes for an ESP file.
-
abstract static
get_field_names()[source] Returns a list of attributes on this class in the order they should be packed.
-
abstract static
get_struct_and_size()[source] Returns the pack/unpack struct string and the corresponding size.
-
abstract static
-
class
Uint16Record(*args, **kwargs)[source] Bases:
RecordType,intBase class for uint16 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.
-
class
Uint32Record(*args, **kwargs)[source] Bases:
RecordType,intBase class for uint32 subrecords.
Methods:
parse(raw_bytes)Parse this subrecord.
unparse()Turn this subrecord back into raw bytes for an ESP file.