parsing and manipulation tool for file sequences
Project description
PySequitur
Library for identifying and manipulating sequences of files. It is geared towards visual effects and animation related scenarios, although it can be used with any sequence of files. Emphasis on file system manipulation and flexible handing of anomalous sequences is the main differentiating feature from other similar libraries.
CLI and integration for Nuke coming soon.
No external dependencies, easy to use in VFX pipeline with no privileges.
Features
-
File Sequence Handling
- Parse and manage frame-based file sequences
- Support for many naming conventions and patterns
- Handle missing or duplicate frames, inconsistent padding
-
Flexible Component System
- Parse filenames into components (prefix, delimiter, frame number, suffix, extension)
- Modify individual components while preserving others
- Match sequences against optionally specified components
-
Sequence Operations
- Rename sequences
- Move sequences around
- Delete sequences
- Copy sequences
- Offset frame numbers
- Adjust or repair frame number padding
Installation
# TODO: Add installation instructions once package is published
Quick Start
from pathlib import Path
from pysequitur import FileSequence, Components
# Parse sequences from a directory
sequences = FileSequence.find_sequences_in_path(Path("/path/to/files"))
# Create a virtual sequence from a list of file names
file_list = ["render_001.exr", "render_002.exr", "render_003.exr"]
sequence = FileSequence.find_sequences_in_filename_list(file_list)[0]
# Basic sequence operations
sequence.move_to(Path("/new/directory"))
sequence.rename_to(Components(prefix="new_name"))
sequence.offset_frames(100) # Shift all frame numbers by 100
sequence.delete_files()
new_sequence = sequence.copy_to(Components(prefix="new_name"), Path("/new/directory"))
# Match sequences by components
components = Components(prefix="render", extension="exr")
matches = FileSequence.match_components_in_path(components, Path("/path/to/files"))
# Match sequence by pattern string
sequence = FileSequence.match_sequence_string_in_directory("render_####.exr", Path("/path/to/files"))
Core Classes
Components
Configuration class for specifying filename components during operations. Any parameter can be None.
components = Components(
prefix="file_name",
delimiter=".",
padding=4,
suffix="_final",
extension="exr",
frame_number=None # Optional frame number for specific frame operations
)
Equals: "file_name.####_final.exr"
FileSequence
Main class. Manages collections of related Items as a single unit, where Items represent single files.
Key Features:
- Static methods for finding sequences in directories or filename lists
- Match sequences against Components or sequence string patterns
- Sequence manipulation operations (rename, move, copy, delete)
- Frame operations (offset, padding adjustment)
- Sequence analysis (missing frames, duplicates, problems detection)
- Existence status checking (TRUE, FALSE, PARTIAL)
File Naming Convention
The library parses filenames into the following components:
<prefix><delimiter><frame><suffix>.<extension>
Example: render_001_final.exr
- prefix: "render"
- delimiter: "_"
- frame: "001"
- suffix: "_final"
- extension: "exr"
See examples folder for more usage scenarios
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysequitur-0.1.11.tar.gz.
File metadata
- Download URL: pysequitur-0.1.11.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19bb349cba281ac3244a7596513a821242bc39e80cd913921beadaa7349b705e
|
|
| MD5 |
16d978cb1c91b9ca903b6ef874074fd8
|
|
| BLAKE2b-256 |
4a6fa2e43d636439ff9536e9866dac64f103d0462f8736651b456fb25baf66ad
|
File details
Details for the file pysequitur-0.1.11-py3-none-any.whl.
File metadata
- Download URL: pysequitur-0.1.11-py3-none-any.whl
- Upload date:
- Size: 45.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5df32f38b6707b142c0ec8994e49c47a484e6073d89ee0f6f3855c2c01ded86
|
|
| MD5 |
9e20ddbe824ead2764aabc9f93da66bf
|
|
| BLAKE2b-256 |
3aec6582bf1937e4504dc23afb16cdeb9435a11e530572bbff9e550e638cf1ed
|