Skip to navigation

aistore.sdk.obj.content_iterator.sequential

View as MarkdownOpen in Claude

Module Contents

Classes

NameDescription
ContentIterProviderProvide an iterator to open an HTTP response stream and read chunks of object content.

API

class aistore.sdk.obj.content_iterator.ContentIterProvider()

Bases: BaseContentIterProvider

Provide an iterator to open an HTTP response stream and read chunks of object content.

Parameters:

client
ObjectClient

ObjectClient — Client for accessing contents of an individual object.

chunk_size
int

Size of each chunk of data yielded from the response stream.

aistore.sdk.obj.content_iterator.ContentIterProvider.create_iter(
offset: int = 0,
) -> typing.Generator[bytes, None, None]

Create an iterator over the object content, applying an optional offset.

Parameters:

offset
intDefaults to 0

The offset in bytes to apply. If not provided, no offset is applied.

bounds
StreamBoundsDefaults to None

StreamBounds — Receives the byte positions of this stream.

aistore.sdk.obj.content_iterator.ContentIterProvider.read_all() -> bytes

Read all object content into memory in a single request.