4 from ..objects
import Animation
9 Reads both tgs and lottie files, returns the json structure
15 if isinstance(file, str):
16 with open(file,
"r", encoding=encoding)
as fileobj:
19 if isinstance(file, io.TextIOBase)
and hasattr(file,
"buffer"):
25 binfile.seek(binfile.tell())
28 except (io.UnsupportedOperation, OSError):
32 final_file = gzip.open(binfile,
"rb")
33 elif isinstance(file, io.TextIOBase):
36 final_file = io.TextIOWrapper(file, encoding=encoding)
38 return on_open(final_file)
43 Reads both tgs and lottie files
46 return Animation.load(lottie)
def open_maybe_gzipped(file, on_open, encoding="utf-8")
def parse_tgs(filename, encoding="utf-8")
Reads both tgs and lottie files.
def parse_tgs_json(file, encoding="utf-8")
Reads both tgs and lottie files, returns the json structure.