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
Metadata
VideoMetadata

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

ImageMetadata

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

Metadata

Bases: AsJson

METHOD DESCRIPTION
as_json

as_json abstractmethod

as_json() -> Any

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_pb
from_pb
as_json
ATTRIBUTE DESCRIPTION
width

TYPE: int

height

TYPE: int

duration_seconds

TYPE: float

timestamp

TYPE: Optional[datetime]

width instance-attribute

width: int = width

height instance-attribute

height: int = height

duration_seconds instance-attribute

duration_seconds: float = duration_seconds

timestamp instance-attribute

timestamp: Optional[datetime] = timestamp

as_pb

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

from_pb classmethod

from_pb(message: VideoMetadata) -> Self

as_json

as_json() -> Any

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_pb
from_pb
as_json
ATTRIBUTE DESCRIPTION
width

TYPE: int

height

TYPE: int

width instance-attribute

width: int = width

height instance-attribute

height: int = height

as_pb

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

from_pb classmethod

from_pb(message: ImageMetadata) -> Self

as_json

as_json() -> Any