Skip to main content

image_sequence Logo Library for representing file sequences.

Install

pip install image_sequence

Instantiate from a file path

from image_sequence import ImageSequence

ImageSequence("/mock/path/file.1001.exr")
ImageSequence("/mock/path/file.%04d.exr")
ImageSequence("/mock/path/file.####.exr")
ImageSequence("/mock/path/file.<UDIM>.exr")

Finding frame ranges on disk.

from image_sequence import ImageSequence, find_sequence_on_disk

seq = ImageSequence("/mock/path/file.####.exr")
seq.find_frames_on_disk()
True

seq = find_sequence_on_disk("/mock/path/file.####.exr")
ImageSequence("/mock/path/file.####.exr")

Frame padding

from image_sequence import ImageSequence

seq = ImageSequence("/mock/path/file.101.exr")
print(seq.padding)
3
print(seq.path)
"/mock/path/file.%03d.exr"

seq.padding = 4
print(seq.path)
"/mock/path/file.%04d.exr"

Updating the sequence

from image_sequence import ImageSequence

seq = ImageSequence("/mock/path/file.1001.exr")
print(seq.path)
"/mock/path/file.%04d.exr"

print(seq.name)
"file"

seq.name = "newName"
print(seq.path)
"/mock/path/newName.%04d.exr"

print(seq.ext)
".exr"

seq.ext = ".jpg"
print(seq.path)
"/mock/path/newName.%04d.jpg"

seq.ext = ".exr"

print(seq.basename)
"newName.%04d.exr"

print(seq.dirname)
"/mock/path"

# Changing the padding style.
seq.padding_style = "@"
print(seq)
"/mock/path/newName.@@@@.exr"

# There is a built in UDIM type.
seq.padding_style = ImageSequence.UDIM_STYLE
print(seq.path)
"/mock/path/newName.<UDIM>.exr"

# The padding style can be set on the constructor.
seq = ImageSequence("/mock/path/fileName.1001.exr", padding_style=ImageSequence.UDIM_STYLE)
print(seq.path)
"/mock/path/fileName.<UDIM>.exr"

Formatting Image sequence (None of these methods will affect the sequence object).

from image_sequence import ImageSequence

seq = ImageSequence("/mock/path/file.1001.exr")
seq.eval_at_frame(9999)
"/mock/path/file.9999.exr"

print(seq.format_with_padding_style("#"))
"/mock/path/file.####.exr"

print(seq.format_with_padding_style("@", padding=2))
"/mock/path/file.@@.exr"

# The custom frame toke will only be set if frames exist.
print(seq.optional_frame_token_format("$F"))
"/mock/path/file.$F.exr"

seq = ImageSequence("/mock/path/file.exr")
print(seq.optional_frame_token_format("$F"))
"/mock/path/file.exr"

Frame ranges

from image_sequence import ImageSequence

seq = ImageSequence("/mock/path/file.1001.exr")
print(seq.frames)
[1001]

# Set frame range.
seq.frames = [10, 20, 30, 40]

# Querying frame range info
print(seq.start)
10

print(seq.end)
40

Get List of File Paths

from image_sequence import ImageSequence

seq = ImageSequence("/mock/path/file.###.exr")
seq.frames = [10, 20, 30, 40]
print(seq.get_paths())
[
    "/mock/path/file.010.exr",
    "/mock/path/file.020.exr",
    "/mock/path/file.030.exr",
    "/mock/path/file.040.exr"

]

# You can also offset the frame range.
print(seq.get_paths(offset=10))
[
    "/mock/path/file.020.exr",
    "/mock/path/file.030.exr",
    "/mock/path/file.040.exr",
    "/mock/path/file.050.exr"
]

License

Apache License 2.0

Metadata

Release files for image-sequence 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for image-sequence 1.0.0
File Size Uploaded Provenance Actions
image_sequence-1.0.0.tar.gz 17.6 kB Without provenance Details for image_sequence-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for image-sequence 1.0.0
File Interpreter ABI Platform Actions
image_sequence-1.0.0-py3-none-any.whl Python 3 none any Details for image_sequence-1.0.0-py3-none-any.whl

Total release size: 33.0 kB

Release files / image_sequence-1.0.0.tar.gz

Download URL image_sequence-1.0.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cf6fb5749282db3cad100580552bac089ff16aa217c75062141defb68823bb83
BLAKE2b-256 checksum
How to use checksums
578900b5662573514e28ee12252648de3c14c072373d43eff4474e087ba146a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / image_sequence-1.0.0-py3-none-any.whl

Download URL image_sequence-1.0.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1233fac466316ec682ce7fce6879e2b51794e702044da4ae72ea162041e031d6
BLAKE2b-256 checksum
How to use checksums
2de50c56d650a60c6e3da0e6b4b1e3b5ee317c3c7290897a3aaea889e70201f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Security for image-sequence 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page