Assets Api Wrapped
immichpy.client.wrapper.assets_api_wrapped.AssetsApiWrapped
AssetsApiWrapped(api_client=None)
Bases: AssetsApi
Wrapper for the AssetsApi that provides convenience methods.
Source code in immichpy/client/generated/api/assets_api.py
82 83 84 85 | |
download_asset_to_file
async
download_asset_to_file(id: UUID, out_dir: Path, key: StrictStr | None = None, slug: StrictStr | None = None, filename: str | None = None, show_progress: bool = False, **kwargs: Any) -> Path
Download an asset to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
UUID
|
The asset ID. |
required |
out_dir
|
Path
|
The directory to write the asset to. |
required |
key
|
StrictStr | None
|
Public share key (the last path segment of a public share URL, i.e. |
None
|
slug
|
StrictStr | None
|
Public share slug for custom share URLs (the last path segment of |
None
|
filename
|
str | None
|
The filename to use. If not provided, we use the original filename from the headers or default to "orig-" + asset_id. |
None
|
show_progress
|
bool
|
Whether to show a progress bar while downloading. |
False
|
kwargs
|
Any
|
Additional arguments to pass to the |
{}
|
Returns:
| Type | Description |
|---|---|
Path
|
The path to the downloaded file. For exact request/response behavior, inspect |
Source code in immichpy/client/wrapper/assets_api_wrapped.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
play_asset_video_to_file
async
play_asset_video_to_file(id: UUID, out_dir: Path, key: StrictStr | None = None, slug: StrictStr | None = None, filename: str | None = None, show_progress: bool = False, **kwargs: Any) -> Path
Save an asset's video stream to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
UUID
|
The asset ID. |
required |
out_dir
|
Path
|
The directory to write the video to. |
required |
key
|
StrictStr | None
|
Public share key (the last path segment of a public share URL, i.e. |
None
|
slug
|
StrictStr | None
|
Public share slug for custom share URLs (the last path segment of |
None
|
filename
|
str | None
|
The filename to use. If not provided, we use the original filename from the headers or default to "video-" + asset_id. |
None
|
show_progress
|
bool
|
Whether to show a progress bar while downloading. |
False
|
kwargs
|
Any
|
Additional arguments to pass to the [AssetsApi.play_asset_video_without_preload_content][] method. |
{}
|
Returns:
| Type | Description |
|---|---|
Path
|
The path to the downloaded file. |
Source code in immichpy/client/wrapper/assets_api_wrapped.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
upload
async
upload(paths: Path | list[Path] | str | list[str], *, ignore_pattern: str | None = None, include_hidden: bool = False, skip_duplicates: bool = False, concurrency: int = 5, show_progress: bool = False, album_name: str | None = None, delete_uploads: bool = False, delete_duplicates: bool = False, dry_run: bool = False) -> UploadResult
Upload assets with smart features (duplicate detection, album management, sidecar support, dry run).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
Path | list[Path] | str | list[str]
|
File or directory paths to upload. Can be a single path or list of paths. Directories are automatically walked recursively. To ignore subdirectories, use the |
required |
ignore_pattern
|
str | None
|
Wildcard pattern to ignore files (uses |
None
|
include_hidden
|
bool
|
Whether to include hidden files (starting with "."). |
False
|
skip_duplicates
|
bool
|
Whether to skip duplicate checking (might still get rejected on the server). |
False
|
concurrency
|
int
|
Number of concurrent uploads. Defaults to 5. A higher number may increase upload speed, but also increases the risk of rate limiting or other issues. |
5
|
show_progress
|
bool
|
Whether to show progress bars. |
False
|
album_name
|
str | None
|
Album name to create or use. If None, no album operations are performed. |
None
|
delete_uploads
|
bool
|
Whether to delete successfully uploaded files locally. |
False
|
delete_duplicates
|
bool
|
Whether to delete duplicate files locally. |
False
|
dry_run
|
bool
|
Simulate uploads without actually uploading. |
False
|
Returns:
| Type | Description |
|---|---|
UploadResult
|
UploadResult with uploaded assets, rejected files, failures, and statistics. |
Source code in immichpy/client/wrapper/assets_api_wrapped.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
view_asset_to_file
async
view_asset_to_file(id: UUID, out_dir: Path, key: StrictStr | None = None, size: AssetMediaSize | None = None, slug: StrictStr | None = None, filename: str | None = None, show_progress: bool = False, **kwargs: Any) -> Path
Save an asset's thumbnail to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
UUID
|
The asset ID. |
required |
out_dir
|
Path
|
The directory to write the asset to. |
required |
key
|
StrictStr | None
|
Public share key (the last path segment of a public share URL, i.e. |
None
|
size
|
AssetMediaSize | None
|
Thumbnail size. |
None
|
slug
|
StrictStr | None
|
Public share slug for custom share URLs (the last path segment of |
None
|
filename
|
str | None
|
The filename to use. If not provided, we use the original filename from the headers or default to "thumb-" + asset_id. |
None
|
show_progress
|
bool
|
Whether to show a progress bar while downloading. |
False
|
kwargs
|
Any
|
Additional arguments to pass to the [AssetsApi.view_asset_without_preload_content][] method. |
{}
|
Returns:
| Type | Description |
|---|---|
Path
|
The path to the downloaded file. |
Source code in immichpy/client/wrapper/assets_api_wrapped.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |