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
Name | Type | Default | Description |
---|---|---|---|
source | Union[str, Path, bytes] | - | Source of the file content. Binary file-like objects are accepted. |
mime_type | str , optional | 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 | None | File size in bytes. If not provided, the size it auto-detected. |
destination | str , optional | 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"),
}
)