EUMETSAT Data Store — API reference#
The EUMETSAT Data Store data source subpackage — earthlens.eumetsat.
Background, usage, authentication, the catalog, and the Data Tailor path
are covered under the other pages in this section; this page is the
rendered API.
earthlens.eumetsat
#
EUMETSAT Data Store backend (181 collections via eumdac).
One unified backend over the EUMETSAT Data Store: a single OAuth2
consumer key / secret mints a bearer token that reaches every
collection — MTG-I1 FCI, MSG SEVIRI, Metop (ASCAT / IASI), Metop-SG, the
Sentinel-3 / -5P / -6 mirrors, and the OSI SAF / CDR / FDR families. The
backend fetches whole native products to disk, and supports server-side
subset / reproject / reformat via the tailor=TailorConfig(...) Data
Tailor path; native SEVIRI / FCI client-side reading (the satpy bridge)
is a deferred follow-on.
Like the NASA Earthdata backend, the output shape is per-collection,
not fixed — EUMETSAT sets OUTPUT_KIND from the resolved catalog
row (raster / vector / tabular).
Public surface (re-exported from this package):
EUMETSAT— the backend itself; instantiate with a date range, a bbox, and a{collection_key: [selector, ...]}mapping, then callEUMETSAT.download.Catalog— pydantic-backed loader for the bundled per-groupcatalog/directory.EumetsatDataset— one curated dataset (collection) row (collection_id, group, output_kind, format, selectors, tailor_product_type, extent).DataStoreGroup— the Data Store group (mission family) enum.Extent/TemporalCoverage— the spatial / temporal coverage rows.EumetsatAuth—AbstractAuthwrapper overeumdac.AccessToken. Idempotent; safe to call repeatedly.EumetsatCredentials— frozen value object the auth class binds to.TailorConfig— frozen request shape for the Data Tailor server-side subset / reproject / reformat path (download(tailor=...)).AuthenticationError— raised when token minting fails; subclass ofearthlens.base.AuthenticationError.CATALOG_PATH— absolute path to the bundledcatalog/directory.
The [eumetsat] extra pulls eumdac. The eumdac import is lazy, so
this package imports without the extra installed.
AuthenticationError
#
Bases: AuthenticationError
Raised when eumdac cannot mint an OAuth2 token.
Wraps the underlying eumdac / HTTP failure with a message that
names a fix: register a consumer key / secret at the EUMETSAT API-key
page, set the EUMETSAT_CONSUMER_KEY / EUMETSAT_CONSUMER_SECRET
environment variables, or write a ~/.eumdac/credentials file.
A subclass of the cross-backend earthlens.base.AuthenticationError
so callers can catch every backend's auth failure with one except
clause.
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
Catalog
#
Bases: AbstractCatalog
Dataset catalog for the EUMETSAT Data Store backend.
Reads the bundled catalog/ directory (shipped as package data) and
exposes its consumed top-level sections as typed pydantic fields.
Instantiate with no arguments (Catalog()) — model_post_init
parses the YAML and populates every field in one pass. Mirrors the
earthlens.earthdata / earthlens.gee / earthlens.cmems catalogs:
datasets (the curated map) and available_datasets (the
informational index).
Attributes:
| Name | Type | Description |
|---|---|---|
available_datasets |
list[str]
|
Informational list of every Data Store collection id the browse walk found. Runtime code does not consume it. |
datasets |
dict[str, EumetsatDataset]
|
Structural map keyed by the curated dataset key. Each
value is an |
Examples:
- Resolve a curated dataset:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | |
get_catalog()
#
Return the structural per-dataset map.
Satisfies the abstract base's contract; the actual parsing is
done in model_post_init.
Returns:
| Type | Description |
|---|---|
dict[str, EumetsatDataset]
|
dict[str, EumetsatDataset]: One entry per curated dataset.
Same object as |
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
load(catalog_path=None)
classmethod
#
Read the EUMETSAT catalog from disk (cached).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog_path
|
Path | None
|
Path to the |
None
|
Returns:
| Type | Description |
|---|---|
Catalog
|
A fully-populated |
Raises:
| Type | Description |
|---|---|
ValueError
|
Propagated from |
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
resolve(key, group=None)
#
Resolve a dataset key, optionally disambiguated by group.
Most keys map one-to-one to a curated row; the inherited
:meth:get_dataset (with its did-you-mean) handles those. The
group= filter additionally asserts which Data Store group the
resolved dataset belongs to (G2) — the EUMETSAT analog of the
Earthdata backend's daac= filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Curated dataset key (a member of |
required |
group
|
DataStoreGroup | str | None
|
Optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
EumetsatDataset |
EumetsatDataset
|
The resolved row. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Examples:
- Resolve a key and read its group:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
DataStoreGroup
#
Bases: StrEnum
The EUMETSAT Data Store collection groups (mission families).
Each value is the human-readable group label carried on a catalog
row's group: field and accepted by the backend's group= kwarg to
disambiguate a collection key shared across groups (G2).
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
EUMETSAT
#
Bases: AbstractDataSource
EUMETSAT Data Store backend (per-collection output kind).
Wraps eumdac so a user can search a curated EUMETSAT collection by
bbox + window and fetch its native products through the same
download() shape every other earthlens backend uses. One OAuth2
consumer key / secret authenticates across every collection.
Attributes:
| Name | Type | Description |
|---|---|---|
OUTPUT_KIND |
OutputKind
|
Class default |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 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 164 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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
__init__(start, end, variables, lat_lim, lon_lim, temporal_resolution='daily', path=None, fmt='%Y-%m-%d', group=None, consumer_key=None, consumer_secret=None, credentials_file=None)
#
Initialise an EUMETSAT backend instance.
Resolves every requested dataset key against the catalog
before calling the parent constructor, so the per-instance
OUTPUT_KIND is set from the resolved row(s). The parent
__init__ runs _initialize first (token mint), so the
resolution cannot live there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
str
|
Inclusive start date as a string (parsed with |
required |
end
|
str
|
Inclusive end date as a string. |
required |
variables
|
dict[str, list[str]]
|
Mapping from curated dataset key to a list of
selectors, e.g. |
required |
lat_lim
|
list[float]
|
|
required |
lon_lim
|
list[float]
|
|
required |
temporal_resolution
|
str
|
Advisory cadence label. Defaults to
|
'daily'
|
path
|
Path | str | None
|
Output directory. Created by the parent class if it does not exist. |
None
|
fmt
|
str
|
|
'%Y-%m-%d'
|
group
|
DataStoreGroup | str | None
|
Optional |
None
|
consumer_key
|
str | None
|
EUMETSAT consumer key. Falls back to
|
None
|
consumer_secret
|
str | None
|
EUMETSAT consumer secret. Falls back to
|
None
|
credentials_file
|
Path | str | None
|
Optional explicit path to a |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
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 164 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 | |
download(progress_bar=True, tailor=None)
#
Search the Data Store and return product paths (native or tailored).
With no tailor=, composes _search and _fetch to pull every
product matching the request bbox + window to self.root_dir as
whole native products (unchanged behaviour).
With tailor=TailorConfig(...), each matching product is routed
through EUMETSAT Data Tailor (server-side subset / reproject /
reformat, H4): submit a customisation, poll it to DONE, stream
the customised output(s) to self.root_dir, and delete the
customisation (G7). The returned paths are then the customised
GeoTIFF / NetCDF files, not the native products (G6).
aggregate= is the temporal reducer (G1) and is a separate
operation from the spatial tailor=; it is not implemented for
EUMETSAT, so a non-None aggregate raises NotImplementedError.
The two knobs compose — tailor server-side here, then reduce the
result client-side with pyramids.
The tailor branch is fail-fast per batch: if one product's customisation fails, the error propagates and paths already streamed for earlier products are not returned (their files remain on disk). This mirrors the native fetch; keep batches small when a partial result would be costly to recompute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress_bar
|
bool
|
Reserved for parity with the other backends;
|
True
|
tailor
|
TailorConfig | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
list[Path]: The native product paths, or — when |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
EumetsatAuth
#
Bases: AbstractAuth[EumetsatCredentials]
Authenticate against the EUMETSAT Data Store (OAuth2).
Wraps eumdac.AccessToken in the earthlens.base.AbstractAuth
contract. configure() resolves a consumer key / secret pair
(environment → constructor kwargs → ~/.eumdac/credentials) and
mints an eumdac.AccessToken, which auto-refreshes the ~1 h bearer
internally. The datastore / datatailor helpers build the matching
eumdac clients from the live token.
The class is a context manager (inherited from AbstractAuth):
with EumetsatAuth(creds) as auth: ... calls configure() on enter
and the default no-op close() on exit.
Attributes:
| Name | Type | Description |
|---|---|---|
_creds |
The |
|
_token |
The |
Examples:
-
Build, configure, inspect — marked
# doctest: +SKIPbecause it mints a real OAuth2 token:
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
__init__(credentials)
#
Store credentials; does not authenticate.
Construction is side-effect-free — the user (or the backend's
_initialize) must call configure (or use the context-manager
form) to mint a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
credentials
|
EumetsatCredentials
|
The |
required |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
configure()
#
Mint the OAuth2 token via eumdac.AccessToken.
Idempotent — short-circuits when is_authenticated already
returns True. Resolves the consumer key / secret pair
(environment → kwargs → credentials file), then constructs an
eumdac.AccessToken((key, secret)). The token object refreshes
the ~1 h bearer internally; this wrapper re-mints a fresh one
only after the cached token's expiration has passed (see
is_authenticated).
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When no credential pair resolves, or
|
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
datastore()
#
Return an eumdac.DataStore bound to the live token.
Returns:
| Type | Description |
|---|---|
Any
|
eumdac.DataStore: The Data Store client used to resolve collections and search products. |
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
datatailor()
#
Return an eumdac.DataTailor bound to the live token.
Used by the Data Tailor (server-side subset / reproject / reformat)
path — EUMETSAT.download(tailor=...). The native whole-product
fetch does not call this.
Returns:
| Type | Description |
|---|---|
Any
|
eumdac.DataTailor: The Data Tailor client. |
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
is_authenticated()
#
Return whether a live, unexpired token is held.
Cheap predicate — does not call the network. Returns True only
when configure() has minted a token whose expiration
(a datetime) is still in the future; an expired token reports
False so configure() re-mints. A token whose expiration
cannot be read is treated as live (the SDK refreshes it lazily).
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
EumetsatCredentials
#
Bases: BaseModel
Frozen value object holding the EUMETSAT consumer key / secret.
Every field is optional — the auth wrapper resolves the actual pair
at configure() time from the environment, these fields, then the
~/.eumdac/credentials file. Validation is intentionally permissive;
the real "do these creds work?" gate is
EumetsatAuth.configure, which mints a token against the OAuth2
endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
consumer_key |
str | None
|
The EUMETSAT consumer key (the OAuth2 client id).
|
consumer_secret |
SecretStr | None
|
The matching consumer secret, stored as a
|
credentials_file |
Path | None
|
Optional explicit path to a |
Examples:
- All fields optional — rely on env / credentials file:
- SecretStr hides the secret in repr:
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
EumetsatDataset
#
Bases: BaseModel
One curated EUMETSAT Data Store dataset (collection) row.
Mirrors a single datasets.<key>: block in one of the per-group
catalog/*.yaml files. The friendly dataset key is the parent key
in Catalog.datasets and is not stored on the row.
Attributes:
| Name | Type | Description |
|---|---|---|
collection_id |
str
|
The real Data Store collection id the search
uses, e.g. |
group |
DataStoreGroup
|
The Data Store group (mission family) this dataset
belongs to — used by the backend's |
mission |
str
|
Short mission tag ( |
output_kind |
OutputKindLiteral
|
The per-dataset output shape — |
format |
str
|
On-disk product format ( |
cadence |
CadenceLiteral
|
Native temporal cadence (advisory). |
timeliness |
TimelinessLiteral | None
|
Delivery timeliness of the dataset — |
selectors |
list[str]
|
Informational product-type / band selectors ( |
tailor_product_type |
str | None
|
The Data Tailor product-type id for the
|
extent |
Extent
|
|
temporal |
TemporalCoverage
|
|
Examples:
- Inspect a curated raster row:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
Extent
#
Bases: BaseModel
Spatial coverage of an EUMETSAT collection (lat / lon bounds).
Mirrors the extent: block in the YAML. Whole-disk geostationary
products (SEVIRI / FCI) use the ~±79° sub-satellite extent; polar /
mirror products are global.
Attributes:
| Name | Type | Description |
|---|---|---|
lat |
list[float]
|
|
lon |
list[float]
|
|
Examples:
- A geostationary 0° disk extent:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
TailorConfig
#
Bases: BaseModel
Server-side customisation request for the EUMETSAT Data Tailor.
A frozen value object passed to EUMETSAT.download(tailor=...) (or the
EarthLens(..., tailor=...) facade kwarg) to route a request through
Data Tailor instead of the native whole-product fetch. It carries the
output format, the target crs / projection, an optional bbox
crop, an optional band filter, and a quicklook flag. The Data
Tailor product-type is not set here — it comes from the resolved
catalog row's tailor_product_type (G4 / G5).
Attributes:
| Name | Type | Description |
|---|---|---|
format |
str
|
Data Tailor output format, e.g. |
crs |
str
|
Target projection / CRS, e.g. |
bbox |
tuple[float, float, float, float] | None
|
Optional crop as |
filter |
list[str] | None
|
Optional list of band / layer names to keep. Maps to
|
quicklook |
bool
|
When |
Examples:
- A reproject + crop + reformat request:
- No bbox falls back to the request extent (ROI derived later):
Source code in libs/providers/imagery/src/earthlens/eumetsat/tailor.py
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 73 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 117 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 164 165 166 167 168 | |
nswe
property
#
Return the Data Tailor ROI as an [N, S, W, E] list, or None.
Data Tailor's RegionOfInterest takes an NSWE list of four
numbers [north, south, west, east] (A1). This converts the
stored bbox ((west, south, east, north)) into that order.
Returns None when no bbox was set, so the backend can fall
back to the request's spatial extent.
Returns:
| Type | Description |
|---|---|
list[float] | None
|
list[float] | None: |
nswe_from_extent(north, south, west, east)
staticmethod
#
Build a Data Tailor NSWE list from spatial-extent bounds.
The backend calls this with self.space bounds when a
TailorConfig carries no explicit bbox, so the request's
lat_lim / lon_lim become the ROI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
north
|
float
|
Northern latitude bound in degrees. |
required |
south
|
float
|
Southern latitude bound in degrees. |
required |
west
|
float
|
Western longitude bound in degrees. |
required |
east
|
float
|
Eastern longitude bound in degrees. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
list[float]: |
Source code in libs/providers/imagery/src/earthlens/eumetsat/tailor.py
TemporalCoverage
#
Bases: BaseModel
Temporal coverage of an EUMETSAT collection (start + optional end).
Mirrors the temporal: block in the YAML. end: null (or a missing
end) means the collection is ongoing / rolling.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
str | None
|
First date with data, as a |
end |
str | None
|
Last date with data, or |
Examples:
- An ongoing collection:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
clear_catalog_cache()
#
Empty the module-level catalog parse cache.
Useful in tests that rewrite the catalog on disk and want to force a
re-parse. Production callers do not need this — the cache keys
include every contributing file's st_mtime_ns, so any real file
mutation invalidates the entry on its own.
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
earthlens.eumetsat.tailor
#
Typed request shape for the EUMETSAT Data Tailor (server-side customisation).
Hosts TailorConfig, the frozen pydantic value object that turns a
download(tailor=...) call into a EUMETSAT Data Tailor Chain. Data
Tailor is EUMETSAT's server-side subset / reproject / reformat service
(the analogue of NASA Harmony) — a spatial operation, distinct from
the temporal earthlens.aggregate.AggregationConfig. The two knobs
compose: tailor= reshapes each product server-side, then an optional
aggregate= reduces the result client-side.
TailorConfig is deliberately SDK-free — it holds only plain values and
knows how to derive the Data Tailor region-of-interest (NSWE) from its
bbox. The backend builds the actual eumdac.tailor_models.Chain (a
lazy eumdac import) from a TailorConfig, the resolved catalog row's
tailor_product_type, and the request's spatial extent.
TailorConfig
#
Bases: BaseModel
Server-side customisation request for the EUMETSAT Data Tailor.
A frozen value object passed to EUMETSAT.download(tailor=...) (or the
EarthLens(..., tailor=...) facade kwarg) to route a request through
Data Tailor instead of the native whole-product fetch. It carries the
output format, the target crs / projection, an optional bbox
crop, an optional band filter, and a quicklook flag. The Data
Tailor product-type is not set here — it comes from the resolved
catalog row's tailor_product_type (G4 / G5).
Attributes:
| Name | Type | Description |
|---|---|---|
format |
str
|
Data Tailor output format, e.g. |
crs |
str
|
Target projection / CRS, e.g. |
bbox |
tuple[float, float, float, float] | None
|
Optional crop as |
filter |
list[str] | None
|
Optional list of band / layer names to keep. Maps to
|
quicklook |
bool
|
When |
Examples:
- A reproject + crop + reformat request:
- No bbox falls back to the request extent (ROI derived later):
Source code in libs/providers/imagery/src/earthlens/eumetsat/tailor.py
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 73 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 117 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 164 165 166 167 168 | |
nswe
property
#
Return the Data Tailor ROI as an [N, S, W, E] list, or None.
Data Tailor's RegionOfInterest takes an NSWE list of four
numbers [north, south, west, east] (A1). This converts the
stored bbox ((west, south, east, north)) into that order.
Returns None when no bbox was set, so the backend can fall
back to the request's spatial extent.
Returns:
| Type | Description |
|---|---|
list[float] | None
|
list[float] | None: |
nswe_from_extent(north, south, west, east)
staticmethod
#
Build a Data Tailor NSWE list from spatial-extent bounds.
The backend calls this with self.space bounds when a
TailorConfig carries no explicit bbox, so the request's
lat_lim / lon_lim become the ROI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
north
|
float
|
Northern latitude bound in degrees. |
required |
south
|
float
|
Southern latitude bound in degrees. |
required |
west
|
float
|
Western longitude bound in degrees. |
required |
east
|
float
|
Eastern longitude bound in degrees. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
list[float]: |
Source code in libs/providers/imagery/src/earthlens/eumetsat/tailor.py
earthlens.eumetsat.backend
#
Backend that fetches EUMETSAT Data Store products via eumdac.
EUMETSAT(AbstractDataSource) accepts the same constructor surface as
the other earthlens backends — start, end, variables, lat_lim,
lon_lim, temporal_resolution, path — plus a few backend-specific
kwargs for the OAuth2 consumer key / secret and group disambiguation.
Each (dataset_key, [selector, ...]) pair in the variables mapping
names one curated Data Store collection to search (bbox + window) and
fetch.
This backend's OUTPUT_KIND is per-instance, not fixed (G1).
EUMETSAT spans gridded imagery (SEVIRI / FCI L1.5/L1c, OLCI / SLSTR
grids) and swath / sounding products (S5P TROPOMI L2, ASCAT, IASI). The
class default is "raster"; __init__ resolves the requested
collection row(s) and copies the row's output_kind onto
self.OUTPUT_KIND. The earthlens.earthlens.EarthLens facade reads that
per-instance value at download() time to gate aggregate=.
A single request may name several collections, but they must all share
one output_kind — a mixed raster+vector request is rejected at
construction.
By default the backend fetches whole native products to disk (G4):
eumdac's Product.open() stream copied to a file. The selectors in
variables are informational for a whole-product fetch (G2), and bbox
is a search filter (which products intersect), not a pixel crop.
Server-side subset / reproject / reformat is EUMETSAT's Data Tailor
service, reached with download(tailor=TailorConfig(...)) (H4). That
routes each matching product through Data Tailor (submit → poll → stream →
delete) and returns the customised GeoTIFF / NetCDF paths instead of the
native product; every customisation is deleted afterwards for quota
hygiene (G7). Only catalog rows carrying a tailor_product_type are
Data-Tailor-eligible (G5).
tailor= is spatial; the temporal reducer is a separate aggregate=
knob (G1). download(aggregate=...) still raises NotImplementedError
— EUMETSAT native NetCDF products can be reduced client-side with pyramids
after download, and the two knobs compose (tailor server-side, then reduce
client-side).
EUMETSAT
#
Bases: AbstractDataSource
EUMETSAT Data Store backend (per-collection output kind).
Wraps eumdac so a user can search a curated EUMETSAT collection by
bbox + window and fetch its native products through the same
download() shape every other earthlens backend uses. One OAuth2
consumer key / secret authenticates across every collection.
Attributes:
| Name | Type | Description |
|---|---|---|
OUTPUT_KIND |
OutputKind
|
Class default |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 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 164 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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
__init__(start, end, variables, lat_lim, lon_lim, temporal_resolution='daily', path=None, fmt='%Y-%m-%d', group=None, consumer_key=None, consumer_secret=None, credentials_file=None)
#
Initialise an EUMETSAT backend instance.
Resolves every requested dataset key against the catalog
before calling the parent constructor, so the per-instance
OUTPUT_KIND is set from the resolved row(s). The parent
__init__ runs _initialize first (token mint), so the
resolution cannot live there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
str
|
Inclusive start date as a string (parsed with |
required |
end
|
str
|
Inclusive end date as a string. |
required |
variables
|
dict[str, list[str]]
|
Mapping from curated dataset key to a list of
selectors, e.g. |
required |
lat_lim
|
list[float]
|
|
required |
lon_lim
|
list[float]
|
|
required |
temporal_resolution
|
str
|
Advisory cadence label. Defaults to
|
'daily'
|
path
|
Path | str | None
|
Output directory. Created by the parent class if it does not exist. |
None
|
fmt
|
str
|
|
'%Y-%m-%d'
|
group
|
DataStoreGroup | str | None
|
Optional |
None
|
consumer_key
|
str | None
|
EUMETSAT consumer key. Falls back to
|
None
|
consumer_secret
|
str | None
|
EUMETSAT consumer secret. Falls back to
|
None
|
credentials_file
|
Path | str | None
|
Optional explicit path to a |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
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 164 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 | |
download(progress_bar=True, tailor=None)
#
Search the Data Store and return product paths (native or tailored).
With no tailor=, composes _search and _fetch to pull every
product matching the request bbox + window to self.root_dir as
whole native products (unchanged behaviour).
With tailor=TailorConfig(...), each matching product is routed
through EUMETSAT Data Tailor (server-side subset / reproject /
reformat, H4): submit a customisation, poll it to DONE, stream
the customised output(s) to self.root_dir, and delete the
customisation (G7). The returned paths are then the customised
GeoTIFF / NetCDF files, not the native products (G6).
aggregate= is the temporal reducer (G1) and is a separate
operation from the spatial tailor=; it is not implemented for
EUMETSAT, so a non-None aggregate raises NotImplementedError.
The two knobs compose — tailor server-side here, then reduce the
result client-side with pyramids.
The tailor branch is fail-fast per batch: if one product's customisation fails, the error propagates and paths already streamed for earlier products are not returned (their files remain on disk). This mirrors the native fetch; keep batches small when a partial result would be costly to recompute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress_bar
|
bool
|
Reserved for parity with the other backends;
|
True
|
tailor
|
TailorConfig | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
list[Path]: The native product paths, or — when |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/backend.py
earthlens.eumetsat.catalog
#
Dataset-catalog loader for the EUMETSAT Data Store backend.
Hosts Catalog, the pydantic-backed reader for the bundled EUMETSAT
catalog. Mirrors the shape of earthlens.earthdata.catalog and
earthlens.gee.catalog: the catalog ships as a directory of per-group
YAML files at src/earthlens/eumetsat/catalog/ (mtg.yaml, msg.yaml,
metop.yaml, sentinel3.yaml, sentinel5p.yaml, …) plus a single
_index.yaml carrying the merged available_datasets: list. Each
per-group file contributes its datasets: block; the loader unions them
into one Catalog at construction time.
A friendly dataset key (e.g. "msg-hrseviri") resolves to an
EumetsatDataset via Catalog.get_dataset / Catalog()["..."] /
Catalog.resolve. The row maps the friendly key to the real EUMETSAT
EO:EUM:DAT:… collection id (the string eumdac's get_collection
needs) and carries the fields the backend shapes a search and a fetch
from: group, mission, the per-instance output_kind (G1), the
on-disk format (so the aggregate= path knows which products are
pyramids-readable NetCDF vs native), the informational selectors
(G2), the tailor_product_type for the Data Tailor Chain
(the tailor= server-side path), and the spatial / temporal coverage.
available_datasets: is the informational index of every Data Store
collection id the browse walk found (the C7 auto-generated index); the
curated datasets: map is the vetted subset (here, the whole catalog).
The path to the bundled catalog directory lives at CATALOG_PATH; tests
redirect the loader by pointing that module attribute at a temporary
directory or a single YAML file.
Catalog
#
Bases: AbstractCatalog
Dataset catalog for the EUMETSAT Data Store backend.
Reads the bundled catalog/ directory (shipped as package data) and
exposes its consumed top-level sections as typed pydantic fields.
Instantiate with no arguments (Catalog()) — model_post_init
parses the YAML and populates every field in one pass. Mirrors the
earthlens.earthdata / earthlens.gee / earthlens.cmems catalogs:
datasets (the curated map) and available_datasets (the
informational index).
Attributes:
| Name | Type | Description |
|---|---|---|
available_datasets |
list[str]
|
Informational list of every Data Store collection id the browse walk found. Runtime code does not consume it. |
datasets |
dict[str, EumetsatDataset]
|
Structural map keyed by the curated dataset key. Each
value is an |
Examples:
- Resolve a curated dataset:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | |
get_catalog()
#
Return the structural per-dataset map.
Satisfies the abstract base's contract; the actual parsing is
done in model_post_init.
Returns:
| Type | Description |
|---|---|
dict[str, EumetsatDataset]
|
dict[str, EumetsatDataset]: One entry per curated dataset.
Same object as |
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
load(catalog_path=None)
classmethod
#
Read the EUMETSAT catalog from disk (cached).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog_path
|
Path | None
|
Path to the |
None
|
Returns:
| Type | Description |
|---|---|
Catalog
|
A fully-populated |
Raises:
| Type | Description |
|---|---|
ValueError
|
Propagated from |
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
resolve(key, group=None)
#
Resolve a dataset key, optionally disambiguated by group.
Most keys map one-to-one to a curated row; the inherited
:meth:get_dataset (with its did-you-mean) handles those. The
group= filter additionally asserts which Data Store group the
resolved dataset belongs to (G2) — the EUMETSAT analog of the
Earthdata backend's daac= filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Curated dataset key (a member of |
required |
group
|
DataStoreGroup | str | None
|
Optional |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
EumetsatDataset |
EumetsatDataset
|
The resolved row. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
Examples:
- Resolve a key and read its group:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
DataStoreGroup
#
Bases: StrEnum
The EUMETSAT Data Store collection groups (mission families).
Each value is the human-readable group label carried on a catalog
row's group: field and accepted by the backend's group= kwarg to
disambiguate a collection key shared across groups (G2).
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
EumetsatDataset
#
Bases: BaseModel
One curated EUMETSAT Data Store dataset (collection) row.
Mirrors a single datasets.<key>: block in one of the per-group
catalog/*.yaml files. The friendly dataset key is the parent key
in Catalog.datasets and is not stored on the row.
Attributes:
| Name | Type | Description |
|---|---|---|
collection_id |
str
|
The real Data Store collection id the search
uses, e.g. |
group |
DataStoreGroup
|
The Data Store group (mission family) this dataset
belongs to — used by the backend's |
mission |
str
|
Short mission tag ( |
output_kind |
OutputKindLiteral
|
The per-dataset output shape — |
format |
str
|
On-disk product format ( |
cadence |
CadenceLiteral
|
Native temporal cadence (advisory). |
timeliness |
TimelinessLiteral | None
|
Delivery timeliness of the dataset — |
selectors |
list[str]
|
Informational product-type / band selectors ( |
tailor_product_type |
str | None
|
The Data Tailor product-type id for the
|
extent |
Extent
|
|
temporal |
TemporalCoverage
|
|
Examples:
- Inspect a curated raster row:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
Extent
#
Bases: BaseModel
Spatial coverage of an EUMETSAT collection (lat / lon bounds).
Mirrors the extent: block in the YAML. Whole-disk geostationary
products (SEVIRI / FCI) use the ~±79° sub-satellite extent; polar /
mirror products are global.
Attributes:
| Name | Type | Description |
|---|---|---|
lat |
list[float]
|
|
lon |
list[float]
|
|
Examples:
- A geostationary 0° disk extent:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
TemporalCoverage
#
Bases: BaseModel
Temporal coverage of an EUMETSAT collection (start + optional end).
Mirrors the temporal: block in the YAML. end: null (or a missing
end) means the collection is ongoing / rolling.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
str | None
|
First date with data, as a |
end |
str | None
|
Last date with data, or |
Examples:
- An ongoing collection:
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
clear_catalog_cache()
#
Empty the module-level catalog parse cache.
Useful in tests that rewrite the catalog on disk and want to force a
re-parse. Production callers do not need this — the cache keys
include every contributing file's st_mtime_ns, so any real file
mutation invalidates the entry on its own.
Source code in libs/providers/imagery/src/earthlens/eumetsat/catalog.py
earthlens.eumetsat.auth
#
Credentials and authentication for the EUMETSAT Data Store backend.
Hosts EumetsatAuth, an earthlens.base.AbstractAuth subclass that
wraps eumdac.AccessToken. A single EUMETSAT consumer key / secret pair
mints the OAuth2 bearer token that unlocks every Data Store collection
the backend reaches — MTG-I1 FCI, MSG SEVIRI, Metop (ASCAT / IASI), the
Sentinel-3 / -5P / -6 mirrors, and the OSI SAF / CDR / FDR families. The
bearer is short-lived (~1 h) and eumdac refreshes it transparently;
this wrapper re-mints a fresh AccessToken only when the cached one has
expired.
The auth wrapper exists so that:
- The backend builds an
EumetsatCredentialsvalue object up front, validates it with pydantic, and passes it throughsuper().__init__(creds)— consistent withEarthdataAuth/CmemsAuth. configure()is idempotent — a second call afteris_authenticated()returnsTrueshort-circuits, so it is safe to call from long-lived workers without re-minting on everydownload().eumdacauth failures surface as the cross-backendearthlens.base.AuthenticationError, so a caller can write oneexcept AuthenticationErrorclause across CMEMS / Earthdata / EUMETSAT.
The credentials-resolution priority used by configure() is:
EUMETSAT_CONSUMER_KEY/EUMETSAT_CONSUMER_SECRETenvironment variables.- The
consumer_key/consumer_secretpassed to the constructor. - A
~/.eumdac/credentialsfile (a singlekey,secretline, the formateumdac set-credentialswrites; the directory is overridable viaEUMDAC_CONFIG_DIR, or pointed at explicitly withcredentials_file).
AuthenticationError
#
Bases: AuthenticationError
Raised when eumdac cannot mint an OAuth2 token.
Wraps the underlying eumdac / HTTP failure with a message that
names a fix: register a consumer key / secret at the EUMETSAT API-key
page, set the EUMETSAT_CONSUMER_KEY / EUMETSAT_CONSUMER_SECRET
environment variables, or write a ~/.eumdac/credentials file.
A subclass of the cross-backend earthlens.base.AuthenticationError
so callers can catch every backend's auth failure with one except
clause.
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
EumetsatAuth
#
Bases: AbstractAuth[EumetsatCredentials]
Authenticate against the EUMETSAT Data Store (OAuth2).
Wraps eumdac.AccessToken in the earthlens.base.AbstractAuth
contract. configure() resolves a consumer key / secret pair
(environment → constructor kwargs → ~/.eumdac/credentials) and
mints an eumdac.AccessToken, which auto-refreshes the ~1 h bearer
internally. The datastore / datatailor helpers build the matching
eumdac clients from the live token.
The class is a context manager (inherited from AbstractAuth):
with EumetsatAuth(creds) as auth: ... calls configure() on enter
and the default no-op close() on exit.
Attributes:
| Name | Type | Description |
|---|---|---|
_creds |
The |
|
_token |
The |
Examples:
-
Build, configure, inspect — marked
# doctest: +SKIPbecause it mints a real OAuth2 token:
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
__init__(credentials)
#
Store credentials; does not authenticate.
Construction is side-effect-free — the user (or the backend's
_initialize) must call configure (or use the context-manager
form) to mint a token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
credentials
|
EumetsatCredentials
|
The |
required |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
configure()
#
Mint the OAuth2 token via eumdac.AccessToken.
Idempotent — short-circuits when is_authenticated already
returns True. Resolves the consumer key / secret pair
(environment → kwargs → credentials file), then constructs an
eumdac.AccessToken((key, secret)). The token object refreshes
the ~1 h bearer internally; this wrapper re-mints a fresh one
only after the cached token's expiration has passed (see
is_authenticated).
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When no credential pair resolves, or
|
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
datastore()
#
Return an eumdac.DataStore bound to the live token.
Returns:
| Type | Description |
|---|---|
Any
|
eumdac.DataStore: The Data Store client used to resolve collections and search products. |
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
datatailor()
#
Return an eumdac.DataTailor bound to the live token.
Used by the Data Tailor (server-side subset / reproject / reformat)
path — EUMETSAT.download(tailor=...). The native whole-product
fetch does not call this.
Returns:
| Type | Description |
|---|---|
Any
|
eumdac.DataTailor: The Data Tailor client. |
Raises:
| Type | Description |
|---|---|
ImportError
|
When the |
AuthenticationError
|
When |
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
is_authenticated()
#
Return whether a live, unexpired token is held.
Cheap predicate — does not call the network. Returns True only
when configure() has minted a token whose expiration
(a datetime) is still in the future; an expired token reports
False so configure() re-mints. A token whose expiration
cannot be read is treated as live (the SDK refreshes it lazily).
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
Source code in libs/providers/imagery/src/earthlens/eumetsat/auth.py
EumetsatCredentials
#
Bases: BaseModel
Frozen value object holding the EUMETSAT consumer key / secret.
Every field is optional — the auth wrapper resolves the actual pair
at configure() time from the environment, these fields, then the
~/.eumdac/credentials file. Validation is intentionally permissive;
the real "do these creds work?" gate is
EumetsatAuth.configure, which mints a token against the OAuth2
endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
consumer_key |
str | None
|
The EUMETSAT consumer key (the OAuth2 client id).
|
consumer_secret |
SecretStr | None
|
The matching consumer secret, stored as a
|
credentials_file |
Path | None
|
Optional explicit path to a |
Examples:
- All fields optional — rely on env / credentials file:
- SecretStr hides the secret in repr: