Skip to content

sift_py.file_attachment.metadata

Module containing optional metadata types to provide to Sift when uploading a file attachment. Though optional, providing this information could help improve quality of renders on the Sift app.

CLASS DESCRIPTION
ImageMetadata

Metadata for image media-types i.e. any mimetypes of the following pattern: image/*.

Metadata
VideoMetadata

Metadata for video media-types i.e. any mimetypes of the following pattern: video/*.

ImageMetadata

ImageMetadata(width: int, height: int)

Bases: AsProtobuf, Metadata

Metadata for image media-types i.e. any mimetypes of the following pattern: image/*.

METHOD DESCRIPTION
as_json
as_pb
from_pb
ATTRIBUTE DESCRIPTION
height

TYPE: int

width

TYPE: int

height instance-attribute

height: int = height

width instance-attribute

width: int = width

as_json

as_json() -> Any

as_pb

as_pb(klass: Type[ImageMetadata]) -> ImageMetadata

from_pb classmethod

from_pb(message: ImageMetadata) -> Self

Metadata

Bases: AsJson

VideoMetadata

VideoMetadata(
    width: int,
    height: int,
    duration_seconds: float,
    timestamp: Optional[datetime] = None,
)

Bases: AsProtobuf, Metadata

Metadata for video media-types i.e. any mimetypes of the following pattern: video/*.

METHOD DESCRIPTION
as_json
as_pb
from_pb
ATTRIBUTE DESCRIPTION
duration_seconds

TYPE: float

height

TYPE: int

timestamp

TYPE: Optional[datetime]

width

TYPE: int

duration_seconds instance-attribute

duration_seconds: float = duration_seconds

height instance-attribute

height: int = height

timestamp instance-attribute

timestamp: Optional[datetime] = timestamp

width instance-attribute

width: int = width

as_json

as_json() -> Any

as_pb

as_pb(klass: Type[VideoMetadata]) -> VideoMetadata

from_pb classmethod

from_pb(message: VideoMetadata) -> Self