fileseq

3.1.1 · active · verified Thu Apr 16

fileseq (version 3.1.1) is a Python library designed for robust parsing and manipulation of file sequences and frame ranges commonly found in VFX and animation workflows. It supports various frame range shorthands, including standard, comma-delimited, chunked, and staggered ranges, as well as negative frames and subframes. The library maintains an active development status with regular patch and minor releases.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to create `FileSequence` and `FrameSet` objects, access their properties, iterate through individual file paths, and utilize `FilePathSequence` for pathlib.Path integration.

from fileseq import FileSequence, FrameSet, FilePathSequence

# Create a FileSequence from a string pattern
seq_str = "/path/to/render/my_shot.1001-1010#.exr"
sequence = FileSequence(seq_str)

print(f"Original sequence: {sequence}")
print(f"Directory: {sequence.dirname()}")
print(f"Basename: {sequence.basename()}")
print(f"Frame range: {sequence.frameRange()}")
print(f"Padding: {sequence.padding()}")

# Iterate over individual file paths
print("Individual files:")
for frame_path in sequence:
    print(f"  {frame_path}")

# Access frames via FrameSet
frames = FrameSet("1-100x5") # Every fifth frame from 1 to 100
print(f"\nFrameSet 1-100x5: {frames}")
print(f"First frame: {frames.start()}")
print(f"Last frame: {frames.end()}")

# Using FilePathSequence for pathlib.Path objects (v2.2.0+)
path_seq = FilePathSequence("/path/to/images/shot_v01.1-50@@.jpg")
print(f"\nFilePathSequence: {path_seq}")
print(f"First path (pathlib.Path): {path_seq.frame(path_seq.start())}")

view raw JSON →