ShareFile
Represents a file to share, either from disk or in-memory bytes.
Properties
-
data(bytes | None) –Raw bytes of the file to share.
-
mime_type(str | None) –MIME type of the file.
-
name(str | None) –Optional name of the file.
-
path(str | None) –Filesystem path to the file to share.
Methods
-
from_bytes–Create ShareFile from raw bytes.
-
from_path–Create ShareFile from a filesystem path.
Properties#
data: bytes | None = None
class-attribute
instance-attribute
#
Raw bytes of the file to share.
mime_type: str | None = None
class-attribute
instance-attribute
#
MIME type of the file.
name: str | None = None
class-attribute
instance-attribute
#
Optional name of the file.
path: str | None = None
class-attribute
instance-attribute
#
Filesystem path to the file to share.
Methods#
from_bytes(data: bytes, *, mime_type: str | None = None, name: str | None = None) -> ShareFile
staticmethod
#
Represents a file to share, either from disk or in-memory bytes.
Properties
-
data(bytes | None) –Raw bytes of the file to share.
-
mime_type(str | None) –MIME type of the file.
-
name(str | None) –Optional name of the file.
-
path(str | None) –Filesystem path to the file to share.
Methods
-
from_bytes–Create ShareFile from raw bytes.
-
from_path–Create ShareFile from a filesystem path.
Properties#
data: bytes | None = None
class-attribute
instance-attribute
#
Raw bytes of the file to share.
mime_type: str | None = None
class-attribute
instance-attribute
#
MIME type of the file.
name: str | None = None
class-attribute
instance-attribute
#
Optional name of the file.
path: str | None = None
class-attribute
instance-attribute
#
Filesystem path to the file to share.