Skip to content

Parsers

This module contains the internal parsing functions that convert binary chunk data into Python dataclasses.

Main Parser

parse

Parse an After Effects (.aep) project file and return an App instance.

This is the main entry point for the library. It parses the binary RIFX data and returns an App object whose project attribute holds the full project tree.

Parameters:

Example
import aep_parser

app = aep_parser.parse("project.aep")
project = app.project
print(app.version)

parse_app

parse_app(aep: Aep, project: Project) -> App

Build an App from the parsed RIFX data and project.

Parameters:

  • aep

    (Aep) –

    The parsed Kaitai RIFX structure.

  • project

    (Project) –

    The already-parsed Project.

parse_project

parse_project(
    aep_file_path: str | PathLike[str],
) -> Project

Parse an After Effects (.aep) project file.

Deprecated

Use aep_parser.parse instead which returns an App instance. Access the project via app.project.

Parameters:

Item Parsers

parse_composition

Parse a composition item.

Parameters:

  • child_chunks

    (list[Chunk]) –

    child chunks of the composition LIST chunk.

  • item_id

    (int) –

    The unique item ID.

  • item_name

    (str) –

    The composition name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem) –

    The composition's parent folder.

  • comment

    (str) –

    The composition comment.

parse_footage

Parse a footage item.

Parameters:

  • child_chunks

    (list[Chunk]) –

    The footage item child chunks.

  • item_id

    (int) –

    The item's unique id.

  • item_name

    (str) –

    The item's name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem) –

    The item's parent folder.

  • comment

    (str) –

    The item's comment.

parse_folder

Parse a folder item.

Parameters:

  • is_root

    (bool) –

    Whether the folder is the root folder (ID 0).

  • child_chunks

    (list[Chunk]) –

    child chunks of the folder LIST chunk.

  • project

    (Project) –

    The project.

  • item_id

    (int) –

    The unique item ID.

  • item_name

    (str) –

    The folder name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem | None) –

    The folder's parent folder.

  • comment

    (str) –

    The folder comment.

Layer Parser

parse_layer

parse_layer(
    layer_chunk: Chunk, composition: CompItem
) -> Layer

Parse a composition layer.

This layer is an instance of an item in a composition. Some information can only be found on the source item. To access it, use source_item = layer.source.

Parameters:

  • layer_chunk

    (Chunk) –

    The LIST chunk to parse.

  • composition

    (CompItem) –

    The composition.

Returns:

Property Parsers

parse_property_group

parse_property_group(
    tdgp_chunk: Chunk,
    group_match_name: str,
    time_scale: float,
) -> PropertyGroup

Parse a property group.

Parameters:

  • tdgp_chunk

    (Chunk) –

    The TDGP chunk to parse.

  • group_match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized. An indexed group (PropertyBase.property_type == Aep.PropertyType.indexed_group) may not have a name value, but always has a match_name value.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

parse_property

parse_property(
    tdbs_chunk: Chunk, match_name: str, time_scale: float
) -> Property

Parse a property.

Parameters:

  • tdbs_chunk

    (Chunk) –

    The TDBS chunk to parse.

  • match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

parse_effect

Parse an effect.

Parameters:

  • sspc_chunk

    (Chunk) –

    The SSPC chunk to parse.

  • group_match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized. An indexed group (PropertyBase.property_type == Aep.PropertyType.indexed_group) may not have a name value, but always has a match_name value.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

parse_markers

Parse markers.

Parameters:

  • mrst_chunk

    (Chunk) –

    The MRST chunk to parse.

  • group_match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized. An indexed group (PropertyBase.property_type == Aep.PropertyType.indexed_group) may not have a name value, but always has a match_name value.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

  • frame_rate

    (float) –

    The frame rate of the parent composition, used to compute marker duration in seconds.

Viewer Parser

parse_viewers

parse_viewers(root_folder_chunk: Chunk) -> list[Viewer]

Parse viewer panels from the Fold-level chunks.

The Fold chunk contains a repeating pattern of small metadata chunks that describe each viewer panel (Timeline, Composition, Layer, Footage). Each panel block is bounded by fvdv (start) and fifl (end), and may contain fips chunks that hold the per-view options.

The fitt chunk contains the inner tab type label (e.g. "AE Composition") which maps to ViewerType. The foac chunk indicates whether the outer panel is active.

Parameters:

  • root_folder_chunk

    (Chunk) –

    The LIST:Fold chunk.

Returns:

Render Queue Parsers

parse_render_queue

parse_render_queue(
    root_chunks: list[Chunk], project: Project
) -> RenderQueue

Parse the render queue from the top-level chunks.

Parameters:

  • root_chunks

    (list[Chunk]) –

    The top-level chunks from the AEP file.

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

parse_render_queue_items

parse_render_queue_items(
    lrdr_child_chunks: list[Chunk], project: Project
) -> list[RenderQueueItem]

Parse render queue items from the child chunks of LRdr.

The render queue items are stored in a LIST 'list' chunk directly under LRdr. Each item consists of: - An optional RCom chunk with the item comment - A LIST 'list' chunk with item metadata and settings - A LIST 'LOm ' chunk with output module info - A RenderSettingsLdatBody chunk with the render settings for the item - A Rout chunk with per-item render flags

Parameters:

  • lrdr_child_chunks

    (list[Chunk]) –

    The child chunks of the LRdr chunk.

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

parse_render_queue_item

parse_render_queue_item(
    list_chunk: Chunk,
    lom_chunk: Chunk,
    ldat_body: RenderSettingsLdatBody,
    render_enabled: bool,
    comment: str,
    project: Project,
) -> RenderQueueItem

Parse a single render queue item from its component chunks.

Parameters:

  • list_chunk

    (Chunk) –

    The LIST 'list' chunk containing item metadata.

  • lom_chunk

    (Chunk) –

    The LIST 'LOm ' chunk containing output modules.

  • ldat_body

    (RenderSettingsLdatBody) –

    The RenderSettingsLdatBody chunk for this item.

  • render_enabled

    (bool) –

    Whether the item is set to render when queue starts.

  • comment

    (str) –

    The comment for the render queue item (from RCom chunk).

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

parse_output_module

parse_output_module(
    chunks: list[Chunk],
    om_ldat_data: OutputModuleSettingsLdatBody,
    project: Project,
    render_queue_item: RenderQueueItem,
) -> OutputModule

Parse an output module from its chunk group.

Each output module consists of: - Roou: Output options (binary data) - Ropt: Render options (binary data) - hdrm: HDR metadata - Utf8: Template settings JSON (usually "{}") - LIST Als2: Output file path info - alas: JSON with fullpath and target_is_folder - Utf8: Template/format name (e.g., "H.264 - Match Render Settings - 15 Mbps") - Utf8: File name template (e.g., "[compName].[fileextension]" or "output.mp4")

Parameters:

  • chunks

    (list[Chunk]) –

    List of chunks belonging to this output module.

  • om_ldat_data

    (OutputModuleSettingsLdatBody) –

    Parsed OutputModuleSettingsLdatBody from LdatItem.

Returns: