class lance.BlobFile(io.RawIOBase)

Represents a blob in a Lance dataset as a file-like object.

Public members

BlobFile(inner: LanceBlobFile)

Internal only: To obtain a BlobFile use lance.dataset.Dataset.take_blobs().

close() None

Flush and close the IO object.

property closed : bool
readable() bool

Return whether object was opened for reading.

seek(offset: int, whence: int = 0) int

Change the stream position to the given byte offset.

seekable() bool

Return whether object supports random access.

tell() int

Return current stream position.

size() int

Returns the size of the blob in bytes.

readall() bytes

Read until EOF, using multiple read() call.

readinto(b: bytearray) int
__repr__() str

Return repr(self).

read(size=-1, /)
write()
classmethod BlobFile(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__iter__()

Implement iter(self).

__next__()

Implement next(self).

truncate()

Truncate file to size bytes.

flush()

Flush write buffers, if applicable.

writable()

Return whether object was opened for writing.

fileno()

Returns underlying file descriptor if one exists.

isatty()

Return whether this is an ‘interactive’ stream.

readline(size=-1, /)

Read and return a line from the stream.

readlines(hint=-1, /)

Return a list of lines from the stream.

writelines(lines, /)

Write a list of lines to stream.