ScanSeq - High-Performance File Sequence Detection
Fast, Rust-powered library and Python extension for detecting numbered file sequences in VFX, animation, and media production pipelines.
Features
- Parallel Scanning: Uses jwalk for fast directory traversal
- Memory Efficient: Pre-computed digit groups, mask-based grouping
- Smart Detection: Automatically picks longest sequence when files have multiple number groups
- Missing Frame Tracking: Identifies gaps in sequences automatically
Quick Start
Rust API
use ;
Add to Cargo.toml:
[]
= { = "path/to/scanseq-rs" }
Python API
# Create scanner (runs automatically on construction)
=
# Access results via scanner.result
# Static methods
=
=
# Convert Seq to dict
= # or seq.to_dict()
# Rescan with same settings
CLI
# Show help
# Scan paths and print results
# Recursive scan
# With mask filter
# JSON output
API Reference
Rust
Scanner
Stateful scanner with configuration and results:
ScanResult
get_seqs
Low-level scanning function:
Seq
Sequence struct:
Python
Scanner
Stateful scanner class that runs on construction:
=
Attributes:
# list[str] - directories scanned
# bool
# str | None
# int
# ScanResult - scan results
Static Methods:
# Single path
# Multiple paths
Instance Methods:
# Re-scan with current settings
# Number of sequences
# Iterate over sequences
...
ScanResult
# list[Seq] - detected sequences
# float - scan duration in ms
# list[str] - errors encountered
# Number of sequences
# Iterate over sequences
...
Seq
Sequence object with frame information:
# "shot_####.exr" (#### = padded, @ = unpadded)
# First frame number
# Last frame number
# Padding width (4 for 0001)
# list[int] - actual frames present
# list[int] - missing frames
# Methods
# Get path for specific frame
# True if no missing frames
# All frame paths in range
# Convert to dictionary
# Also works via Mapping protocol
# Number of files
CLI
)
)
)
)
Installation
From Source
# Build CLI
# Install Python module
Architecture
Algorithm
- Scan: Parallel directory traversal with jwalk
- Parse: Extract digit groups from filenames, create masks
- Group: Hash by mask (e.g.,
render_@.exr), sub-group by anchors - Detect: Find frame numbers, compute padding, identify gaps
Pattern Notation
####- Padded sequences (e.g.,0001,0002)@- Unpadded sequences (e.g.,1,2,100)
Examples:
render_####.exr->render_0001.exr,render_0002.exrshot_@.png->shot_1.png,shot_2.png
Development
# Run tests
# Build with Python
# Python module dev install