python-lottie  0.7.0+dev66cafb9
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.assets.FileAsset Class Reference

Asset referencing a file. More...

Inheritance diagram for lottie.objects.assets.FileAsset:
[legend]
Collaboration diagram for lottie.objects.assets.FileAsset:
[legend]

Public Member Functions

def __init__ (self)
 
def data (self)
 
- Public Member Functions inherited from lottie.objects.base.LottieObject
def to_dict (self)
 Serializes into a JSON object fit for the Lottie format. More...
 
def load (cls, lottiedict)
 Loads from a JSON object. More...
 
def find (self, search, propname="name")
 Recursively searches for child objects with a matching property. More...
 
def find_all (self, type, predicate=None, include_self=True)
 Find all child objects that match a predicate. More...
 
def clone (self)
 Returns a copy of the object. More...
 
def clone_into (self, other)
 
def __str__ (self)
 
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)
 

Public Attributes

 path
 Path to the directory containing a file. More...
 
 file_name
 Filename or data url. More...
 
 is_embedded
 Whether the file is embedded. More...
 
 id
 
- Public Attributes inherited from lottie.objects.helpers.VisualObject
 name
 
 match_name
 

Detailed Description

Asset referencing a file.

Lottie JSON
Lottie name Type Description Attribute
nm str   name
mn str   match_name
id str   id
u str Path to the directory containing a file.   path
p str Filename or data url.   file_name
e 0-1 int Whether the file is embedded.   is_embedded

Definition at line 31 of file assets.py.

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.assets.FileAsset.__init__ (   self)

Reimplemented from lottie.objects.helpers.VisualObject.

Definition at line 41 of file assets.py.

Member Function Documentation

◆ data()

def lottie.objects.assets.FileAsset.data (   self)
Returns a tuple (format, data) with the contents of the file

`format` is a string like "png", and `data` is just raw binary data.

If it's impossible to fetch this info, returns (None, None)

Definition at line 62 of file assets.py.

Member Data Documentation

◆ file_name

lottie.objects.assets.FileAsset.file_name

Filename or data url.

Definition at line 47 of file assets.py.

◆ id

lottie.objects.assets.FileAsset.id

Definition at line 54 of file assets.py.

◆ is_embedded

lottie.objects.assets.FileAsset.is_embedded

Whether the file is embedded.

Definition at line 49 of file assets.py.

◆ path

lottie.objects.assets.FileAsset.path

Path to the directory containing a file.

Definition at line 45 of file assets.py.


The documentation for this class was generated from the following file: