class documentation

Interface for TI bundles

A bundle is a zip file with some metadata and a checksum.

Class Method get_extension Determines the file extension for a targeted model based on its contents
Static Method bundle Compress a list of TIFile objects into a bundle
Method __init__ Creates an empty file with a specified name
Method bytes No summary
Method load_bytes Loads a byte string or bytestream into this file
Method supported_by Determines whether this file supports a given model
Method targets Determines whether this file targets a given model
Method unbundle Unzips a bundle into a list of its files
Class Variable magics Undocumented
Instance Variable zipfile Undocumented
Property checksum The checksum for the bundle
Property comment This bundle's comment(s)
Property metadata The metadata fields of the bundle
Property model The model this bundle targets
Property target_type This bundle's target type
Property version This bundle's format version (which is usually 1)
Instance Variable _buffer Undocumented

Inherited from TIFile:

Class Method get_type Gets the subclass corresponding to file magic if one is registered
Class Method open Creates a new file given a filename
Class Method register Registers a subtype with this class for coercion
Method __bool__ No summary
Method __bytes__ No summary
Method __copy__ No summary
Method __eq__ Determines if two files are identical
Method __format__ Undocumented
Method __len__ No summary
Method get_filename Determines the filename based on the instance name and targeted model
Method load_file Loads this file from a file pointer
Method save Saves this file given a filename
Method summary No summary
Instance Variable name Undocumented
Property is_empty Whether this file is empty
Method __init_subclass__ Undocumented
Class Variable _magics Undocumented

Inherited from Dock (via TIFile):

Method load Loads data into an instance by delegating to Loader methods based on the input's type
Class Variable loaders Undocumented
def get_extension(cls, model: TIModel = TI_84PCE) -> str: (source)

Determines the file extension for a targeted model based on its contents

Parameters
model:TIModelThe model to target (defaults to this file's minimum supported model)
Returns
strThe file's extension
def bundle(files: list[TIFile], *, name: str = 'BUNDLE', model: TIModel = TI_84PCE, comment: str = 'Created with tivars_lib_py v1.1.0', target_type: str = 'CUSTOM', version: int = 1) -> TIBundle: (source)

Compress a list of TIFile objects into a bundle

Parameters
files:list[TIFile]The files to bundle
name:strThe name of the bundle (defaults to BUNDLE)
model:TIModelThe model this bundle should target (defaults to the TI-84+CE)
comment:strA comment to attach to this bundle (defaults to a simple lib message)
target_type:strThe target type for the bundle (defaults to CUSTOM)
version:intThe format version of the bundle (defaults to 1)
Returns
TIBundleA bundle containing files with the specified metadata
def __init__(self, *, name: str = 'BUNDLE', data: bytes = None): (source)

Creates an empty file with a specified name

Parameters
name:strThe name of the file (defaults to UNNAMED)
data:bytesThe file's data (defaults to empty)
def bytes(self) -> bytes: (source)
Returns
bytesThe bytes contained in this file
def load_bytes(self, data: bytes | BytesIO): (source)

Loads a byte string or bytestream into this file

Parameters
data:bytes | BytesIOThe bytes to load
def supported_by(self, model: TIModel) -> bool: (source)

Determines whether this file supports a given model

See .targets to check models this file explicitly targets.

Parameters
model:TIModelThe model to check support for
Returns
boolWhether model supports this file
def targets(self, model: TIModel) -> bool: (source)

Determines whether this file targets a given model

See .supported_by to check models this file _can_ be sent to.

Parameters
model:TIModelThe model to check as a target
Returns
boolWhether model is targeted by this file
def unbundle(self) -> list[TIFile]: (source)

Unzips a bundle into a list of its files

Returns
list[TIFile]A list of the files stored in this bundle

Undocumented

Undocumented

The checksum for the bundle

This is given as a sum of the CRC's of its files

This bundle's comment(s)

The metadata fields of the bundle

The model this bundle targets

target_type: str = (source)

This bundle's target type

This bundle's format version (which is usually 1)

Undocumented