python-lottie  0.6.10+devbd5499b
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.base.LottieObject Class Reference

Base class for mapping Python classes into Lottie JSON objects. More...

Inheritance diagram for lottie.objects.base.LottieObject:
[legend]
Collaboration diagram for lottie.objects.base.LottieObject:
[legend]

Public Member Functions

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 __str__ (self)
 
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)
 

Detailed Description

Base class for mapping Python classes into Lottie JSON objects.

Definition at line 224 of file base.py.

Member Function Documentation

◆ __str__()

◆ clone()

def lottie.objects.base.LottieObject.clone (   self)

Returns a copy of the object.

Reimplemented from lottie.objects.base.LottieBase.

Reimplemented in lottie.objects.base.CustomObject, lottie.objects.bezier.Bezier, and lottie.objects.composition.Composition.

Definition at line 295 of file base.py.

◆ find()

def lottie.objects.base.LottieObject.find (   self,
  search,
  propname = "name" 
)

Recursively searches for child objects with a matching property.

Parameters
searchThe value of the property to search
propnameThe name of the property used to search

Definition at line 251 of file base.py.

◆ find_all()

def lottie.objects.base.LottieObject.find_all (   self,
  type,
  predicate = None,
  include_self = True 
)

Find all child objects that match a predicate.

Parameters
typeType (or tuple of types) of the objects to match
predicateFunction that returns true on the objects to find
include_selfWhether should counsider self for a potential match

Definition at line 272 of file base.py.

◆ load()

def lottie.objects.base.LottieObject.load (   cls,
  lottiedict 
)

Loads from a JSON object.

Returns
An instance of the class

Reimplemented from lottie.objects.base.LottieBase.

Reimplemented in lottie.objects.shapes.Group, lottie.objects.properties.PositionValue, lottie.objects.base.CustomObject, and lottie.objects.composition.Composition.

Definition at line 236 of file base.py.

◆ to_dict()

def lottie.objects.base.LottieObject.to_dict (   self)

Serializes into a JSON object fit for the Lottie format.

Reimplemented from lottie.objects.base.LottieBase.

Reimplemented in lottie.objects.base.CustomObject.

Definition at line 228 of file base.py.


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