module documentation

Convert between file types

Exception FormatError Undocumented
Function component_to_csv No summary
Function component_to_json No summary
Function component_to_text No summary
Function csv_to_component No summary
Function extension_to_type No summary
Function format_to_extension No summary
Function image_to_image No summary
Function json_to_component No summary
Function text_to_component No summary
Constant CONVERT_FORMATS Undocumented
def component_to_csv(component: TIComponent, **kwargs) -> bytes: (source)
Returns
bytesA list of lists (CSV rows) representing component given some parameters, or errors
def component_to_json(component: TIComponent, **kwargs) -> bytes: (source)
Returns
bytesThe JSON representation of component given some parameters, or errors
def component_to_text(component: TIComponent, **kwargs) -> bytes: (source)
Returns
bytesThe text representation of component given some parameters, or errors
def csv_to_component(contents: str, out_ext: str, args): (source)
Returns
The csv rows converted to a TIComponent (or perhaps several) supporting file extension out_ext
def extension_to_type(ext: str) -> type[TIComponent]: (source)
Returns
type[TIComponent]The TIComponent subtype having extension ext
def format_to_extension(fmt: str, *, model: TIModel) -> str: (source)
Returns
strThe file extension for fmt corresponding to model
def image_to_image(infile: bytes, out_ext: str) -> bytes: (source)
Returns
bytesThe bytes of infile in out_ext format, or errors
def json_to_component(dct: dict, out_ext: str, args): (source)
Returns
The JSON dct converted to a TIComponent supporting file extension out_ext
def text_to_component(text: str, out_ext: str, args): (source)
Returns
The text text converted to a TIComponent supporting file extension out_ext
CONVERT_FORMATS: str = (source)

Undocumented

Value
'''
TIComplex         <-> json, txt
TIEquation        <-> json, txt
TIGDB             <-> json
TIGroup           <-> json
TIImage           <-> png, jpeg, etc. (requires PIL)
TILicense         <-> json, txt
...