Class BlobAccessor (2.29.0)

BlobAccessor(data: bigframes.series.Series)

Blob functions for Series and Index.

Properties

session

API documentation for session property.

Methods

audio_transcribe

audio_transcribe(
    *,
    engine: typing.Literal["bigquery"] = "bigquery",
    connection: typing.Optional[str] = None,
    model_name: typing.Optional[
        typing.Literal["gemini-2.0-flash-001", "gemini-2.0-flash-lite-001"]
    ] = None,
    verbose: bool = False
) -> bigframes.series.Series

Transcribe audio content using a Gemini multimodal model.

Exceptions
Type Description
ValueError If engine is not 'bigquery'.
RuntimeError If the transcription result structure is invalid.
Returns
Type Description
bigframes.series.Series str or struct[str, str], depend on the "verbose" parameter. Contains the transcribed text from the audio file. Includes error messages if verbosity is enabled.

authorizer

authorizer() -> bigframes.series.Series

Authorizers of the Blob.

Returns
Type Description
bigframes.series.Series Autorithers(connection) as string.

content_type

content_type() -> bigframes.series.Series

Retrieve the content type of the Blob.

Returns
Type Description
bigframes.series.Series string of the content type.

display

display(
    n: int = 3,
    *,
    content_type: str = "",
    width: typing.Optional[int] = None,
    height: typing.Optional[int] = None
)

Display the blob content in the IPython Notebook environment. Only works for image type now.

exif

exif(
    *,
    engine: typing.Literal[None, "pillow"] = None,
    connection: typing.Optional[str] = None,
    max_batching_rows: int = 8192,
    container_cpu: typing.Union[float, int] = 0.33,
    container_memory: str = "512Mi",
    verbose: bool = False
) -> bigframes.series.Series

Extract EXIF data. Now only support image types.

Exceptions
Type Description
ValueError If engine is not 'pillow'.
RuntimeError If EXIF extraction fails or returns invalid structure.
Returns
Type Description
bigframes.series.Series JSON series of key-value pairs if verbose=False, or struct with status and content if verbose=True.

get_runtime_json_str

get_runtime_json_str(
    mode: str = "R", *, with_metadata: bool = False
) -> bigframes.series.Series

Get the runtime (contains signed URL to access gcs data) and apply the ToJSONSTring transformation.

Returns
Type Description
str the runtime object in the JSON string.

image_blur

image_blur(
    ksize: tuple[int, int],
    *,
    engine: typing.Literal[None, "opencv"] = None,
    dst: typing.Optional[typing.Union[str, bigframes.series.Series]] = None,
    connection: typing.Optional[str] = None,
    max_batching_rows: int = 8192,
    container_cpu: typing.Union[float, int] = 0.33,
    container_memory: str = "512Mi",
    verbose: bool = False
) -> bigframes.series.Series

Blurs images.

Exceptions
Type Description
ValueError If engine is not 'opencv' or parameters are invalid.
RuntimeError If image blur operation fails.
Returns
Type Description
bigframes.series.Series blob Series if destination is GCS. Or bytes Series if destination is BQ. If verbose=True, returns struct with status and content.

image_normalize

image_normalize(
    *,
    engine: typing.Literal[None, "opencv"] = None,
    alpha: float = 1.0,
    beta: float = 0.0,
    norm_type: str = "l2",
    dst: typing.Optional[typing.Union[str, bigframes.series.Series]] = None,
    connection: typing.Optional[str] = None,
    max_batching_rows: int = 8192,
    container_cpu: typing.Union[float, int] = 0.33,
    container_memory: str = "512Mi",
    verbose: bool = False
) -> bigframes.series.Series

Normalize images.

Exceptions
Type Description
ValueError If engine is not 'opencv' or parameters are invalid.
RuntimeError If image normalize operation fails.
Returns
Type Description
bigframes.series.Series blob Series if destination is GCS. Or bytes Series if destination is BQ. If verbose=True, returns struct with status and content.

image_resize

image_resize(
    dsize: tuple[int, int] = (0, 0),
    *,
    engine: typing.Literal[None, "opencv"] = None,
    fx: float = 0.0,
    fy: float = 0.0,
    dst: typing.Optional[typing.Union[str, bigframes.series.Series]] = None,
    connection: typing.Optional[str] = None,
    max_batching_rows: int = 8192,
    container_cpu: typing.Union[float, int] = 0.33,
    container_memory: str = "512Mi",
    verbose: bool = False
)

Resize images.

Exceptions
Type Description
ValueError If engine is not 'opencv' or parameters are invalid.
RuntimeError If image resize operation fails.
Returns
Type Description
bigframes.series.Series blob Series if destination is GCS. Or bytes Series if destination is BQ. If verbose=True, returns struct with status and content.

md5_hash

md5_hash() -> bigframes.series.Series

Retrieve the md5 hash of the Blob.

Returns
Type Description
bigframes.series.Series string of the md5 hash.

metadata

metadata() -> bigframes.series.Series

Retrieve the metadata of the Blob.

Returns
Type Description
bigframes.series.Series JSON metadata of the Blob. Contains fields: content_type, md5_hash, size and updated(time).

pdf_chunk

pdf_chunk(
    *,
    engine: typing.Literal[None, "pypdf"] = None,
    connection: typing.Optional[str] = None,
    chunk_size: int = 2000,
    overlap_size: int = 200,
    max_batching_rows: int = 1,
    container_cpu: typing.Union[float, int] = 2,
    container_memory: str = "1Gi",
    verbose: bool = False
) -> bigframes.series.Series

Extracts and chunks text from PDF URLs and saves the text as arrays of strings.

Exceptions
Type Description
ValueError If engine is not 'pypdf'.
RuntimeError If PDF chunking fails or returns invalid structure.
Returns
Type Description
bigframe.series.Series array[str] or struct[str, array[str]], depend on the "verbose" parameter. where each string is a chunk of text extracted from PDF. Includes error messages if verbosity is enabled.

pdf_extract

pdf_extract(
    *,
    engine: typing.Literal[None, "pypdf"] = None,
    connection: typing.Optional[str] = None,
    max_batching_rows: int = 1,
    container_cpu: typing.Union[float, int] = 2,
    container_memory: str = "1Gi",
    verbose: bool = False
) -> bigframes.series.Series

Extracts text from PDF URLs and saves the text as string.

Exceptions
Type Description
ValueError If engine is not 'pypdf'.
RuntimeError If PDF extraction fails or returns invalid structure.
Returns
Type Description
bigframes.series.Series str or struct[str, str], depend on the "verbose" parameter. Contains the extracted text from the PDF file. Includes error messages if verbosity is enabled.

read_url

read_url() -> bigframes.series.Series

Retrieve the read URL of the Blob.

Returns
Type Description
bigframes.series.Series Read only URLs.

size

size() -> bigframes.series.Series

Retrieve the file size of the Blob.

Returns
Type Description
bigframes.series.Series file size in bytes.

updated

updated() -> bigframes.series.Series

Retrieve the updated time of the Blob.

Returns
Type Description
bigframes.series.Series updated time as UTC datetime.

uri

uri() -> bigframes.series.Series

URIs of the Blob.

Returns
Type Description
bigframes.series.Series URIs as string.

version

version() -> bigframes.series.Series

Versions of the Blob.

Returns
Type Description
bigframes.series.Series Version as string.

write_url

write_url() -> bigframes.series.Series

Retrieve the write URL of the Blob.

Returns
Type Description
bigframes.series.Series Writable URLs.