Skip to content

Commit 5be4105

Browse files
committed
Update README
1 parent 322d8c1 commit 5be4105

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,37 @@ fileseq.FileSequence("/foo/bar.1-10x0.25#.#.exr", allow_subframes=True)
125125
'/foo/bar.0010.exr']
126126
```
127127

128+
### Get List of File Paths as `pathlib.Path` instances
129+
`fileseq.FilePathSequence` supports the same semantics as `fileseq.FileSequence` but represents result paths as [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) instances instead of strings.
130+
131+
```python
132+
>>> seq = fileseq.FilePathSequence("/foo/bar.1-10#.exr")
133+
>>> [seq[idx] for idx, fr in enumerate(seq.frameSet())]
134+
[PosixPath('/foo/bar.0001.exr'),
135+
PosixPath('/foo/bar.0002.exr'),
136+
PosixPath('/foo/bar.0003.exr'),
137+
PosixPath('/foo/bar.0004.exr'),
138+
PosixPath('/foo/bar.0005.exr'),
139+
PosixPath('/foo/bar.0006.exr'),
140+
PosixPath('/foo/bar.0007.exr'),
141+
PosixPath('/foo/bar.0008.exr'),
142+
PosixPath('/foo/bar.0009.exr'),
143+
PosixPath('/foo/bar.0010.exr')]
144+
```
145+
128146
## Finding Sequences on Disk
129147

130148
### Check a Directory for All Existing Sequences
131149
```python
132150
seqs = fileseq.findSequencesOnDisk("/show/shot/renders/bty_foo/v1")
133151
```
134152

153+
Or, to get results as `pathlib.Path`, use the `FilePathSequence` classmethod:
154+
155+
```python
156+
seqs = fileseq.FilePathSequence.findSequencesOnDisk("/show/shot/renders/bty_foo/v1")
157+
```
158+
135159
### Check a Directory for One Existing Sequence.
136160
* Use a '@' or '#' where you might expect to use '*' for a wildcard character.
137161
* For this method, it doesn't matter how many instances of the padding character you use, it will still find your sequence.

0 commit comments

Comments
 (0)