brk-code

modal-client の API リファレンス

modal-client (modal-labs/modal-client) の公開 API 132 件 —— クラス 56、関数 57、メソッド 19。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: modal-labs/modal-client

種別件数
クラス56
関数57
メソッド19

API 一覧

classpy.modal._output.manager.DisabledStatusRow
No-op StatusRow used when output is disabled.
classpy.modal._output.rich.ProgressHandler
Internal handler for rich-based transfer progress display.
classpy.modal._output.rich.RichOutputManager
Rich-based implementation of OutputManager.
methodpy.modal._output.rich.RichOutputManager.add_status_row() -> StatusRow
Add a status row to the current object tree.
methodpy.modal._output.rich.RichOutputManager.print(renderable:Any, *stderr:bool=False, *highlight:bool=True, *style:str | None=None, *sep:str=' ', *end:str='\n') -> None
Print a renderable to the console.
methodpy.modal._output.rich.RichOutputManager.print_json(data:str) -> None
Print JSON data with formatting.
methodpy.modal._output.rich.RichOutputManager.put_fetched_log(log:api_pb2.TaskLogs, prefix:str='') -> None
Process and display log content with batched output.
methodpy.modal._output.rich.RichOutputManager.put_streaming_log(log:api_pb2.TaskLogs, prefix:str='') -> None
Process and display log content with immediate output.
methodpy.modal._output.rich.RichOutputManager.status(message:str) -> StatusContext
Create a status spinner context manager.
methodpy.modal._output.rich.RichOutputManager.step_completed(message:str) -> None
Print a step completed message.
methodpy.modal._output.rich.RichOutputManager.stop_status_spinner() -> None
Stop the status spinner if it's running.
classpy.modal._output.rich.RichStatusRow
Rich-backed implementation of StatusRow.
classpy.modal._runtime.container_io_manager.Sentinel
Used to get type-stubs to work with this object.
funcpy.modal._runtime.execution_context.current_input_id() -> str | None
Returns the input ID for the current input.
funcpy.modal._runtime.execution_context.is_local() -> bool
Indicate the execution context of the current process.
classpy.modal._runtime.gpu_memory_snapshot.CudaCheckpointException
Exception raised for CUDA checkpoint operations.
classpy.modal._runtime.gpu_memory_snapshot.CudaCheckpointState
State representation from the CUDA API [1].
classpy.modal._runtime.task_lifecycle_manager.UserException
Used to shut down the task gracefully.
funcpy.modal._serialization.deserialize(s:bytes, client) -> Any
Deserializes object and replaces all client placeholders by self.
funcpy.modal._serialization.serialize_data_format(obj:Any, data_format:int) -> bytes
Similar to serialize(), but supports other data formats.
classpy.modal._tunnel.Tunnel
A port forwarded from within a running Modal container.
methodpy.modal._tunnel.Tunnel.tcp_socket() -> tuple[str, int]
Get the public TCP socket as a (host, port) tuple.
methodpy.modal._tunnel.Tunnel.tls_socket() -> tuple[str, int]
Get the public TLS socket as a (host, port) tuple.
methodpy.modal._tunnel.Tunnel.url() -> str
Get the public HTTPS URL of the forwarded port.
classpy.modal._utils.async_utils.TaskContext
A structured group that helps manage stray tasks.
methodpy.modal._utils.async_utils.TaskContext.gather(*coros:Awaitable) -> Any
Wait for a sequence of coroutines to finish, concurrently.
funcpy.modal._utils.async_utils.asyncnullcontext(*args, **kwargs)
Async noop context manager.
funcpy.modal._utils.async_utils.iterate_blocking(iterator:Iterator[T]) -> AsyncGenerator[T, None]
Iterate over a blocking iterator in an async context.
funcpy.modal._utils.async_utils.rewrite_sync_to_async(code_line:str, original_func:Callable) -> tuple[bool, str]
Rewrite a blocking call to use async/await syntax.
funcpy.modal._utils.browser_utils.open_url_and_display(url:str, target:str) -> None
Open a URL in the web browser and display it to the user.
funcpy.modal._utils.curl_utils.find_url(curl_args:tuple[str, ...]) -> str | None
Find the Modal direct URL operand within a curl argument list.
funcpy.modal._utils.docker_utils.extract_copy_command_patterns(dockerfile_lines:Sequence[str]) -> list[str]
Extract all COPY command sources from a Dockerfile.
funcpy.modal._utils.function_utils.exc_with_hints(exc:BaseException)
mdmd:hidden
funcpy.modal._utils.function_utils.is_top_level_function(f:Callable) -> bool
Returns True if this function is defined in global scope.
classpy.modal._utils.grpc_utils.CustomProtoStatusDetailsCodec
grpclib compatible details codec.
funcpy.modal._utils.grpc_utils.create_channel(server_url:str, metadata:dict[str, str]={}) -> grpclib.client.Channel
Creates a grpclib.Channel to be used by a GRPC stub.
funcpy.modal._utils.grpc_utils.find_free_port() -> int
Find a free TCP port, useful for testing.
funcpy.modal._utils.grpc_utils.get_server_retry_policy(exc:Exception) -> api_pb2.RPCRetryPolicy | None
Get server retry policy.
funcpy.modal._utils.mount_utils.validate_only_modal_volumes(volumes:dict[str | PurePosixPath, _Volume] | None, caller_name:str) -> Sequence[tuple[str, _Volume]]
Validate all volumes are `modal.Volume`.
classpy.modal._utils.pattern_utils.Pattern
Defines a single regex pattern used to filter file paths.
methodpy.modal._utils.pattern_utils.Pattern.compile(separator:str) -> None
Compile the pattern into a regular expression.
methodpy.modal._utils.pattern_utils.Pattern.match(path:str) -> bool
Check if the path matches the pattern.
funcpy.modal._utils.rand_pb_testing.rand_pb(proto:type[T], rand:Random | None=None) -> T
Generate a pseudorandom protobuf message.
funcpy.modal._utils.sandbox_fs_utils.make_list_files_command(remote_path:str) -> str
Build the JSON command string for a ListFiles operation.
funcpy.modal._utils.sandbox_fs_utils.make_read_file_command(remote_path:str) -> str
Build the JSON command string for a ReadFile operation.
funcpy.modal._utils.sandbox_fs_utils.make_remove_command(remote_path:str, recursive:bool) -> str
Build the JSON command string for a Remove operation.
funcpy.modal._utils.sandbox_fs_utils.make_stat_command(remote_path:str) -> str
Build the JSON command string for a Stat operation.
funcpy.modal._utils.sandbox_fs_utils.make_write_file_command(remote_path:str) -> str
Build the JSON command string for a WriteFile operation.
funcpy.modal._utils.shell_utils.get_winsz(fd=None) -> tuple[int | None, int | None]
Get the window size of a terminal.
funcpy.modal._utils.shell_utils.set_nonblocking(fd:int)
Set a file descriptor to non-blocking mode.
funcpy.modal._utils.time_utils.as_timestamp(arg:datetime | str | None) -> float
Coerce a user-provided argument to a timestamp.
funcpy.modal._utils.time_utils.resolve_timezone(s:str) -> tzinfo
Resolve a timezone string to a tzinfo object.
classpy.modal.cli._help.ModalCommand
click.Command that renders --help with custom rich output.
funcpy.modal.cli._help.use_rich_style() -> bool
Whether help output should be rendered in the rich style.
funcpy.modal.cli.app.history(app_identifier:str, *env:str | None=None, *json:bool=False)
Show an App's deployment history.
funcpy.modal.cli.billing.summary(for_:str | None, json:bool)
Generate a billing summary for the workspace.
funcpy.modal.cli.bootstrap.bootstrap(name:str | None=None, output:str='.', force:bool=False) -> None
Initialize a sample Modal App.
funcpy.modal.cli.cluster.list_(env:str | None=None, json:bool=False)
List all clusters that are currently running.
funcpy.modal.cli.cluster.shell(cluster_id:str, rank:int=0)
Open a shell to a multi-node cluster node.
funcpy.modal.cli.container.exec(pty:bool | None=None, container_id:str='', command:tuple[str, ...]=())
Execute a command in a container.
funcpy.modal.cli.container.stop(container_id:str='', *graceful:bool=False, *yes:bool=False)
Terminate a running container.
funcpy.modal.cli.dashboard.dashboard(object_id:str | None=None)
Open the Modal Dashboard in a web browser.
funcpy.modal.cli.dict.create(name:str, *env:str | None=None)
Create a named Dict object.
funcpy.modal.cli.dict.get(name:str, key:str, *env:str | None=None)
Print the value for a specific key.
funcpy.modal.cli.dict.items(name:str, n:int=20, *all:bool=False, *use_repr:bool=False, *json:bool=False, *env:str | None=None)
Print the contents of a Dict.
funcpy.modal.cli.dict.list_(*json:bool=False, *env:str | None=None)
List all named Dicts.
funcpy.modal.cli.image.logs(image_id:str, layers:int | None, all_layers:bool) -> None
Fetch build logs for an Image.
funcpy.modal.cli.queues.create(name:str, *env:str | None=None)
Create a named Queue.
funcpy.modal.cli.queues.list_(*json:bool=False, *env:str | None=None)
List all named Queues.
classpy.modal.cli.run.LiteralIntParamType
A ParamType for Literal types containing only integers.
methodpy.modal.cli.selector.Selector.run(live:Live | None=None) -> str
Run an interactive selection loop.
funcpy.modal.cli.volume.cp(volume_name:str, paths:tuple[str, ...], recursive:bool=False, env:str | None=None)
Copy within a modal.Volume.
funcpy.modal.cli.workspace.settings_group(ctx:click.Context, json:bool)
View the current settings for the workspace.
funcpy.modal.cli.workspace.settings_set(setting:str, value:str)
Update a workspace setting.
classpy.modal.config.Config
Singleton that holds configuration used by Modal internally.
methodpy.modal.config.Config.get(key:str, *profile:str | None=None, *use_env:bool=True) -> Any
Look up a configuration value.
classpy.modal.exception.AuthError
Raised when a client has missing or invalid authentication.
classpy.modal.exception.DataLossError
Raised when data is lost or corrupted.
classpy.modal.exception.Error
Base class for all Modal errors.
classpy.modal.exception.ExecutionError
Raised when something unexpected happened during runtime.
classpy.modal.exception.ImageBuildError
Raised when an image build fails.
classpy.modal.exception.InternalError
Raised when an internal error occurs in the Modal system.
classpy.modal.exception.InternalFailure
Retriable internal error.
classpy.modal.exception.InvalidError
Raised when user does something invalid.
classpy.modal.exception.LogsFetchError
Raised when trying to fetch too many logs.
classpy.modal.exception.MountUploadTimeoutError
Raised when a Mount upload times out.
classpy.modal.exception.NotFoundError
Raised when a requested resource was not found.
classpy.modal.exception.OutputExpiredError
Raised when the Output exceeds expiration and times out.
classpy.modal.exception.RemoteError
Raised when an error occurs on the Modal server.
classpy.modal.exception.SandboxFilesystemDirectoryNotEmptyError
Raised when a directory is not empty.
classpy.modal.exception.SandboxFilesystemError
Base class for sandbox filesystem errors.
classpy.modal.exception.SnapshotCreationError
Raised when a Sandbox fails to create an exit snapshot.
classpy.modal.exception.TimeoutError
Base class for Modal timeouts.
classpy.modal.exception.VolumeUploadTimeoutError
Raised when a Volume upload times out.
classpy.modal.exception.WorkspaceManagementError
Raised when an error occurs while managing a workspace.
classpy.modal.experimental.AppLifecycle
Lifecycle information about an App.
funcpy.modal.experimental.get_app_lifecycle(app_id:str, *client:_Client | None=None) -> AppLifecycle
Get lifecycle information about an App.
funcpy.modal.experimental.image_delete(image_id:str, *client:_Client | None=None) -> None
Delete an Image by its ID.
funcpy.modal.experimental.stop_app(name:str, *environment_name:str | None=None, *client:_Client | None=None) -> None
Stop a deployed App.
funcpy.modal.file_io.ls(path:str, client:_Client, task_id:str) -> list[str]
List the contents of the provided directory.
funcpy.modal.file_io.mkdir(path:str, client:_Client, task_id:str, parents:bool=False) -> None
Create a new directory.
funcpy.modal.file_io.rm(path:str, client:_Client, task_id:str, recursive:bool=False) -> None
Remove a file or directory in the Sandbox.
funcpy.modal.file_io.watch(path:str, client:_Client, task_id:str, filter:list[FileWatchEventType] | None=None, recursive:bool=False, timeout:int | None=None) -> AsyncIterator[FileWatchEvent]
Watch a file or directory for changes.
funcpy.modal.mount.client_mount_name() -> str
Get the deployed name of the client package mount.
funcpy.modal.mount.python_standalone_mount_name(version:str) -> str
Get the deployed name of the python-build-standalone mount.
funcpy.modal.network_file_system.network_file_system_mount_protos(validated_network_file_systems:list[tuple[str, '_NetworkFileSystem']]) -> list[api_pb2.SharedVolumeMount]
mdmd:hidden
classpy.modal.retries.Retries
Adds a retry policy to a Modal function.
classpy.modal.retries.RetryManager
Helper class to apply the specified retry policy.
classpy.modal.runner.DeployResult
Dataclass representing the result of deploying an app.
classpy.modal.sandbox.Probe
Probe configuration for the Sandbox Readiness Probe.
classpy.modal.schedule.Period
Create a schedule that runs every given time interval.
classpy.modal.scheduler_placement.SchedulerPlacement
mdmd:hidden This is an experimental feature.
classpy.modal.types.DictInfo
Information about a Dict object.
classpy.modal.types.FileEntry
A file or directory entry listed from a Modal volume.
classpy.modal.types.FileEntryType
Type of a file entry listed from a Modal volume.
classpy.modal.types.FileInfo
Metadata for a file or directory entry in a Sandbox.
methodpy.modal.types.FileInfo.is_dir() -> bool
Return `True` if this entry is a directory.
methodpy.modal.types.FileInfo.is_file() -> bool
Return `True` if this entry is a regular file.
methodpy.modal.types.FileInfo.is_symlink() -> bool
Return `True` if this entry is a symbolic link.
classpy.modal.types.FileType
Type of a filesystem entry.
classpy.modal.types.FunctionStats
Simple data structure storing stats for a running function.
classpy.modal.types.InputStatus
Enum representing status of a function input.
classpy.modal.types.LogEntry
A log entry emitted by a Modal object.
classpy.modal.types.QueueInfo
Information about a Queue object.
classpy.modal.types.SecretInfo
Information about a Secret object.
classpy.modal.types.TokenData
A token ID / secret pair.
classpy.modal.types.VolumeCreateOptions
Options used when creating a Volume.
classpy.modal.types.VolumeInfo
Information about a Volume object.
classpy.modal.types.WorkspaceMemberInfo
Metadata about a Workspace member.
classpy.modal.types.WorkspaceSettings
Current settings for the workspace.
funcpy.modal_docs.gen_reference_docs.run(output_dir:str | None=None)
Generate Modal docs.
funcpy.modal_docs.mdmd.mdmd.module_items(module, filter_items:Callable[[ModuleType, str], bool])
Returns filtered members of module

この情報について

掲載しているシグネチャは modal-labs/modal-client の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る