Python SDK 参考
Python SDK 参考
安装
用法
使用以下内容实例化和使用客户端:
异步客户端
SDK 还可以导出异步客户端,以便您可以对我们的 API 发起非阻塞调用。 注意,如果您正在构造要传递给此客户端的异步 httpx 客户端类,请使用 httpx.AsyncClient() 而不是 httpx.Client()(例如,用于此客户端的 httpx_client 参数)。
异常情况处理
当 API 返回非成功状态代码(4xx 或 5xx 响应)时,将抛出以下错误的子类。
分页
分页请求将返回 SyncPager 或 AsyncPager,它们可以用作底层对象的生成器。
高级
访问原始响应数据
SDK 通过 .with_raw_response 属性提供对原始响应数据(包括标头)的访问权限。 .with_raw_response 属性返回一个“原始”客户端,可用于访问 .headers 和 .data 属性。
重试
SDK 内置了具有指数退避机制的自动重试功能。 只要请求被视为可重试且重试次数未超过配置的重试限制(默认值:2),就会重试请求。
在返回以下任意 HTTP 状态代码时,该请求均被视为可重试:
- 408(超时)
- 429(请求过多)
- 5XX(内部服务器错误)
使用 max_retries 请求选项来配置此行为。
超时
SDK 的默认超时时间为 60 秒。 您可以在客户端或请求级别使用超时选项来配置此参数。
自定义客户端
您可以重写 httpx 客户端,针对您的用例进行自定义。 一些常见用例包括支持代理和传输。
参考
帐户权限
client.account_permissions.index(...) -> AsyncPager[AccountUserRole, AccountUserRolesResponse]
列出给定帐户的用户角色。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
include_deactivated: typing.Optional[bool] — 支持在响应中包含停用用户。默认值为 false。
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
帐户
client.accounts.index(...) -> AsyncPager[Account, AccountsResponse]
列出当前用户的帐户。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
after:typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.accounts.auditlog_index(...) -> AsyncPager[AuditLog, AuditLogsWithIncludesResponse]
通过查询参数提供筛选功能,列出审核日志。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
api_version: typing.Literal["4.0"] —
include: typing.Optional[typing.Literal["user"]] —
filters: typing.Optional[Filters] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
Auth
frameio.auth.ServerToServerAuth(*, client_id, client_secret, ...)
使用 OAuth 2.0 client_credentials 授权凭证进行身份验证。 此流程不涉及用户,也不会返回刷新令牌。 当访问令牌过期时,SDK 会使用客户端凭据自动请求新令牌。 对于异步用法,请使用 AsyncServerToServerAuth。
参数
client_id:str — Adobe IMS OAuth 客户端 ID。
client_secret:str — Adobe IMS OAuth 客户端密钥。
scopes:str — 以空格分隔的权限范围 (OAuth 2.0 RFC 6749)。 默认为 openid AdobeID frame.s2s.all。
ims_base_url:str — 用于暂存/备用环境的 IMS 基本 URL。 默认为生产环境。
http_client:typing.Optional[httpx.Client] — 可选的 httpx。适用于代理、TLS 或连接池的客户端。
on_token_refreshed:typing.Optional[typing.Callable[[dict[str, Any]], None]] — 每次令牌获取后触发的可选回调。
timeout:float — HTTP 请求超时时间(以秒为单位)。 默认为 30。
max_retries:int — 瞬态故障的最大重试次数。 默认为 2。
refresh_buffer:int — 过期时间前触发主动刷新的秒数。 默认为 60。 方法 get_token() -> str — 返回有效的访问令牌,必要时进行刷新。 将此方法引用(非调用)传递给 SDK:Frameio(token=auth.get_token)。 authenticate() -> dict[str, Any] — 显式获取新的访问令牌。 返回包含 access_token、expires_in 等的令牌响应字典。revoke() -> None — 撤销服务器端的两个令牌并清除本地状态。 export_tokens() -> dict[str, Any] — 导出当前令牌状态,实现持久性。 import_tokens(data: dict[str, Any]) -> None — 从之前导出的字典还原令牌状态。
frameio.auth.WebAppAuth(*, client_id, client_secret, redirect_uri, ...)
使用 OAuth 2.0 authorization_code 授权凭证进行身份验证。 将其用于可安全存储客户端密钥的服务器端应用程序。 对于异步用法,请使用 AsyncWebAppAuth。
参数
client_id:str — Adobe IMS OAuth 客户端 ID。
client_secret:str — Adobe IMS OAuth 客户端密钥。
redirect_uri:str — 已注册的重定向 URI。
scopes:str — 以空格分隔的权限范围 (OAuth 2.0 RFC 6749)。
ims_base_url:str — 用于暂存/备用环境的 IMS 基本 URL。 默认为生产环境。
http_client:typing.Optional[httpx.Client] — 可选的 httpx。适用于代理、TLS 或连接池的客户端。
on_token_refreshed:typing.Optional[typing.Callable[[dict[str, Any]], None]] — 每次令牌刷新后触发的可选回调。
timeout:float — HTTP 请求超时时间(以秒为单位)。 默认为 30。
max_retries:int — 瞬态故障的最大重试次数。 默认为 2。
refresh_buffer:int — 过期时间前触发主动刷新的秒数。 默认为 60。 方法 get_token() -> str — 返回有效的访问令牌,必要时进行刷新。 将此方法引用传递给 SDK:Frameio(token=auth.get_token)。 get_authorization_url(state: str) -> str — 构建 Adobe IMS 授权 URL。 传递一个不透明的 CSRF/状态值,该值将被回显。 exchange_code(code: str) -> dict[str, Any] — 使用授权代码交换访问令牌和刷新令牌。 refresh() -> dict[str, Any] — 手动触发令牌刷新。 revoke() -> None — 撤销服务器端的两个令牌并清除本地状态。 export_tokens() -> dict[str, Any] — 导出当前令牌状态,实现持久性。 import_tokens(data: dict[str, Any]) -> None — 从之前导出的字典还原令牌状态。
frameio.auth.SPAAuth(*, client_id, redirect_uri, ...)
使用 authorization_code + PKCE(无客户端密钥)进行身份验证。 将其用于无法安全存储客户端密钥的基于浏览器或原生的应用程序。 对于异步用法,请使用 AsyncSPAAuth。
参数
client_id:str — Adobe IMS OAuth 客户端 ID。
redirect_uri:str — 已注册的重定向 URI。
scopes:str — 以空格分隔的权限范围 (OAuth 2.0 RFC 6749)。
ims_base_url:str — 用于暂存/备用环境的 IMS 基本 URL。 默认为生产环境。
http_client:typing.Optional[httpx.Client] — 可选的 httpx。适用于代理、TLS 或连接池的客户端。
on_token_refreshed:typing.Optional[typing.Callable[[dict[str, Any]], None]] — 每次令牌刷新后触发的可选回调。
timeout:float — HTTP 请求超时时间(以秒为单位)。 默认为 30。
max_retries:int — 瞬态故障的最大重试次数。 默认为 2。
refresh_buffer:int — 过期时间前触发主动刷新的秒数。 默认为 60。 方法 get_token() -> str — 返回有效的访问令牌,必要时进行刷新。 将此方法引用传递给 SDK:Frameio(token=auth.get_token)。 get_authorization_url(state: str) -> AuthorizationUrlResult — 使用 PKCE 质询构建 Adobe IMS 授权 URL。 返回带有 url 和 code_verifier 属性的 AuthorizationUrlResult。 exchange_code(code: str, code_verifier: str) -> dict[str, Any] — 将授权代码 + PKCE 验证器交换为令牌。 refresh() -> dict[str, Any] — 手动触发令牌刷新。 revoke() -> None — 撤销服务器端的两个令牌并清除本地状态。 export_tokens() -> dict[str, Any] — 导出当前令牌状态,实现持久性。 import_tokens(data: dict[str, Any]) -> None — 从之前导出的字典还原令牌状态。
frameio.auth.AuthorizationUrlResult
由 SPAAuth.get_authorization_url() 和 AsyncSPAAuth.get_authorization_url() 返回的冻结数据类。 包含授权 URL 和 PKCE 代码验证器。 Attributes url:str — 要将用户重定向到的完整授权 URL。 code_verifier:str — 要存储并传递给 exchange_code() 的 PKCE 代码验证器。
frameio.auth.close_clients() / aclose_clients()
关闭身份验证模块使用的模块级 HTTP 客户端。 在应用程序关闭期间,在同步代码中调用 close_clients(),或在异步代码中调用 await aclose_clients() 以释放连接。
身份验证异常情况
所有身份验证异常情况均继承自 FrameioAuthError。
收藏集
client.collections.index(...) -> AsyncHttpResponse[CollectionsResponse]
列出项目的收藏集。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
project_id: Uuid —
include: typing.Optional[CollectionInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.collections.show(...) -> AsyncHttpResponse[CollectionResponse]
显示收藏集详细信息
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
collection_id: Uuid —
include: typing.Optional[CollectionInclude] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
评论
client.comments.show(...) -> AsyncHttpResponse[CommentWithIncludesResponse]
显示文件上的单条评论。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
comment_id: Uuid —
include: typing.Optional[CommentsShowRequestInclude] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.delete(...) -> AsyncHttpResponse[None]
从资产中删除评论。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
comment_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.update(...) -> AsyncHttpResponse[CommentResponse]
更新给定资产上的评论。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
comment_id: Uuid —
data: UpdateCommentParamsData
timestamp_as_timecode: typing.Optional[bool] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.index(...) -> AsyncPager[CommentWithIncludes, CommentsWithIncludesResponse]
列出给定资产上的评论。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
include: typing.Optional[CommentInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.create(...) -> AsyncHttpResponse[CommentResponse]
对文件发表评论。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
data: CreateCommentParamsData
timestamp_as_timecode: typing.Optional[bool] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.create_attachment(...) -> AsyncHttpResponse[CommentAttachmentResponse]
为现有评论创建附件
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
comment_id: Uuid —
data: AttachmentInput
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.comments.delete_attachment(...) -> AsyncHttpResponse[None]
删除评论中的附件.
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
comment_id: Uuid —
attachment_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
自定义操作
client.custom_actions.actions_index(...) -> AsyncHttpResponse[ActionsWithIncludesResponse]
列出给定工作区中的操作。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
include: typing.Optional[typing.Literal["creator"]] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.custom_actions.actions_show(...) -> AsyncHttpResponse[ActionWithIncludesResponse]
显示自定义操作详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
action_id: Uuid —
include: typing.Optional[typing.Literal["creator"]] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.custom_actions.actions_create(...) -> AsyncHttpResponse[ActionCreateResponse]
在工作区中创建自定义操作。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
data: ActionCreateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.custom_actions.actions_update(...) -> AsyncHttpResponse[ActionResponse]
更新自定义操作详细信息。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
action_id: Uuid —
data: ActionUpdateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.custom_actions.actions_delete(...) -> AsyncHttpResponse[None]
删除自定义操作。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
action_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
文件
client.files.list(...) -> AsyncHttpResponse[AssetsWithIncludesResponse]
列出给定文件夹中的文件。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include: typing.Optional[FileWithMediaLinksInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.create(...) -> AsyncHttpResponse[FileWithUploadUrlsResponse]
在主文件夹下创建新文件。创建文件(本地上传)和创建文件(远程上传)已替换此端点。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FileCreateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.show(...) -> AsyncHttpResponse[FileWithIncludesResponse]
显示文件详细信息。
使用 include 查询参数选择性地在响应中包含其他属性。
如果您包含 media_links.original 且用户无权下载文件,则此端点将响应 403 Forbidden 错误。如果由于该用户需要水印而请求的 media_links 不支持水印,导致内容无法访问,则请求将成功,但不支持的媒体链接将被设置为 null。 同样,如果请求的转码链接对于特定文件不存在(例如,在静态图像文件中包含 media_links.video_h264_180)或者转码过程尚未完成(即文件的状态为“已上传”而不是“已转码”),则响应负载中的链接也将被设置为 null。 简而言之,客户端必须妥善处理 null 媒体链接。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
file_id: Uuid —
include: typing.Optional[FileWithMediaLinksInclude] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.delete(...) -> AsyncHttpResponse[None]
按 ID 删除文件。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.update(...) -> AsyncHttpResponse[FileResponse]
更新文件详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
data: FileUpdateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.copy(...) -> AsyncHttpResponse[FileCopyResponse]
复制文件。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
copy_metadata: typing.Optional[bool] — 是否随文件一起复制元数据值
copy_comments: typing.Optional[FilesCopyRequestCopyComments] — 要随文件一起复制的评论
data: typing.Optional[FileCopyParamsData]
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.create_remote_upload(...) -> AsyncHttpResponse[FileRemoteUploadResponse]
通过远程上传在父文件夹下创建新文件。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FileCreateRemoteUploadParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.move(...) -> AsyncHttpResponse[FileResponse]
将文件移至文件夹或 version_stack。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
data: FileMoveParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.create_local_upload(...) -> AsyncHttpResponse[FileWithUploadUrlsResponse]
通过本地上传在父文件夹下创建新文件。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FileCreateLocalUploadParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.show_file_upload_status(...) -> AsyncHttpResponse[FileUploadStatusResponse]
显示文件上传状态详细信息。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
file_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.files.import_file(...) -> AsyncHttpResponse[FileResponse]
从帐户上配置的存储位置导入文件
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FileImportParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
文件夹权限
client.folder_permissions.folder_user_roles_index(...) -> AsyncHttpResponse[UserRolesResponse]
列出给定文件夹的用户角色
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include_deactivated: typing.Optional[bool] — 支持在响应中包含已停用的用户。默认值为 false。
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folder_permissions.folder_user_roles_update(...) -> AsyncHttpResponse[UpdateUserRolesResponse]
如果用户已添加到文件夹,则更新给定文件夹的用户角色。如果用户未添加到文件夹,则会添加该用户并分配给定角色。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
folder_id: Uuid —
user_id: Uuid —
data: UpdateUserRolesParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folder_permissions.delete(...) -> AsyncHttpResponse[None]
从指定文件夹中移除用户。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
folder_id: Uuid —
user_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
文件夹
client.folders.show(...) -> AsyncHttpResponse[FolderWithIncludesResponse]
显示文件夹详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include: typing.Optional[AssetInclude] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folders.delete(...) -> AsyncHttpResponse[None]
按 ID 删除文件夹。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
folder_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。.
client.folders.update(...) -> AsyncHttpResponse[FolderResponse]
更新文件夹详细信息。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FolderUpdateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。.
client.folders.index(...) -> AsyncHttpResponse[AssetsWithIncludesResponse]
列出给定文件夹中的次项。
使用 include 查询参数选择性地在响应中包含其他属性。
如果您包含 media_links.original 且用户无权下载相应项目中的文件,则此端点将响应 403 Forbidden 错误。如果由于该用户需要水印而请求的 media_links 不支持水印,导致内容无法访问,则请求将成功,但不支持的媒体链接将被设置为 null。 同样,如果请求的转码链接对于特定文件不存在(例如,在静态图像文件中包含 media_links.video_h264_180)或者转码过程尚未完成(即文件的状态为“已上传”而不是“已转码”),则响应负载中的媒体链接也将被设置为 null。 简而言之,客户端必须妥善处理 null 媒体链接。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include: typing.Optional[FileWithMediaLinksInclude] —
type: typing.Optional[ChildrenType] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folders.copy(...) -> AsyncHttpResponse[FolderCopyResponse]
复制文件夹。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
folder_id: Uuid —
copy_metadata: typing.Optional[bool] — 是否随文件夹一起复制元数据值
data: typing.Optional[FolderCopyParamsData]
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folders.list(...) -> AsyncHttpResponse[FoldersWithIncludesResponse]
列出给定文件夹中的文件夹。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include: typing.Optional[AssetInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.folders.create(...) -> AsyncHttpResponse[FolderResponse]
在给定的 folder_id 路径参数内创建新文件夹。
速率限制:每个 account_user 每 1 秒钟 3 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FolderCreateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。.
client.folders.move(...) -> AsyncHttpResponse[FolderResponse]
将文件夹移动到另一个文件夹。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: FolderMoveParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。.
组
client.groups.index(...) -> AsyncHttpResponse[GroupsWithIncludesResponse]
列出帐户中的组
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
include: typing.Optional[typing.Literal["creator"]] —
sort: typing.Optional[GroupsIndexRequestSort] — 按查询参数对组进行排序
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.groups.show(...) -> AsyncHttpResponse[GroupWithIncludesResponse]
显示组详细信息
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
group_id: Uuid —
include: typing.Optional[typing.Literal["creator"]] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.groups.create(...) -> AsyncHttpResponse[GroupResponse]
为当前帐户创建组
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
data: CreateGroupParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.groups.update(...) -> AsyncHttpResponse[GroupResponse]
更新组详细信息
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
group_id: Uuid —
data: UpdateGroupParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
元数据
client.metadata.bulk_update(...) -> AsyncHttpResponse[None]
更新多个文件中的元数据值。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
project_id: Uuid —
data: BulkUpdateMetadataParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.metadata.show(...) -> AsyncHttpResponse[MetadataResponse]
显示文件的元数据。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
file_id: Uuid —
show_null: typing.Optional[bool] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
元数据字段
client.metadata_fields.metadata_field_definitions_delete(...) -> AsyncHttpResponse[None]
删除帐户级自定义字段定义。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
field_definition_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.metadata_fields.metadata_field_definitions_update(...) -> AsyncHttpResponse[FieldDefinitionResponse]
更新帐户级自定义字段定义。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
field_definition_id: Uuid —
data: typing.Optional[UpdateFieldDefinitionParamsData]
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.metadata_fields.metadata_field_definitions_index(...) -> AsyncHttpResponse[FieldDefinitionsWithIncludesResponse]
列出帐户级字段定义。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
include: typing.Optional[typing.Literal[“creator”]] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.metadata_fields.metadata_field_definitions_create(...) -> AsyncHttpResponse[FieldDefinitionResponse]
创建帐户级字段定义。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
data: typing.Optional[CreateFieldDefinitionParamsData]
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
项目权限
client.project_permissions.index(...) -> AsyncPager[UserRole, UserRolesResponse]
列出给定项目的用户角色。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
project_id: Uuid —
include_deactivated: typing.Optional[bool] — 支持在响应中包含停用的用户。 默认值为 false。
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
注意:此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.project_permissions.delete(...) -> AsyncHttpResponse[None]
从给定项目中移除用户。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
project_id: Uuid —
user_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.project_permissions.project_user_roles_update(...) -> AsyncHttpResponse[UpdateUserRolesResponse]
如果用户已添加到给定项目,则更新该项目的用户角色。 如果用户未添加到项目,则会添加该用户并分配给定角色。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
project_id: Uuid —
user_id: Uuid —
data: UpdateUserRolesParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
项目
client.projects.show(...) -> AsyncHttpResponse[ProjectWithIncludesResponse]
显示项目详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
project_id: Uuid —
include: typing.Optional[typing.Literal["owner"]] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.delete(...) -> AsyncHttpResponse[None]
删除项目。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
project_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.update(...) -> AsyncHttpResponse[ProjectResponse]
更新项目详细信息。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
project_id: Uuid —
data: ProjectUpdateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.index(...) -> AsyncPager[ProjectWithIncludes, ProjectsWithIncludesResponse]
列出给定工作区中的项目。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
include: typing.Optional[typing.Literal["owner"]] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.create(...) -> AsyncHttpResponse[ProjectResponse]
在给定工作区中创建项目。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
data: ProjectParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.account_projects_index(...) -> AsyncPager[ProjectWithIncludes, ProjectsWithIncludesResponse]
列出已验证用户在指定帐户内具有访问权限的所有项目.
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
include: typing.Optional[typing.Literal["owner"]] —
sort: typing.Optional[AccountProjectsIndexRequestSort] — 按查询参数对项目进行排序
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.projects.invited_projects_index(...) -> AsyncPager[ProjectWithIncludes, ProjectsWithIncludesResponse]
列出当前用户在指定帐户内受邀参与但没有工作区级别访问权限的项目。这些是用户拥有项目专属的协作者访问权限,但不具备更广泛的团队/工作区权限的项目。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
include: typing.Optional[typing.Literal["owner"]] —
sort: typing.Optional[InvitedProjectsIndexRequestSort] — 按查询参数对项目进行排序
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
搜索
client.search.search(...) -> AsyncHttpResponse[SearchResponse]
搜索帐户内的资产、文件夹和项目
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
engine: SearchParamsEngine — 要使用的搜索引擎。可用引擎:lexical、nlp。
query: str — 搜索查询文本
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
filters: typing.Optional[SearchParamsFilters] — 用于控制返回哪些类型结果的筛选条件
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
共享
上传
frameio.upload.FrameioUploader(asset, file, ...)
使用 client.files.create_local_upload(...) 返回的预签名 URL,将本地文件上传到 Frame.io。FrameioUploader 是一个轻量封装,它从 FileWithUploadUrls 响应中读取 upload_urls、file_size 和 media_type,并执行分片、多线程的 S3 上传。
参数
asset: FileWithUploadUrls — 由 client.files.create_local_upload(...) 返回的 FileWithUploadUrls 实例。
file: typing.BinaryIO — 以二进制读取模式 ("rb") 打开的文件类对象。
max_workers: int — 传递给底层上传器的线程池并发数。默认值为 5。
headers: typing.Optional[typing.Dict[str, str]] — 合并到每个 S3 PUT 请求中的额外标头。根据 Frame.io 的要求,默认值为 {"x-amz-acl": "private"}。
max_retries: int — 每个分片的重试次数。默认值为 3。
on_progress: typing.Optional[typing.Callable[[int, int], None]] — 可选回调,在每个分片后调用,参数为 (bytes_uploaded_so_far, total_bytes)。方法 upload() -> None — 上传文件。该方法会阻塞直到上传完成,或在出错时抛出异常。
用户
client.users.show() -> AsyncHttpResponse[ProfileResponse]
检查与持有者令牌关联的用户详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
版本堆栈
client.version_stacks.index(...) -> AsyncHttpResponse[AssetsWithIncludesResponse]
列出给定版本堆栈中的次项(文件)。
使用 include 查询参数选择性地在响应中包含其他属性。
如果您包含 media_links.original 且用户无权下载相应项目中的文件,则此端点将响应 403 Forbidden 错误。 如果由于该用户需要水印而请求的 media_links 不支持水印,导致内容无法访问,则请求将成功,但不支持的媒体链接将被设置为 null。 同样,如果请求的转码链接对于特定文件不存在(例如,在静态图像文件中包含 media_links.video_h264_180)或者转码过程尚未完成(即文件的状态为“已上传”而不是“已转码”),则响应负载中的媒体链接也将被设置为 null。 简而言之,客户端必须妥善处理 null 媒体链接。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
version_stack_id: Uuid —
include: typing.Optional[FileWithMediaLinksInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.version_stacks.show(...) -> AsyncHttpResponse[VersionStackWithIncludesResponse]
显示版本堆栈详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
version_stack_id: Uuid —
include: typing.Optional[VersionStacksShowRequestInclude] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.version_stacks.copy(...) -> AsyncHttpResponse[VersionStackCopyResponse]
复制版本堆栈。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
version_stack_id: Uuid —
copy_metadata: typing.Optional[bool] — 是否随版本堆栈一起复制元数据值
data: typing.Optional[VersionStackCopyParamsData]
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.version_stacks.list(...) -> AsyncHttpResponse[VersionStacksWithIncludesResponse]
列出给定文件夹中的版本堆栈。
速率限制:每个 account_user 每 1 秒钟 5 次调用
参数
account_id: Uuid —
folder_id: Uuid —
include: typing.Optional[FileWithMediaLinksInclude] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.version_stacks.create(...) -> AsyncHttpResponse[VersionStackWithIncludesResponse]
在父文件夹下创建新的版本堆栈。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
folder_id: Uuid —
data: VersionStackCreateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.version_stacks.move(...) -> AsyncHttpResponse[VersionStackResponse]
将版本堆栈移动到另一个文件夹。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
version_stack_id: Uuid —
data: VersionStackMoveParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
Webhook
client.webhooks.index(...) -> AsyncPager[WebhookWithIncludes, WebhooksWithIncludesResponse]
列出给定工作区的 Webhook。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
include: typing.Optional[typing.Literal[“creator”]] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.webhooks.create(...) -> AsyncHttpResponse[WebhookCreateResponse]
创建包含密钥的单个 Webhook。
有效事件:
file.created、file.deleted、file.ready、file.updated、file.upload.completed、file.versioned、file.copied、folder.created、folder.deleted、folder.updated、folder.copied、comment.completed、comment.created、comment.deleted、comment.uncompleted、comment.updated、customfield.created、customfield.updated、customfield.deleted、metadata.value.updated、project.created、project.deleted、project.updated、collection.created、collection.updated、collection.deleted、share.created、share.updated、share.deleted、share.viewed。
速率限制:每个帐户 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
data: WebhookCreateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.webhooks.show(...) -> AsyncHttpResponse[WebhookWithIncludesResponse]
显示 Webhook 详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
webhook_id: Uuid —
include: typing.Optional[typing.Literal[“creator”]] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.webhooks.delete(...) -> AsyncHttpResponse[None]
删除 Webhook。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
webhook_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.webhooks.update(...) -> AsyncHttpResponse[WebhookResponse]
更新 Webhook 详细信息。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
webhook_id: Uuid —
data: WebhookUpdateParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
工作区权限
client.workspace_permissions.index(...) -> AsyncPager[UserRole, UserRolesResponse]
列出给定工作区的用户角色。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
includ_deactivated: typing.Optional[bool] — 支持在响应中包含已停用的用户。默认值为 false。
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspace_permissions.workspace_user_roles_delete(...) -> AsyncHttpResponse[None]
从给定工作区中移除用户。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
user_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspace_permissions.workspace_user_roles_update(...) -> AsyncHttpResponse[UpdateUserRolesResponse]
如果用户已添加到工作区,则更新给定工作区的用户角色。 如果用户未添加到工作区,则会添加该用户并分配给定角色。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
workspace_id: Uuid—
user_id: Uuid —
data: UpdateUserRolesParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
工作区
client.workspaces.show(...) -> AsyncHttpResponse[WorkspaceWithIncludesResponse]
显示工作区详细信息。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
include: typing.Optional[typing.Literal[“creator”]] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspaces.delete(...) -> AsyncHttpResponse[None]
从帐户中删除工作区。
速率限制:每个 account_user 每 1.00 分钟 60 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspaces.update(...) -> AsyncHttpResponse[WorkspaceResponse]
更新工作区。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
data: WorkspaceParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspaces.index(...) -> AsyncPager[WorkspaceWithIncludes, WorkspacesWithIncludesResponse]
列出给定帐户的工作区。
速率限制:每个 account_user 每 1.00 分钟 100 次调用
参数
account_id: Uuid —
workspace_id: Uuid —
include: typing.Optional[typing.Literal[“owner”]] —
after: typing.Optional[RequestAfterOpaqueCursor]
不透明光标查询参数,用于返回分页结果的请求。
此值是自动生成的,且属于之前响应的链接的一部分。 该内容不属于人类可读格式。
page_size: typing.Optional[RequestPageSize] —
include_total_count: typing.Optional[IncludeTotalCount] —
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
client.workspaces.create(...) -> AsyncHttpResponse[WorkspaceResponse]
从帐户创建工作区。
速率限制:每个 account_user 每 1.00 分钟 10 次调用
参数
account_id: Uuid —
data: WorkspaceParamsData
request_options: typing.Optional[RequestOptions] — 特定于请求的配置。
PyPI
在 PyPI 上查看