DorsalFileCollection
dorsal.file.collection.DorsalFileCollection
DorsalFileCollection(
collection_id,
*,
client=None,
_metadata=None,
_files=None,
_pagination=None
)
Bases: _BaseFileCollection
Represents and interacts with a remote File Collection on DorsalHub.
Initializes a remote file collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection_id
|
str
|
The unique ID of the collection to fetch. |
required |
client
|
DorsalClient | None
|
An optional DorsalClient instance. |
None
|
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
add_files
Adds a list of files to this remote collection by their hash.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
delete
Deletes the entire remote collection.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
fetch_page
Fetches a specific page of file records, updating the collection in-place. ...
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
from_id
classmethod
Explicitly create a DorsalFileCollection from a collection ID.
from_id_metadata_only
classmethod
Create collection with no files. Useful for management operations via the CLI.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
from_remote
classmethod
from_remote(
collection_id,
client=None,
use_export=False,
poll_interval=5,
timeout=3600,
console=None,
palette=None,
)
Creates and returns a new, fully populated DorsalFileCollection.
This is a convenience method that initializes the collection and immediately calls .populate().
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
list_collections
classmethod
List available remote collections for the user and return them as (unpopulated) DorsalFileCollection instances.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
make_private
Makes the remote collection private.
make_public
Makes the remote collection public.
populate
Populates the collection with all of its file records from the remote server.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
refresh
Refreshes the collection's metadata and re-fetches the current page.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
remove_files
Removes a list of files from this remote collection by their hash. This does not delete the file records themselves from DorsalHub.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
to_csv
Exports the collection's metadata to a CSV file.
Raises an error if the collection is not fully populated, unless force=True.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
to_dataframe
Exports the collection's metadata to a pandas DataFrame.
Raises an error if the collection is not fully populated, unless force=True.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
to_dict
Serializes the collection to a dictionary.
Raises an error if the collection is not fully populated, unless force=True.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
to_json
Saves the collection data to a JSON file or returns it as a string.
Raises an error if the collection is not fully populated, unless force=True.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
to_sqlite
Exports the collection's data to a table in an SQLite database.
Raises an error if the collection is not fully populated, unless force=True.
Source code in venv/lib/python3.13/site-packages/dorsal/file/collection/remote.py
update
Updates the metadata of the remote collection.