latch_cli.services.deprecated package#

Submodules#

latch_cli.services.deprecated.mkdir module#

latch_cli.services.deprecated.mkdir.mkdir(remote_directory)[source]#

Creates an empty directory on Latch

Parameters

remote_directory

A valid path to a remote destination, of the form

[latch://] [/] dir_1/dir_2/…/dir_n/dir_name,

where dir_name is the name of the new directory to be created. Every directory in the path (dir_i) must already exist.

This function will create a directory at the specified path in Latch. Will error if the path is invalid or if an upstream directory does not exist. If a directory with the same name already exists, this will make a new directory with an indexed name (see below).

Example:

mkdir("sample") # sample doesn't already exist

    Creates a new empty directory visible in Latch Console called sample, located in
    the root of the user's Latch filesystem

mkdir("latch:///dir1/dir2/sample") # dir1/dir2/sample already exists

    Creates a new directory visible in Latch Console called "sample\ 1" (note the
    escaped space), located in the nested directory dir1/dir2/.

mkdir("/dir1/doesnt_exist/dir2/sample.txt") # doesnt_exist doesn't exist

    Will throw an error, as this operation tries to create a directory
    inside of a directory that doesn't exist.

latch_cli.services.deprecated.rm module#

latch_cli.services.deprecated.rm.rm(remote_path: str)[source]#

Deletes an entity on Latch

Parameters

remote_path

A valid path to a remote destination, of the form

[latch://] [/] dir_1/dir_2/…/dir_n/entity_name,

where entity_name is the name of the entity to be removed.

This function will remove the entity at the remote path specified recursively (like rm -r on POSIX systems), and will error if the remote path specified is invalid or if the entity doesn’t exist.

Example:

rm("sample.txt") # sample.txt exists

    Removes the existing file sample.txt from Latch.

rm("latch:///dir1/dir2") # dir1/dir2/ exists and is nonempty

    Removes the directory dir1/dir2 along with all of its contents.

rm("/dir1/dir3/dir2/doesnt_exist.txt") # doesnt_exist.txt doesn't exist

    Will throw an error, as this operation tries to remove a file
    that doesn't exist.

latch_cli.services.deprecated.touch module#

latch_cli.services.deprecated.touch.touch(remote_file: str)[source]#

Creates an empty text file on Latch

Parameters

remote_file

A valid path to a remote destination, of the form

[latch://] [/] dir_1/dir_2/…/dir_n/filename,

where filename is the name of the new file to be created. Every directory in the path (dir_i) must already exist.

This function will create a node at the specified path in Latch, and directly create an empty file in AWS S3 using the boto3. It will error if the remote_path is invalid (i.e. if it contains a directory which doesn’t exist).

Example:

touch("sample.txt")

    Creates a new empty file visible in Latch Console called sample.txt, located in
    the root of the user's Latch filesystem

touch("latch:///dir1/dir2/sample.txt")

    Creates a new file visible in Latch Console called sample.fa, located in
    the nested directory /dir1/dir2/

touch("/dir1/doesnt_exist/dir2/sample.txt") # doesnt_exist doesn't exist

    Will throw an error, as this operation tries to create a file inside of a
    directory that doesn't exist.

Module contents#

Deprecated functions that will be removed in the near future