opatio.catalog.entry module

class opatio.catalog.entry.CardCatalogEntry(index: FloatVectorIndex, byteStart: int, byteEnd: int, sha256: bytes)[source]

Bases: OPATEntity

Structure to hold the card catalog information for an OPAT file.

index

Index values of the table.

Type:

FloatVectorIndex

byteStart

Byte start position of the table.

Type:

int

byteEnd

Byte end position of the table.

Type:

int

sha256

SHA-256 hash of the table data.

Type:

bytes

ascii() str[source]

Generate an ASCII representation of the card catalog entry.

copy() CardCatalogEntry[source]

Create a copy of the card catalog entry.

Examples

>>> from opatio.index.floatvectorindex import FloatVectorIndex
>>> entry = CardCatalogEntry(
...     index=FloatVectorIndex([1.0, 2.0, 3.0]),
...     byteStart=0,
...     byteEnd=128,
...     sha256=b'' * 32
... )
>>> print(entry)
CardCatalogEntry(index=FloatVectorIndex([1.0, 2.0, 3.0]), byteStart=0, byteEnd=128, sha256=b'' * 32)
ascii() str[source]

Generate an ASCII representation of the card catalog.

Returns:

The ASCII representation of the card catalog.

Return type:

str

Examples

>>> entry = CardCatalogEntry(
...     index=FloatVectorIndex([1.0, 2.0]),
...     byteStart=0,
...     byteEnd=64,
...     sha256=b'' * 32
... )
>>> print(entry.ascii())
1.00     | 2.00     | 0              64             b'\x00\x00\x00\x00'...
byteEnd: int
byteStart: int
copy() CardCatalogEntry[source]

Create a copy of the card catalog entry.

Returns:

A copy of the card catalog entry.

Return type:

CardCatalogEntry

Examples

>>> entry = CardCatalogEntry(
...     index=FloatVectorIndex([1.0, 2.0]),
...     byteStart=0,
...     byteEnd=64,
...     sha256=b'' * 32
... )
>>> entry_copy = entry.copy()
index: FloatVectorIndex
sha256: bytes