Drop

class liquid.LiquidObject(*args, **kwargs)

Bases: Protocol

__liquid_getattr__(name: str, context: RenderContext) → object

Return the value of a Liquid property.

The context is available for resolving values that depend on the current render context. Implementations should raise an AttributeError exception when a property cannot be resolved.

This synchronous method is used during synchronous rendering.

__liquid_hasattr__(name: str, context: RenderContext) → bool

Return whether a Liquid property with the given name exists.

The context is available for property-existence checks that depend on the current render context. Implementations should distinguish between a missing property and an existing property whose value is None.

class liquid.LiquidAsyncObject(*args, **kwargs)

Bases: Protocol

async __liquid_getattr_async__(name: str, context: RenderContext) → object

Asynchronously resolve a Liquid property.

This method is used during asynchronous rendering. Implementations may override it when resolving a property requires asynchronous work.

async __liquid_hasattr_async__(name: str, context: RenderContext) → bool

Asynchronously determine whether a Liquid property exists.

This method is used during asynchronous rendering. Implementations may override it when checking property existence requires asynchronous work.

class liquid.LiquidIterable(*args, **kwargs)

Bases: Protocol

__liquid_iter__(offset: int, limit: int | None, reversed_: bool) → IterableDrop[object]

Return a Liquid iterable.

class liquid.LiquidAsyncIterable(*args, **kwargs)

Bases: Protocol

async __liquid_iter_async__(offset: int, limit: int | None, reversed_: bool) → IterableDrop[object] | AsyncIterableDrop[object]

Return a asynchronous Liquid iterable.

class liquid.LiquidPrimitive(*args, **kwargs)

Bases: Protocol

__liquid__(hint: ContextHint, context: RenderContext) → object

Convert this Drop to a Liquid primitive type.

The hint identifies the requested representation: