# Downloads Every source downloads through {mod}`seagrid.download`, so they all behave the same way: - A file is written to `.partial` and renamed when complete, so an interrupted download never looks like a cached file. - Transient server errors (HTTP 429/5xx, dropped connections) are retried with exponential backoff. - A failure raises {class}`~seagrid.download.DownloadError`, and refused or missing credentials raise {class}`~seagrid.download.AuthenticationError`. The original exception is attached as `__cause__`. | Module | Service | Main functions | |---|---|---| | {mod}`~seagrid.download.http` | any HTTP(S) server | `fetch`, `remote_exists`, `list_links`, `uncompress`, `extract_zip` | | {mod}`~seagrid.download.earthdata` | NASA Earthdata / CMR | `session`, `fetch`, `search`, `exists` | | {mod}`~seagrid.download.copernicus` | Copernicus Marine | `get_files`, `subset`, `exists` | | {mod}`~seagrid.download.opendap` | THREDDS / Hyrax OPeNDAP | `open_remote`, `cache_dataset`, `retrieve`, `compute_all` | | {mod}`~seagrid.download.obpg` | OB.DAAC naming rules | `filename`, `url`, `cmr_short_name` | ```python from seagrid.download import http, obpg, earthdata name = obpg.filename("2023-06-01", "chlor_a", "daily") earthdata.fetch(obpg.url(name), "~/data/modis/") ``` ## Which dates are downloaded {mod}`seagrid.inventory` keeps a small SQLite record of downloaded files and prints a collapsed summary: ```text GLORYS12V1, 2006-01-01 to 2008-12-31: 457 of 1096 days downloaded 2006 downloaded 2007 partial (92 of 365 days) Jan-May missing Jun-Aug downloaded Sep partial (5 of 30 days) downloaded 1-5 missing 6-30 Oct-Dec missing 2008 missing ```