Skip to main content

Methods

Get a data directory by its ID.

Parameters

id
str
required

Returns

GetDataDirectoryResponse
GetDataDirectoryResponse
🔗 GetDataDirectoryResponseThe data directory data

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.get(
    id="id_value",
)
Delete a data directory, optionally including its contents.

Parameters

id
str
required
delete_contents
typing.Optional[bool]

Returns

EmptyResponse
EmptyResponse
🔗 EmptyResponseEmpty response indicating successful deletion

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.delete(
    id="id_value",
    delete_contents="value",
)
List data directories with optional filtering by FQN, ML Repo, or name.

Parameters

fqn
typing.Optional[str]
Fully qualified name to filter data directories by
ml_repo_id
typing.Optional[str]
ID of the ML Repo to filter data directories by
name
typing.Optional[str]
Name of the data directory to filter by
limit
typing.Optional[int]
Maximum number of data directories to return
offset
typing.Optional[int]
Number of data directories to skip for pagination

Returns

SyncPager[DataDirectory, ListDataDirectoriesResponse]
SyncPager[DataDirectory, ListDataDirectoriesResponse]
🔗 ListDataDirectoriesResponseList of data directories matching the query with pagination information

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.list(
    fqn="value",
    ml_repo_id="value",
    name="value",
    limit=10,
    offset=10,
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Create or update a data directory.

Parameters

manifest
DataDirectoryManifest
required
🔗 DataDirectoryManifestManifest containing metadata for the data directory to apply

Returns

GetDataDirectoryResponse
GetDataDirectoryResponse
🔗 GetDataDirectoryResponseThe created or updated data directory

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.create_or_update(
    manifest={"key": "value"},
)
List files and directories in a data directory.

Parameters

id
str
required
ID of the artifact version to list files from
path
typing.Optional[str]
Relative path within the artifact version to list files from (defaults to root)
limit
typing.Optional[int]
Maximum number of files/directories to return
page_token
typing.Optional[str]
Token to retrieve the next page of results

Returns

SyncPager[FileInfo, ListFilesResponse]
SyncPager[FileInfo, ListFilesResponse]
🔗 ListFilesResponseList of files and directories with pagination information

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.list_files(
    id="id_value",
    path="value",
    limit=10,
    page_token="value",
)
Delete files from a data directory.

Parameters

id
str
required
ID of the artifact version to delete files from
paths
typing.Sequence[str]
required
List of relative file paths within the artifact version to delete

Returns

EmptyResponse
EmptyResponse
🔗 EmptyResponseEmpty response indicating successful deletion

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.delete_files(
    id="id_value",
    paths="value",
)
Get pre-signed URLs for reading or writing files in a data directory.

Parameters

id
str
required
ID of the artifact version to get signed URLs for
paths
typing.Sequence[str]
required
List of relative file paths within the artifact version to get signed URLs for
operation
Operation
required
🔗 OperationOperation type for the signed URL (e.g., ‘READ’ or ‘WRITE’)

Returns

GetSignedUrLsResponse
GetSignedUrLsResponse
🔗 GetSignedUrLsResponseList of signed URLs for the requested file paths

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.get_signed_urls(
    id="id_value",
    paths="value",
    operation="value",
)
Create a multipart upload for large files in a data directory.

Parameters

id
str
required
ID of the artifact version to upload files to
path
str
required
Relative path within the artifact version where the file should be uploaded
num_parts
int
required
Number of parts to split the upload into for multipart upload

Returns

MultiPartUploadResponse
MultiPartUploadResponse
🔗 MultiPartUploadResponseMultipart upload information including signed URLs for each part

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.create_multipart_upload(
    id="id_value",
    path="value",
    num_parts="value",
)
Get Data Directory by FQN.

Parameters

fqn
str
required
FQN of the data directory

Returns

GetDataDirectoryResponse
GetDataDirectoryResponse
🔗 GetDataDirectoryResponseData directory details

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.data_directories.get_by_fqn(
    fqn="value",
)