TeslasuitDocumentation
APIs

TsLoader

teslasuit_sdk.ts_loader.TsLoader

Loads the TESLASUIT C API shared library and returns the library object.

By default the library is located via the TESLASUIT_API_LIB_PATH environment variable. A custom path may be provided via the lib_path constructor argument.

Methods#

__init__#

def __init__(lib_path: Optional[str] = None):

Set up the loader with an optional explicit library path.

Parameters

lib_path: Optional[str] = None

Absolute path to the TESLASUIT C API shared library. If None, the path is read from the TESLASUIT_API_LIB_PATH environment variable.

Raises

AssertionError

If the current Python interpreter is not 64-bit.


load#

def load() -> Optional[CDLL]:

Load the TESLASUIT C API library and return the library object.

Tries the configured path first; falls back to the system library search via ctypes.util.find_library(). Prints a diagnostic message and returns None if the library cannot be found on the system path.

Returns: ctypes.CDLL or ctypes.WinDLL or None

The loaded library object, or None if it could not be found.