Cliquers

crates.io

Manage filesequences with a common numeric component in Rust.

Usage

```rust use cliquers

let files = vec![ "/shot/task/main/render.1001.exr", "/shot/task/main/render.1002.exr", "/shot/task/main/render.1003.exr", "/shot/task/main/render.1004.exr", "/shot/task/main/render.1005.exr", ]; let (collections, remainders) = cliquers.assemble(&files, None); let c = &collections[0];

// access structure of file sequence asserteq!(c.head, "/shot/task/main/render."); asserteq!(c.tail, ".exr"); asserteq!(c.padding, 4); asserteq!(c.indexes, vec![1001, 1002, 1003, 1004, 1005]); asserteq!(c.format(None), "/shot/task/main/render.%04d.exr [1001-1005]"); asserteq!(c.format(Some("{head}####{tail}")), "/shot/task/main/render.####.exr");

// iterate over files of filesequence let mut iter = c.intoiter(); asserteq!(iter.next(), Some("/shot/task/main/render.1001.exr".to_string())); ```

Documentation

Origin

This library is a direct port of the fantastic Python module Clique.

This is still a work in progress, so is not a complete port... yet!