FLODIS — API reference#
FLODIS observed flood footprints ↔ impacts data source subpackage — earthlens.flodis.
Background and usage are covered under the other pages in this section
(Introduction, Usage); this page is the rendered
API. FLODIS needs no credentials — the Zenodo record is public (CC-BY-4.0).
earthlens.flodis
#
FLODIS observed-flood footprints <-> impacts backend.
Fetches the FLODIS dataset (Mester, Frieler & Schewe, PIK; Sci Data 10, 482,
2023) from its pinned static Zenodo record, and returns per-event impact records
as a :class:pandas.DataFrame. FLODIS is the observed hazard-footprint -> impact
bridge: it links EM-DAT fatalities + economic damages (dataset="damages") and
IDMC displacements (dataset="displacement") to Global Flood Database satellite
flood footprints, adding per-event affected population, GDP and
critical-infrastructure counts. The global companion to the European hanze
backend, and to the raw impact tables in emdat.
FLODIS carries the join keys — disasterno (EM-DAT) on the damages table,
GID_1 / GID_2 (GADM) on the displacement table — but does not re-fetch the
footprints: the GDIS geometry comes from the shipped emdat backend and the GFD
extents from the shipped gee backend (GLOBAL_FLOOD_DB/MODIS_EVENTS/V1), joined
on those keys.
This is a tabular backend: the result is a table of per-event impact rows, not
a gridded array, so the :class:earthlens.earthlens.EarthLens facade rejects an
aggregate= argument.
FLODIS needs no credentials — the Zenodo record is public (CC-BY-4.0) — so
there is no auth class and no [flodis] extra: the only dependencies (HttpClient,
pandas) are core.
Public surface (re-exported from this package):
- :class:
FLODIS— the backend; instantiate withdataset=and optionalcountry=/gid=/ date filters, then call :meth:FLODIS.download. - :class:
Catalog— loader for the bundledflodis_data_catalog.yaml. - :class:
ZenodoRecord/ :class:FlodisDataset— the catalog's frozen row models. - :data:
CATALOG_PATH— path to the bundled catalog YAML; monkey-patchable in tests.
Examples:
-
List the selectable tables:
Catalog
#
Bases: AbstractCatalog
Catalog for the FLODIS backend.
Reads the bundled flodis_data_catalog.yaml (shipped as package data) and
exposes the pinned Zenodo record, the two selectable tables (as
:class:FlodisDataset rows keyed by dataset under the inherited
:attr:datasets field — the cat["damages"] / "damages" in cat /
len(cat) dict surface), and the friendly-name -> CSV-header map.
Instantiate with no arguments (Catalog()).
Attributes:
| Name | Type | Description |
|---|---|---|
datasets |
dict[str, FlodisDataset]
|
Map from a |
record |
ZenodoRecord | None
|
The pinned :class: |
columns |
dict[str, str]
|
Friendly name -> exact FLODIS CSV header. |
Examples:
- List the tables, resolve one, and read the pinned record:
- An unknown table raises with a did-you-mean hint:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
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 | |
column(friendly)
#
Return the exact FLODIS CSV header for a friendly column name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
friendly
|
str
|
A friendly key from the catalog's |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The exact CSV header ( |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Examples:
- Map friendly keys to their exact FLODIS headers:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
dataset(name)
#
Return the :class:FlodisDataset for name, with a did-you-mean hint.
Thin typed alias over :meth:~earthlens.base.AbstractCatalog.get_dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A FLODIS table name ( |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FlodisDataset |
FlodisDataset
|
The matching row. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
- Resolve a table and read its file name:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
get_catalog()
#
Return the table map (satisfies the abstract contract).
Returns:
| Type | Description |
|---|---|
dict[str, FlodisDataset]
|
dict[str, FlodisDataset]: Same object as :attr: |
Examples:
- The table map is keyed by the
datasetstring:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
load(catalog_path=None)
classmethod
#
Read the FLODIS catalog from disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog_path
|
Path | None
|
Path to the catalog YAML. Defaults to the module-level
:data: |
None
|
Returns:
| Type | Description |
|---|---|
Catalog
|
A fully-populated :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
- Loading the bundled catalog yields the pinned record and tables:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
tables()
#
Return the registered table names, sorted.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: The table names ( |
Examples:
- The registered tables come back sorted:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
FLODIS
#
Bases: AbstractDataSource
FLODIS observed-flood impacts backend (tabular).
Downloads the selected FLODIS table from its pinned Zenodo release, filters
it by country / GADM code / date window, and returns a
:class:pandas.DataFrame carrying the join keys (disasterno for damages,
GID_1 / GID_2 for displacement) so a caller can join to the shipped
emdat (GDIS) footprints and gee (Global Flood Database) extents.
The record is public (CC-BY-4.0); no credentials are needed.
Attributes:
| Name | Type | Description |
|---|---|---|
OUTPUT_KIND |
OutputKind
|
|
REQUIRES_TIME_WINDOW |
|
Examples:
-
Pull Mozambique flood-damage events, or the displacement table, through the facade (both fetch from Zenodo, so this is illustrative, not a doctest):
from earthlens.core import EarthLens damages = EarthLens( "flodis", dataset="damages", country="MOZ", start="2000", end="2018" ).download() # a pandas.DataFrame keyed on disasterno displacement = EarthLens( "flodis", dataset="displacement", country="MOZ" ).download() # a pandas.DataFrame keyed on GID_1 / GID_2
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
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 | |
__init__(start=None, end=None, lat_lim=None, lon_lim=None, temporal_resolution='all', path=None, fmt='%Y-%m-%d', dataset='damages', variables=None, country=None, gid=None, timeout=120.0)
#
Initialise a FLODIS backend instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
str | None
|
Inclusive start of an optional window, parsed with |
None
|
end
|
str | None
|
Inclusive end of the optional window; |
None
|
lat_lim
|
list[float] | None
|
Accepted for facade parity but not a filter axis — FLODIS
tables carry no per-row coordinates (footprints come from the
|
None
|
lon_lim
|
list[float] | None
|
Accepted for facade parity; see |
None
|
temporal_resolution
|
str
|
FLODIS issues one query over the whole window,
so this is the sentinel |
'all'
|
path
|
Path | str | None
|
Output directory for the cached CSV and the written table. Created by the parent class if absent. |
None
|
fmt
|
str
|
|
'%Y-%m-%d'
|
dataset
|
str
|
Which table to fetch — |
'damages'
|
variables
|
list[str] | None
|
FLODIS has no variable axis ( |
None
|
country
|
str | list[str] | None
|
One ISO3 country code or a list of them ( |
None
|
gid
|
str | list[str] | None
|
One GADM code or a list of them, matched against the
displacement table's |
None
|
timeout
|
float
|
Per-request timeout in seconds for the Zenodo download. |
120.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
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 | |
download(progress_bar=True)
#
Fetch the selected FLODIS table and return it.
Runs the download + filter, writes the result to path as a CSV, and
returns it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress_bar
|
bool
|
Whether to draw a download progress bar. Passed through
to the transport, so |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pandas.DataFrame: The filtered per-event impact rows, carrying the
join keys ( |
Raises:
| Type | Description |
|---|---|
HTTPError
|
If the Zenodo download returns a non-2xx status. |
ValueError
|
If the download's body fails its content guard (an HTML error page served with a 200 status). |
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
FlodisDataset
#
Bases: BaseModel
One selectable FLODIS table (a row of the catalog's dict surface).
The dataset string ("damages", "displacement") is the parent key in
:attr:Catalog.datasets and is not stored on the row.
Attributes:
| Name | Type | Description |
|---|---|---|
file |
str
|
The file name on the Zenodo record
( |
description |
str
|
One-line human-readable summary. |
key_columns |
tuple[str, ...]
|
The join-key column(s) the table is keyed on — |
Examples:
- The content URL is composed from the pinned record and file name:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
content_url(record)
#
Return the Zenodo REST content URL this table is served from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
int
|
The pinned record id the file belongs to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
|
Examples:
- Compose the REST content URL for a table on a record:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
ZenodoRecord
#
Bases: BaseModel
The pinned Zenodo record FLODIS is fetched from.
Attributes:
| Name | Type | Description |
|---|---|---|
record |
int
|
The pinned Zenodo record id ( |
concept_doi |
str
|
The dataset DOI as cited in the paper. Recorded for the citation and a future refresh check; never used to fetch. |
version |
str
|
The dataset version label, if the record carries one. |
data_period |
str
|
The |
license |
str
|
SPDX-ish licence id ( |
attribution |
str
|
The citation obligation the licence carries. |
Examples:
- The record is the pinned id, and the licence is CC-BY-4.0:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
earthlens.flodis.backend
#
Backend that fetches the FLODIS observed-flood impact tables.
FLODIS(AbstractDataSource) downloads one of the two FLODIS tables — damages
(EM-DAT fatalities + economic damages) or displacement (IDMC displacements),
each matched to Global Flood Database satellite footprints — from its pinned
static Zenodo record, filters it, and returns the per-event impact records as a
:class:pandas.DataFrame. It is the observed hazard-footprint -> impact bridge:
the global companion to the European hanze backend, and to the raw impact
tables in emdat.
Three design points carry this backend:
dataset=selects the table.dataset="damages"(default) returns the EM-DAT deaths/damages table keyed ondisasterno;dataset="displacement"returns the IDMC table keyed onGID_1/GID_2. The selector rides the facade's native-datasetpath (thes3precedent), soEarthLens("flodis", dataset="displacement", ...)reaches the backend as adataset=kwarg. FLODIS has no variable axis: a non-emptyvariables=is rejected.- Fetch the tables; join footprints via shipped backends. FLODIS carries the
join keys (
disasterno,GID_1/GID_2) but does not re-fetch the footprints — the GDIS geometry comes from the shippedemdatbackend and the GFD extents from the shippedgeebackend, joined on those keys. The tables have no per-row coordinates, solat_lim/lon_limare accepted (the facade always supplies them) but are not a filter axis; filter bycountry=(ISO3),gid=(GADM, displacement only) and the date window instead. - No new dependency.
HttpClient+ pandas are core and the Zenodo record is public (CC-BY-4.0), so there is no auth and no[flodis]extra.
These are per-event impact records, not gridded rasters, so aggregate= is
refused and nothing here imports a gridded-array library (no xarray).
FLODIS
#
Bases: AbstractDataSource
FLODIS observed-flood impacts backend (tabular).
Downloads the selected FLODIS table from its pinned Zenodo release, filters
it by country / GADM code / date window, and returns a
:class:pandas.DataFrame carrying the join keys (disasterno for damages,
GID_1 / GID_2 for displacement) so a caller can join to the shipped
emdat (GDIS) footprints and gee (Global Flood Database) extents.
The record is public (CC-BY-4.0); no credentials are needed.
Attributes:
| Name | Type | Description |
|---|---|---|
OUTPUT_KIND |
OutputKind
|
|
REQUIRES_TIME_WINDOW |
|
Examples:
-
Pull Mozambique flood-damage events, or the displacement table, through the facade (both fetch from Zenodo, so this is illustrative, not a doctest):
from earthlens.core import EarthLens damages = EarthLens( "flodis", dataset="damages", country="MOZ", start="2000", end="2018" ).download() # a pandas.DataFrame keyed on disasterno displacement = EarthLens( "flodis", dataset="displacement", country="MOZ" ).download() # a pandas.DataFrame keyed on GID_1 / GID_2
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
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 | |
__init__(start=None, end=None, lat_lim=None, lon_lim=None, temporal_resolution='all', path=None, fmt='%Y-%m-%d', dataset='damages', variables=None, country=None, gid=None, timeout=120.0)
#
Initialise a FLODIS backend instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
str | None
|
Inclusive start of an optional window, parsed with |
None
|
end
|
str | None
|
Inclusive end of the optional window; |
None
|
lat_lim
|
list[float] | None
|
Accepted for facade parity but not a filter axis — FLODIS
tables carry no per-row coordinates (footprints come from the
|
None
|
lon_lim
|
list[float] | None
|
Accepted for facade parity; see |
None
|
temporal_resolution
|
str
|
FLODIS issues one query over the whole window,
so this is the sentinel |
'all'
|
path
|
Path | str | None
|
Output directory for the cached CSV and the written table. Created by the parent class if absent. |
None
|
fmt
|
str
|
|
'%Y-%m-%d'
|
dataset
|
str
|
Which table to fetch — |
'damages'
|
variables
|
list[str] | None
|
FLODIS has no variable axis ( |
None
|
country
|
str | list[str] | None
|
One ISO3 country code or a list of them ( |
None
|
gid
|
str | list[str] | None
|
One GADM code or a list of them, matched against the
displacement table's |
None
|
timeout
|
float
|
Per-request timeout in seconds for the Zenodo download. |
120.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
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 | |
download(progress_bar=True)
#
Fetch the selected FLODIS table and return it.
Runs the download + filter, writes the result to path as a CSV, and
returns it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
progress_bar
|
bool
|
Whether to draw a download progress bar. Passed through
to the transport, so |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pandas.DataFrame: The filtered per-event impact rows, carrying the
join keys ( |
Raises:
| Type | Description |
|---|---|
HTTPError
|
If the Zenodo download returns a non-2xx status. |
ValueError
|
If the download's body fails its content guard (an HTML error page served with a 200 status). |
Source code in libs/providers/hazards/src/earthlens/flodis/backend.py
earthlens.flodis.catalog
#
Catalog for the FLODIS observed-flood impacts backend.
FLODIS ships two small tabular products — damages (EM-DAT fatalities and
economic damages matched to Global Flood Database footprints) and displacement
(IDMC displacements matched to the same) — published on a pinned Zenodo record.
This module is the bridge between the friendly request vocabulary
(dataset="damages", country="MOZ") and what the release actually ships: the
pinned record, the per-dataset file names and join keys, and the friendly-name
-> CSV-header map.
Three shapes are modelled, all frozen:
- :class:
ZenodoRecord— the pinned record, its DOI,data_period, licence and attribution. Pinning a record id rather than a moving branch is what makes a request reproducible. - :class:
FlodisDataset— one selectable table (its Zenodo file name, a description, and its join-key columns). These are the catalog's dict-surface rows, keyed bydatasetname ("damages"/"displacement") under the inherited :attr:datasetsfield. - the
columnsmap — friendly name -> exact FLODIS CSV header, so the backend locates the selector / join-key / impact columns without hard-coding spellings.
:class:Catalog is a thin :class:earthlens.base.AbstractCatalog subclass that
loads the bundled flodis_data_catalog.yaml (shipped as package data) through
the shared :func:~earthlens.base.catalog_source.load_catalog (with a
:class:~earthlens.base.yaml_loader.CatalogParseCache), mirroring
hanze/catalog.py. :data:CATALOG_PATH is the path to the bundled YAML and is
monkey-patchable in tests.
Catalog
#
Bases: AbstractCatalog
Catalog for the FLODIS backend.
Reads the bundled flodis_data_catalog.yaml (shipped as package data) and
exposes the pinned Zenodo record, the two selectable tables (as
:class:FlodisDataset rows keyed by dataset under the inherited
:attr:datasets field — the cat["damages"] / "damages" in cat /
len(cat) dict surface), and the friendly-name -> CSV-header map.
Instantiate with no arguments (Catalog()).
Attributes:
| Name | Type | Description |
|---|---|---|
datasets |
dict[str, FlodisDataset]
|
Map from a |
record |
ZenodoRecord | None
|
The pinned :class: |
columns |
dict[str, str]
|
Friendly name -> exact FLODIS CSV header. |
Examples:
- List the tables, resolve one, and read the pinned record:
- An unknown table raises with a did-you-mean hint:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
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 | |
column(friendly)
#
Return the exact FLODIS CSV header for a friendly column name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
friendly
|
str
|
A friendly key from the catalog's |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The exact CSV header ( |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Examples:
- Map friendly keys to their exact FLODIS headers:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
dataset(name)
#
Return the :class:FlodisDataset for name, with a did-you-mean hint.
Thin typed alias over :meth:~earthlens.base.AbstractCatalog.get_dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A FLODIS table name ( |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FlodisDataset |
FlodisDataset
|
The matching row. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
- Resolve a table and read its file name:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
get_catalog()
#
Return the table map (satisfies the abstract contract).
Returns:
| Type | Description |
|---|---|
dict[str, FlodisDataset]
|
dict[str, FlodisDataset]: Same object as :attr: |
Examples:
- The table map is keyed by the
datasetstring:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
load(catalog_path=None)
classmethod
#
Read the FLODIS catalog from disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog_path
|
Path | None
|
Path to the catalog YAML. Defaults to the module-level
:data: |
None
|
Returns:
| Type | Description |
|---|---|
Catalog
|
A fully-populated :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
- Loading the bundled catalog yields the pinned record and tables:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
tables()
#
Return the registered table names, sorted.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: The table names ( |
Examples:
- The registered tables come back sorted:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
FlodisDataset
#
Bases: BaseModel
One selectable FLODIS table (a row of the catalog's dict surface).
The dataset string ("damages", "displacement") is the parent key in
:attr:Catalog.datasets and is not stored on the row.
Attributes:
| Name | Type | Description |
|---|---|---|
file |
str
|
The file name on the Zenodo record
( |
description |
str
|
One-line human-readable summary. |
key_columns |
tuple[str, ...]
|
The join-key column(s) the table is keyed on — |
Examples:
- The content URL is composed from the pinned record and file name:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
content_url(record)
#
Return the Zenodo REST content URL this table is served from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
int
|
The pinned record id the file belongs to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
|
Examples:
- Compose the REST content URL for a table on a record:
Source code in libs/providers/hazards/src/earthlens/flodis/catalog.py
ZenodoRecord
#
Bases: BaseModel
The pinned Zenodo record FLODIS is fetched from.
Attributes:
| Name | Type | Description |
|---|---|---|
record |
int
|
The pinned Zenodo record id ( |
concept_doi |
str
|
The dataset DOI as cited in the paper. Recorded for the citation and a future refresh check; never used to fetch. |
version |
str
|
The dataset version label, if the record carries one. |
data_period |
str
|
The |
license |
str
|
SPDX-ish licence id ( |
attribution |
str
|
The citation obligation the licence carries. |
Examples:
- The record is the pinned id, and the licence is CC-BY-4.0: