modal.types

Public data types returned by Modal APIs.

modal.types.BillingReportItem 

Costs generated by a specific object during a specific time interval.

Attributes

object_id str
description str
environment_name str
interval_start datetime
cost Decimal
cost_by_resource dict[str, Decimal]
tags dict[str, str]

modal.types.DictInfo 

Information about a Dict object.

Attributes

name str | None
created_at datetime
created_by str | None

modal.types.FileEntry 

A file or directory entry listed from a Modal volume.

Attributes

path str
type FileEntryType
mtime int
size int

modal.types.FileEntryType 

class FileEntryType(enum.IntEnum)

Type of a file entry listed from a Modal volume.

The possible values are:

  • UNSPECIFIED
  • FILE
  • DIRECTORY
  • SYMLINK
  • FIFO
  • SOCKET

modal.types.FileInfo 

Metadata for a file or directory entry in a Sandbox.

Attributes

name str
path str
type FileType
size int
mode int
permissions str
owner str
group str
modified_time float
symlink_target str | None

is_file 

is_file(self)

Return True if this entry is a regular file.

is_dir 

is_dir(self)

Return True if this entry is a directory.

is_symlink(self)

Return True if this entry is a symbolic link.

modal.types.FileType 

class FileType(enum.Enum)

Type of a filesystem entry.

The possible values are:

  • FILE
  • DIRECTORY
  • SYMLINK

modal.types.FileWatchEvent 

A filesystem change event reported by Sandbox.filesystem.watch().

paths contains the absolute path(s) affected by the event. For most event types it holds a single entry. Rename operations are reported as Modify events: when both the source and destination fall within the watched scope, paths holds [source, destination]; when only one side of the rename is visible, paths holds that single path.

Attributes

paths list[str]
type FileWatchEventType

modal.types.FileWatchEventType 

class FileWatchEventType(enum.Enum)

Type of a filesystem watch event reported by Sandbox.filesystem.watch().

The possible values are:

  • Unknown
  • Access
  • Create
  • Modify
  • Remove

modal.types.FunctionStats 

Simple data structure storing stats for a running function.

Attributes

backlog int
num_total_runners int
num_running_inputs int
input_headroom int

modal.types.InputInfo 

Simple data structure storing information about a function input.

Attributes

input_id str
function_call_id str
task_id str
status InputStatus
function_name str
module_name str
children list["InputInfo"]

modal.types.InputStatus 

class InputStatus(enum.IntEnum)

Enum representing status of a function input.

The possible values are:

  • PENDING
  • SUCCESS
  • FAILURE
  • INIT_FAILURE
  • TERMINATED
  • TIMEOUT

modal.types.ProxyTokenInfo 

Metadata about a proxy token, not including the token secret.

Attributes

token_id str
created_at datetime
scoped bool

modal.types.QueueInfo 

Information about a Queue object.

Attributes

name str | None
created_at datetime
created_by str | None

modal.types.SandboxConnectCredentials 

Simple data structure storing credentials for making HTTP connections to a sandbox.

Attributes

url str
token str

modal.types.SecretInfo 

Information about a Secret object.

Attributes

name str | None
created_at datetime
created_by str | None

modal.types.TokenData 

A token ID / secret pair.

Attributes

token_id str
token_secret str

modal.types.VolumeCreateOptions 

Options used when creating a Volume.

Attributes

experimental_options NotRequired[dict[str, Any]]

modal.types.VolumeInfo 

Information about a Volume object.

Attributes

name str | None
created_at datetime
created_by str | None

modal.types.WorkspaceMemberInfo 

Metadata about a Workspace member.

Attributes

name str
email str
user_id str
role str
joined_at datetime
last_active_at Optional[datetime]

modal.types.WorkspaceSettings 

Current settings for the workspace.

Attributes

default_environment str
image_builder_version str