Skip to content

Parsers

Main Entry Point

parse

parse(
    aep_file_path: str | PathLike[str],
    *,
    ae_preferences_dir: str | PathLike[str] | None = None,
) -> Application

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

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

Parameters:

  • aep_file_path (str | PathLike[str]) –

    Path to the .aep file.

  • ae_preferences_dir (str | PathLike[str] | None, default: None ) –

    Optional path to the AE preferences directory (e.g. C:/Users/<user>/AppData/Roaming/Adobe/After Effects/25.6). When provided, render settings and output module templates are parsed lazily when needed.

Example
import py_aep

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

new

new(
    version: str = _DEFAULT_NEW_VERSION,
    *,
    ae_preferences_dir: str | PathLike[str] | None = None,
) -> Application

Creates a new project in After Effects, replicating the File > New > New Project menu command.

Returns an Application wrapping an empty Project (containing only the root folder and an empty render queue).

Parameters:

  • version (str, default: _DEFAULT_NEW_VERSION ) –

    The After Effects version to stamp into the file, formatted as "{major}.{minor}x{build}" (e.g. "26.0x67"). A file stamped at version N opens in After Effects N and later.

  • ae_preferences_dir (str | PathLike[str] | None, default: None ) –

    Optional path to the AE preferences directory (e.g. C:/Users/<user>/AppData/Roaming/Adobe/After Effects/26.0), required only for adding items to the render queue.

Example
import py_aep

app = py_aep.new()
comp = app.project.root_folder.add_comp("Comp 1", 1920, 1080, 1.0, 10.0, 30.0)
app.project.save("new_project.aep")

Utilities

list_layers

list_layers(file: str | PathLike[str]) -> list[str]

Return the selectable layer names of a layered file, top layer first.

The order and contents match After Effects' "Choose Layer" import dropdown: leaf layers only, top-most first. Duplicate names are possible (Photoshop does not enforce unique layer names).

Parameters:

  • file (str | PathLike[str]) –

    Path to a .psd, .psb, .ai, or .pdf file.

Raises:

  • ValueError

    If the extension is not a layered format, or the file's layers cannot be enumerated (UnsupportedPsdLayersError / UnsupportedAiLayersError, both ValueError subclasses).