Skip to main content
App version: 3.4.10

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() function.

Parameters

NameTypeDefaultDescription
sourceUnion[str, Path, bytes]-Source of the file content.
Binary file-like objects are accepted.
mime_typestr, optionalNoneMIME type of the file. For example "image/png", "text/csv". Max 128 characters. If not provided, the MIME type is auto-detected.
sizeint, optionalNoneFile size in bytes. If not provided, the size it auto-detected.
destinationstr, optionalNoneDestination 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"),
}
)