File
Python package: neptune-scale
Specifies details of a file that you want to log to Neptune.
Pass the File
object as a dictionary value in the assign_files()
and log_files()
functions.
Parameters
source
str | Path | bytes
required
Source of the file content.
Binary file-like objects are accepted.
mime_type
str
optional
default: None
MIME type of the file. For example "image/png"
, "text/csv"
. Max 128 characters. If not provided, the MIME type is auto-detected.
size
int
optional
default: None
File size in bytes. If not provided, the size it auto-detected.
destination
str
optional
default: None
Destination path in the object storage, relative to the project namespace. Max 800 characters. If not provided, the path is autogenerated based on the file source.
Example
from neptune_scale import Run
from neptune_scale.types import File
with Run(...) as run:
run.assign_files(
{
"files/file.txt": File(source=b"Hello world!", mime_type="text/plain"),
}
)