fasta_lake.downloads#
fasta_lake.downloads
#
Explicit, resumable resource downloads with local integrity records.
Downloads never run as a side effect of database construction or annotation. Archive expansion is a separate bounded operation. Public functions accept plain file specifications so callers can test them without fetching large catalogues.
catalogue
#
Return the installed, dated resource catalogue without making network calls.
resolve_resource
#
Resolve a catalogue choice, including live release identity for UniProt.
No sequence, archive or model data is fetched here. Fixed-version resources retain their registered identities. UniProt's moving release is frozen in the returned download plan using its upstream metadata and checksum.
Source code in fasta_lake/downloads.py
inspect_remote
#
Read transfer metadata without downloading the resource body.
Unknown size stays unknown. A refused HEAD request may fall back to a one-byte range request; servers ignoring Range are closed without reading the body.
Source code in fasta_lake/downloads.py
free_bytes
#
Read free disk space from the closest existing destination parent.
Source code in fasta_lake/downloads.py
plan_download
#
Resolve files, transfer bytes, disk availability and expanded-size uncertainty.
Source code in fasta_lake/downloads.py
download_file
#
Stream one planned file; publish only after size/checksum validation.
Resume requires the same URL, expected digest and a strong server ETag. Range responses must start at the saved offset. Interrupted bytes remain .partial; an existing final file is never overwritten. SHA256 is always recorded, but it authenticates against upstream only when an upstream digest was supplied.
Source code in fasta_lake/downloads.py
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 284 285 286 | |
download_resource
#
Download a resolved resource into its named local folder, with per-file receipts.
Source code in fasta_lake/downloads.py
unpack_resource
#
Expand gzip/xz/tar archives into a fresh folder with a hard output-byte budget.
Only regular files and directories are accepted. Links, traversal paths, duplicates and special files fail. Original archives remain untouched. The budget counts expanded file bytes, not RAM; extraction uses 1 MiB buffers.