GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - agent-engineering-studio/effis-client: Client for the public EFFIS services: burnt-area perimeters (WFS) and the official Fire Weather Index rasters (WMS), MapServer quirks included

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
benchmarks
benchmarks
 
 
demo
demo
 
 
docs
docs
 
 
notebooks
notebooks
 
 
scripts
scripts
 
 
skills/effis-client
skills/effis-client
 
 
src/effis_client
src/effis_client
 
 
tests
tests
 
 
tools
tools
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
compose.yaml
compose.yaml
 
 
publiccode.yml
publiccode.yml
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 
zensical.toml
zensical.toml
 
 

Repository files navigation

๐Ÿ”ฅ effis-client

Europe's official wildfire data, in three lines of async Python.

Burnt-area perimeters and the official Fire Weather Index from EFFIS, the European Forest Fire Information System of the Copernicus Emergency Management Service. No account. No API key. No silent failures.

ci PyPI Python License: Apache-2.0 Data: CC BY 4.0 Typed Coverage

Map of Italy coloured by the official EFFIS Fire Weather Index on 1 August 2026: very high values across the south, Sardinia and Sicily, low values over the Alps

The official EFFIS Fire Weather Index over Italy on 1 August 2026, fetched with this library.


Contents

  • Why this exists
  • What you get
  • Install
  • Quick start
  • How it works
  • The MapServer traps it handles
  • Burnt-area perimeters
  • The Fire Weather Index chain
  • Cookbook
  • API reference
  • Error model
  • Who is it for
  • Roadmap and ideas
  • Contributing
  • Support the project
  • Data licence and attribution
  • License

Why this exists

Wildfires in Europe are getting larger, earlier and further north. The data to study them is public and excellent: EFFIS maps burnt areas from satellite imagery every fire season, and publishes the daily Fire Weather Index for the whole continent. Researchers, civil-protection teams, journalists, insurers and students all need it.

Getting it out programmatically, though, is a trap. The endpoints are MapServer, not GeoServer, and every habit you bring from GeoServer fails differently, usually without an error. You can get every fire ever recorded when you asked for one summer. You can get a raster that says "no fire danger anywhere" when it really means "no data". The HTTP status is 200 either way.

effis-client is the small, boring, well-tested layer that knows these traps, so your analysis does not inherit them.

Two HTTP calls, nine ways to get them silently wrong. This library exists so you never have to discover them yourself.

What you get

๐Ÿ—บ๏ธ Burnt-area perimeters GeoJSON polygons from the EFFIS WFS (nrt.ba.poly), filtered to your bounding box and date range
๐ŸŒก๏ธ Official Fire Weather Index The complete Canadian FWI System (FWI, FFMC, DMC, DC, ISI, BUI) as raw float values, sampled at any point
๐Ÿ›ก๏ธ No silent failures XML errors disguised as HTTP 200 raise EffisError; an all-zero "no data" raster returns None, never 0.0
โšก Async-first Built on httpx.AsyncClient, which you inject: your timeouts, retries, proxies and connection pool
๐Ÿงฉ Bring your own HTTP Every step is also a pure function: build parameters, send them with any client, parse the response
๐Ÿชถ Tiny footprint One required dependency (httpx); numpy + rasterio only if you sample FWI rasters
โœ… Production quality mypy --strict, 100 % test coverage, py.typed, trusted publishing to PyPI
๐Ÿ›๏ธ A page for a municipality Burnt hectares year by year, the map, what burnt and today's official danger class, with Docker alone: docker compose up
๐Ÿงฎ Facts, not guesses Facts answers as plain dictionaries with the layer, the time of reading and the request count; an MCP server serves them; check_text refuses a number that is not in them
๐Ÿ“ How much to trust trust() says how far a list reaches: first year, smallest fire mapped, how long a row is still revised
โŒจ๏ธ A command line effis-client years --municipality Matera, danger, context, perimeters, check, mcp
๐Ÿ”“ Free and open Apache-2.0 code, CC BY 4.0 data, no credentials anywhere

Install

pip install effis-client           # burnt-area perimeters
pip install "effis-client[raster]" # + Fire Weather Index sampling (numpy, rasterio)
pip install "effis-client[bulk]"   # + bulk shapefile archives (geopandas, pyogrio, shapely)
pip install "effis-client[mcp]"    # + the MCP server for assistants: effis-client mcp

With uv:

uv add effis-client
uv add "effis-client[raster]"

Requires Python 3.12 or newer.

Quick start

import asyncio
from datetime import date

import httpx

from effis_client import fetch_fwi, fetch_perimeters


async def main() -> None:
    async with httpx.AsyncClient(timeout=60) as client:
        # Bounding boxes are (west, south, east, north) in EPSG:4326.
        perimeters = await fetch_perimeters(
            client,
            (16.5, 40.3, 16.8, 40.6),
            start=date(2021, 1, 1),
            end=date(2026, 12, 31),
        )
        print(len(perimeters.features), "fires since 2021")

        fwi = await fetch_fwi(
            client,
            date(2026, 11, 1),
            points=[(16.6, 40.6)],  # (lon, lat)
            bbox=(15.0, 39.5, 17.5, 41.5),
        )
        print(fwi)  # {(16.6, 40.6): 10.34...}, or None if EFFIS has no data


asyncio.run(main())

That is the whole API surface for most users: two functions.


How it works

flowchart LR
    subgraph app["Your application"]
        U["your code"]
        C["httpx.AsyncClient<br/><i>your timeouts, retries, proxy</i>"]
    end

    subgraph lib["effis-client"]
        FP["fetch_perimeters()"]
        FF["fetch_fwi()"]
        PP["perimeters_params()<br/>parse_perimeters()"]
        WP["fwi_params()<br/>check_tiff()<br/>sample_fwi()"]
        E["EffisError"]
    end

    subgraph effis["EFFIS ยท Copernicus EMS (MapServer)"]
        WFS[("WFS /gwis<br/>nrt.ba.poly")]
        WMS[("WMS /effis<br/>mf010.fwi, ffmc, ...")]
    end

    U --> FP & FF
    FP --> PP
    FF --> WP
    PP -- "GetFeature" --> C
    WP -- "GetMap image/tiff" --> C
    C --> WFS & WMS
    PP -. "XML instead of GeoJSON" .-> E
    WP -. "XML instead of GeoTIFF" .-> E
Loading

The library is split into two layers on purpose:

  1. Pure functions that build request parameters and parse responses. No I/O, trivially testable, usable with requests, aiohttp, a cache, a queue worker, anything.
  2. Thin fetch_* coroutines that glue the pure functions to the httpx.AsyncClient you pass in. The client is never created or closed by the library, so connection pooling, retries and timeouts stay under your control.

A perimeters request, step by step

sequenceDiagram
    autonumber
    participant App as your code
    participant Lib as fetch_perimeters
    participant WFS as EFFIS WFS (MapServer)

    App->>Lib: bbox, start, end
    Lib->>Lib: perimeters_params(bbox)<br/>lowercase WFS 1.1.0 keys, bbox only
    Lib->>WFS: GET /gwis?request=GetFeature&typename=nrt.ba.poly&bbox=...
    alt GeoJSON
        WFS-->>Lib: 200 FeatureCollection (whole history in bbox)
        Lib->>Lib: keep fires whose start date is in [start, end]
        Lib->>Lib: truncated = fetched >= max_features
        Lib-->>App: Perimeters(features, fetched, truncated)
    else MapServer exception
        WFS-->>Lib: 200 <ServiceExceptionReport>
        Lib-->>App: raise EffisError("code: message")
    end
Loading

An FWI request, step by step

sequenceDiagram
    autonumber
    participant App as your code
    participant Lib as fetch_fwi
    participant WMS as EFFIS WMS (MapServer)

    App->>Lib: day, points, bbox, component
    Lib->>Lib: fwi_params()<br/>layer mf010.{component}, lat/lon swap for WMS 1.3.0
    Lib->>WMS: GET /effis?REQUEST=GetMap&FORMAT=image/tiff&TIME=day
    alt GeoTIFF with data
        WMS-->>Lib: 200 float32 raster
        Lib->>Lib: sample pixel under each (lon, lat)
        Lib-->>App: {(lon, lat): value, ...}
    else GeoTIFF of all zeros (day outside the forecast)
        WMS-->>Lib: 200 raster, every pixel 0
        Lib-->>App: None  (missing data, not a calm day)
    else MapServer exception
        WMS-->>Lib: 200 <ServiceExceptionReport>
        Lib-->>App: raise EffisError("LayerNotDefined: ...")
    end
Loading

The MapServer traps it handles

Every row was found the hard way and checked again against the live service on 2 November 2026.

You try What actually happens What effis-client does
/gwis/ows (the GeoServer habit) the request hangs uses /gwis
a wrong typeName the connection closes mid-response, no 404 uses the verified nrt.ba.poly
CQL_FILTER for dates silently ignored: you get every fire ever filters dates locally, after the bbox query
bbox + filter together the connection dies sends only the bbox, or only the filter (fetch_where)
a filter value with < or & HTTP 502 escapes the value
FWI for a day before 31 May 2024 the capabilities say 2018, the answer is a raster of zeros returns None; FIRST_DAY records the date
camelCase WFS parameters refused by MapServer's WFS 1.1.0 sends lowercase keys
ecmwf007.fwi (the layer in the EFFIS docs) LayerNotDefined uses mf010.<component>
WMS 1.3.0 with lon/lat bbox order the wrong region, quietly swaps to lat/lon for you
any error HTTP 200 with an XML body raises EffisError with the code and message
FWI for a day past the forecast HTTP 200 with a raster of zeros returns None
a date filter on a shapefile download the column is FIREDATE in one archive and initialdat in the other: the DBF format cuts names at 10 characters matches the column whatever its case, and knows the cut name

The last one is the dangerous one:

Two FWI rasters for the same area side by side: the left one has real values with a point reading 10.34; the right one is uniformly zero and the library returns None

An all-zero FWI raster reads as "no fire danger anywhere". It means "no data". A dashboard or a model that takes it at face value will report calm weather on the day it has no information at all. effis-client returns None for it, so the absence of data stays visible.


Burnt-area perimeters

The EFFIS Rapid Damage Assessment maps burnt areas from satellite imagery (MODIS, VIIRS, Sentinel-2) during the fire season. Each feature is a GeoJSON polygon with properties like:

{
  "id": "384188",
  "fire_id": "384188",
  "initialdate": "2012-06-18 01:00:00",
  "finaldate": "2012-06-18 01:00:00",
  "area": "160"
}

area is in hectares. The start date is read from whichever of initialdate, firedate, FIREDATE or fire_date the layer carries (feature_date() does this for you).

Map of 924 burnt-area polygons in Basilicata and the surrounding area between 2012 and 2026, coloured from pale yellow for 2012 to dark red for 2026

Bar chart of burnt hectares per year from 2012 to 2026 in the same bounding box; 2017 and 2026 stand out, 2026 is the highest at 50,494 hectares across 150 fires

Both figures come from a single fetch_perimeters call: one bounding box returned 924 perimeters spanning 2012 to 2026.

Two layers, two questions

The same server publishes burnt areas twice, and they are not the same data. Measured on one box (Basilicata and its surroundings) on 28 November 2026:

  • nrt.ba.poly at /gwis, the default: 933 perimeters from 2012, the smallest of 73 ha, median 207 ha. An id, two dates and the area. It answers how much burnt, and since when: the long series of the larger fires.
  • ms:modis.ba.poly at /effis (MODIS_LAYER, EFFIS_WFS_URL): 843 perimeters from 2016, median 22 ha, 499 of them under 30 ha. It names the municipality and the province, says what land cover burnt and how much of it was Natura 2000. It answers where, and what burnt.

They do not count the same fires. On the same box in 2026: 158 perimeters and 50,277 ha in nrt.ba.poly, 203 perimeters and 15,488 ha in ms:modis.ba.poly. Only 62 of the 203 touch a perimeter of the other layer that started within five days; 99 of the 158 touch none at all, one of them of 882 ha. Where both map a fire they rarely agree on its size: 3,455 ha against 4,271 for the largest.

The larger total is not more fire. nrt.ba.poly lists heat that is not burnt vegetation. On the summit of Etna it has 255 perimeters from 2012 to 2026, 135,917 ha in all; the largest, 8,924 ha, is dated 16 February 2021, in the middle of winter and of an eruption. ms:modis.ba.poly has 6 fires there, on the wooded slopes. Stromboli: 18 perimeters against 3. Over Italy in 2026, 635 perimeters of nrt.ba.poly in the South and Sardinia, 187,029 ha, touch no perimeter of the other layer. The other way round, the richer layer has 1,501 fires that nrt.ba.poly lacks, but small ones: median 8 ha.

So for how much vegetation burnt, and where, read MODIS_LAYER. nrt.ba.poly stays the default of fetch_perimeters because it is what the library always read and the only one that reaches back to 2012: use it knowing that it counts lava. Nobody at EFFIS confirmed how it is built; this is what its rows show. A number must always say which layer it comes from.

The richer layer is also a record that changes. Its last update follows the fire by a median of 5 days, and by 534 days at the 90th percentile: past seasons are reprocessed. A number read today can differ next year.

from effis_client import EFFIS_WFS_URL, MODIS_LAYER, burnt_by_year, in_municipality

result = await fetch_perimeters(
    client,
    (16.4, 40.5, 16.8, 40.8),
    start=date(2016, 1, 1),
    end=date(2026, 12, 31),
    url=EFFIS_WFS_URL,
    layer=MODIS_LAYER,
)
matera = in_municipality(result.features, "Matera")  # 5 fires
burnt_by_year(matera)
# {2020: YearTotal(fires=1, area_ha=129.0), 2023: YearTotal(fires=1, area_ha=160.0),
#  2024: YearTotal(fires=1, area_ha=16.0),  2026: YearTotal(fires=2, area_ha=116.0)}

A year that is missing has no fire in the layer: before 2016 that is not the same as no fire.

No box is needed for a municipality: the server filters by name.

result = await effis_client.fetch_where(
    client, {"COMMUNE": "Matera"}
)  # the same 5 fires, one second

The name is exact, capitals included. An empty answer means "no fire listed, or a different spelling", never "no fire".

How much to trust a list

effis_client.trust(result.features)
# Trust(perimeters=843, first_year=2016, newest_fire=date(2026, 10, 18), smallest_ha=1.0,
#       median_ha=22.0, under_30_ha_share=0.589, revised=843,
#       revision_median_days=5, revision_p90_days=534)     # the Basilicata box

EFFIS states that fires under about 30 ha are mapped only in part: 59 % of the perimeters of that box are under it. What trust cannot say is how many fires are missing. For the small fires of Italy the regional registers of burnt areas are the reference.

Why dates are filtered locally

MapServer cannot filter by date on the server: CQL_FILTER is ignored and an OGC filter cannot be combined with bbox. So the library asks for the whole history inside the bbox and filters locally. In practice this is cheap: an Italian region is a few hundred perimeters and a few hundred kilobytes.

flowchart TD
    A["GetFeature(bbox, maxfeatures=5000)"] --> B{"body is GeoJSON?"}
    B -- no --> X["raise EffisError"]
    B -- yes --> C["all features in bbox<br/>(every year)"]
    C --> D{"start date readable?"}
    D -- "yes, in [start, end]" --> K["keep"]
    D -- "yes, outside" --> R["drop"]
    D -- "no date" --> K2["keep<br/><i>a real perimeter is not dropped</i>"]
    C --> T{"fetched >= max_features?"}
    T -- yes --> TR["truncated = True<br/><i>shrink the bbox</i>"]
    T -- no --> OK["truncated = False"]
Loading

truncated matters. If the response hits max_features (5000 by default), the local date filter worked on a partial set and a missing season could look like "no fires". When perimeters.truncated is True, shrink the bbox rather than trusting the gap.


The Fire Weather Index chain

The Canadian Forest Fire Weather Index System is the European standard for fire danger. EFFIS computes it daily on Mรฉtรฉo-France weather data and serves each component as a raster. This library asks for those rasters as float32 GeoTIFFs (raw values, not coloured map tiles) and samples them at your points.

flowchart LR
    subgraph weather["Daily weather at noon"]
        T["temperature"]
        H["relative humidity"]
        W["wind speed"]
        R["24 h rain"]
    end

    subgraph moisture["Fuel moisture codes"]
        FFMC["FFMC<br/>fine fuels<br/><i>hours</i>"]
        DMC["DMC<br/>duff layer<br/><i>weeks</i>"]
        DC["DC<br/>deep organic<br/><i>months</i>"]
    end

    subgraph behaviour["Fire behaviour indices"]
        ISI["ISI<br/>initial spread"]
        BUI["BUI<br/>fuel available"]
        FWI(["FWI<br/>fire intensity"])
    end

    T & H & W & R --> FFMC
    T & H & R --> DMC
    T & R --> DC
    FFMC --> ISI
    W --> ISI
    DMC & DC --> BUI
    ISI & BUI --> FWI
Loading
Component component= What it tracks
Fine Fuel Moisture Code "ffmc" moisture of litter and fine fuels; how easily a fire ignites
Duff Moisture Code "dmc" moisture of loosely compacted organic layers
Drought Code "dc" deep, slow-drying organic layers; seasonal drought
Initial Spread Index "isi" expected rate of spread
Buildup Index "bui" total fuel available for combustion
Fire Weather Index "fwi" (default) overall fire intensity; the headline number

Six small maps of Italy on 1 August 2026, one per FWI component: FWI, FFMC, DMC, DC, ISI and BUI, each in a yellow-to-dark-red scale

EFFIS classifies FWI into danger classes; for reference:

FWI < 5.2 5.2 โ€“ 11.2 11.2 โ€“ 21.3 21.3 โ€“ 38.0 38.0 โ€“ 50.0 โ‰ฅ 50.0
Danger very low low moderate high very high extreme

The official danger classes

effis_client.danger_class(30.5)  # 'High'

Six classes with fixed thresholds, the same over all of Europe: Low below 11.2, Moderate, High from 21.3, Very High from 38, Extreme from 50, Very Extreme from 70 (the EFFIS technical background page, read on 28 November 2026). A value on a boundary belongs to the higher class. They are classes of the weather: they say nothing of what can burn at a place, and they are not an alert.

At Matera, reading every third day from June to October 2026 (51 days): 15 days Very High, 14 High, 10 Extreme, 7 Very Extreme, 3 Low, 2 Moderate; the highest FWI was 77.0 on 30 August.

What the WMS accepts

  • Days: any past day, today and the next two. Beyond that you get the all-zero raster, which fetch_fwi turns into None.
  • Resolution: you choose the pixel size with step (degrees, default 0.05). The bbox and step set the raster's width and height.
  • Sea and points outside the bbox: sea pixels are zero on valid days too; a point on land reads its own pixel. Points outside the raster, or on a non-finite pixel, are left out of the result dict.

Facts for an assistant, and the context of a fire

A language model asked "how much burnt in Matera?" answers with a number, whether it has one or not. Facts gives it the number, with its source. The rule of every AI feature here: the numbers come from the data; a model may explain them, never invent them. Nothing in the library calls a model.

facts = effis_client.Facts(client)
await facts.burnt_areas(municipality="Matera")  # years, largest fire, land cover, trust
await facts.danger(16.6043, 40.6664)  # today and the next two days
await facts.fire_context_of("740998")  # one fire and the eight days before it

The fire context joins the two halves of the library. For the fire that started near Matera on 13 September 2026 (67 ha): the official FWI at the centre of the perimeter was Very High from 6 to 9 September (43.5 to 48.7), Extreme on the 10th (59.7), High on the 11th, Low on the 12th (7.8) and High again on the day of the fire (30.5). The sheet says which day each value is for, when it was read, and that it made 22 requests.

Its limits are in the sheet too. The rasters start on 31 May 2024: for the fire of 23 August 2020 all eight days are "not available", never zero. The FWI is a model run on a weather forecast and is revised. And the danger of the weather does not explain a fire by itself.

check_text(text, facts) lists the numbers of a text that are not in the facts. It catches an invented number, not a true one said of the wrong thing: on the faithfulness set, an answer with 3 wrong numbers out of 6 passes it, because all three are somewhere in the sheet. See the benchmark.

claude mcp add effis-client -- uvx --from "effis-client[mcp]" effis-client mcp

The MCP server has three tools: burnt_areas, fire_danger, fire_context.

The page of a municipality

docker compose up     # http://localhost:3006

The page for the municipality of Matera: the official fire danger of three days, burnt hectares per year from 2016 to 2026, a map of the perimeters, the list of five fires with what burnt, and how far to trust the list

Narrow on purpose: what EFFIS publishes about one place. No satellite hotspots, no risk for the place, no alert. Set the municipality in .env (EFFIS_CLIENT_PLACE, exactly as EFFIS writes it). For a public body: Per un ente pubblico.

With uv With Docker What
make demo docker compose up the page, port 3006
make mcp docker compose --profile mcp up mcp the MCP server over HTTP, port 8771
make lab docker compose --profile notebooks up notebooks the notebooks, port 8884
uv run effis-client --help docker compose run --rm cli --help the command line

make help lists every target.

Cookbook

Load perimeters into GeoPandas

import geopandas as gpd

perimeters = await fetch_perimeters(client, bbox, start=start, end=end)
gdf = gpd.GeoDataFrame.from_features(perimeters.features, crs="EPSG:4326")
gdf["area"] = gdf["area"].astype(float)  # hectares
print(gdf.sort_values("area", ascending=False).head())

Save perimeters to a GeoJSON file for QGIS

import json
from pathlib import Path

collection = {"type": "FeatureCollection", "features": perimeters.features}
Path("fires.geojson").write_text(json.dumps(collection))

Every FWI component for a list of weather stations, concurrently

from effis_client import COMPONENTS, fetch_fwi

stations = {"Potenza": (15.80, 40.64), "Matera": (16.60, 40.67), "Policoro": (16.68, 40.21)}
bbox = (15.0, 39.5, 17.5, 41.5)
day = date(2026, 8, 1)

results = await asyncio.gather(
    *(fetch_fwi(client, day, list(stations.values()), bbox, component=c) for c in COMPONENTS)
)
for component, values in zip(COMPONENTS, results):
    if values is None:
        print(component, "no data")
        continue
    for name, point in stations.items():
        print(f"{component:>4} {name:<9} {values.get(point)}")

A daily FWI time series for one season

from datetime import date, timedelta

point = (16.60, 40.67)
days = [date(2026, 6, 1) + timedelta(d) for d in range(92)]


async def one(day: date) -> tuple[date, float | None]:
    values = await fetch_fwi(client, day, [point], bbox=(16.0, 40.0, 17.0, 41.0))
    return day, None if values is None else values.get(point)


series = await asyncio.gather(*(one(d) for d in days))

Be kind to a free public service: cap concurrency (an asyncio.Semaphore or httpx.Limits(max_connections=4)) for long runs.

Retries, timeouts and a proxy, all yours

transport = httpx.AsyncHTTPTransport(retries=3)  # retries connection failures
async with httpx.AsyncClient(
    transport=transport,
    timeout=httpx.Timeout(60, connect=10),
    limits=httpx.Limits(max_connections=4),
    proxy="http://proxy.internal:3128",
) as client:
    perimeters = await fetch_perimeters(client, bbox, start=start, end=end)

Bring your own HTTP (sync, requests, a cache...)

Every step the fetch_* functions perform is public and pure:

import requests

from effis_client import (
    WFS_URL,
    perimeters_params,
    parse_perimeters,
    WMS_URL,
    fwi_params,
    check_tiff,
    sample_fwi,
)

r = requests.get(WFS_URL, params=perimeters_params(bbox), timeout=60)
r.raise_for_status()
perimeters = parse_perimeters(r.content, start=start, end=end)

r = requests.get(WMS_URL, params=fwi_params(day, bbox, component="isi"), timeout=60)
r.raise_for_status()
isi = sample_fwi(check_tiff(r.headers["content-type"], r.content), points)

This is also the easy way to cache responses on disk, run inside a worker queue, or test your own code against recorded fixtures.

Join perimeters and FWI: what was the danger on the day each fire started?

from effis_client import feature_date

for feature in perimeters.features[:20]:
    day = feature_date(feature)
    if day is None:
        continue
    lon, lat = feature["geometry"]["coordinates"][0][0]  # first vertex is enough here
    bbox = (lon - 0.5, lat - 0.5, lon + 0.5, lat + 0.5)
    values = await fetch_fwi(client, day, [(lon, lat)], bbox)
    print(day, feature["properties"]["area"], "ha", "FWI:", values and values.get((lon, lat)))

This is the kind of question effis-client was built for: it comes from Limen, which uses the perimeters as the truth set for its wildfire backtest.


API reference

All names are importable from the package root.

Perimeters

Name Kind Description
fetch_perimeters(client, bbox, *, start, end, url=WFS_URL, layer=LAYER, max_features=5000) async Burnt-area perimeters intersecting bbox whose fire started in [start, end]
Perimeters frozen dataclass features: list[dict], fetched: int (before the date filter), truncated: bool
perimeters_params(bbox, *, layer, max_features) pure Query parameters of the WFS GetFeature request
parse_perimeters(content, *, start, end, max_features) pure Parse a response body; raises EffisError on non-GeoJSON
feature_date(feature) pure The fire's start date, or None
perimeter_attributes(feature) pure PerimeterAttributes of one feature, read from whichever field the WFS layer or a bulk file uses
PerimeterAttributes frozen dataclass id, fire_date, area_ha, country, province; on the richer layer also municipality, final_date, last_update, land_cover: dict[str, float] (percent), natura2000_pct
in_municipality(features, name) pure The features EFFIS assigns to a municipality (richer layer only)
burnt_by_year(features) pure {year: YearTotal(fires, area_ha)}; a year with no fire is absent, not zero
fetch_where(client, equals, *, start, end, url=EFFIS_WFS_URL, layer=MODIS_LAYER, max_features=5000) async Perimeters whose properties have these values: {"COMMUNE": "Matera"}, {"id": "740998"}
where_params(equals, *, layer, max_features) pure Query parameters of that request, values escaped
trust(features) / Trust pure How far a list reaches: first year, smallest fire, revisions
EFFIS_WFS_URL, MODIS_LAYER, MODIS_FIRST_YEAR, LAND_COVER_FIELDS constants โ€ฆ/effis, "ms:modis.ba.poly", 2016, the land-cover columns and their names
WFS_URL, LAYER, DEFAULT_MAX_FEATURES constants โ€ฆ/gwis, "nrt.ba.poly", 5000

Fire Weather Index

Name Kind Description
fetch_fwi(client, day, points, bbox, *, component="fwi", step=0.05, url=WMS_URL) async {(lon, lat): value}, or None if EFFIS has no data for day
fwi_params(day, bbox, *, component, step) pure Query parameters of the WMS GetMap request
check_tiff(content_type, body) pure Return the body if it is a GeoTIFF, else raise EffisError
sample_fwi(tiff, points) pure Sample the raster under each point; None if all zeros; EffisError if the bytes are not a readable raster (needs [raster])
fwi_chain(samples) pure Regroup {component: sample_fwi result} of one day as {(lon, lat): {component: value}}, dropping sea pixels (FFMC of zero)
outlook_days(today) pure The days the service has a forecast for: today and the next two
danger_class(fwi) pure The official EFFIS class: Low below 11.2, Moderate, High from 21.3, Very High from 38, Extreme from 50, Very Extreme from 70
DANGER_CLASSES, DangerClass, OUTLOOK_DAYS constants / type The six classes with the FWI each starts at; 2
FIRST_DAY constant date(2024, 5, 31): the first day the rasters have data, as measured
COMPONENTS, Component constants / type ("fwi", "ffmc", "dmc", "dc", "isi", "bui") and its Literal
WMS_URL constant โ€ฆ/effis

Facts, checks and the command line

Name Kind Description
Facts(client, *, clock, max_features) class burnt_areas, danger, fire_context, fire_context_of, fire, perimeters: plain dictionaries with source, time of reading and request count (danger and the contexts need [raster])
check_text(text, facts) / numbers(text) pure The numbers of a text that are not in the facts
effis_client.mcp_server.create_server() function The MCP server (extra mcp)
effis-client command perimeters, years, danger, context, check, mcp

Bulk shapefile archives

Needs the bulk extra.

Name Kind Description
read_shapefile_zip(payload) pure The features of a zipped EFFIS shapefile as GeoJSON dicts in EPSG:4326
filter_features(features, *, bbox=None, start=None, end=None, date_fields=BULK_DATE_FIELDS) pure Keep the features started in [start, end] that intersect bbox; undated features are dropped when a date bound is given
BULK_DATE_FIELDS constant ("firedate", "date", "initialdate", "initialdat"), matched without regard to case

Conventions

  • Bounding boxes are (west, south, east, north) in EPSG:4326 degrees.
  • Points are (lon, lat).
  • Dates are datetime.date; ranges are inclusive.

Error model

flowchart TD
    Call["fetch_perimeters / fetch_fwi"] --> Net{"network OK?"}
    Net -- no --> HX["httpx.TransportError<br/>(timeout, connection reset, ...)"]
    Net -- yes --> St{"HTTP status"}
    St -- "4xx / 5xx" --> HS["httpx.HTTPStatusError"]
    St -- 200 --> Body{"body type"}
    Body -- "XML exception report" --> EE["EffisError<br/>'LayerNotDefined: ...'"]
    Body -- "all-zero raster" --> NONE["None<br/>(no data)"]
    Body -- "valid data" --> OK["Perimeters / dict of values"]
Loading

Nothing is swallowed. Network and HTTP errors propagate as httpx exceptions; an error dressed up as a 200 becomes an EffisError carrying MapServer's own code and message; "no data" is None. An empty result is only ever an empty result.

from effis_client import EffisError

try:
    fwi = await fetch_fwi(client, day, points, bbox)
except EffisError as exc:
    log.error("EFFIS refused the request: %s", exc)
except httpx.HTTPError as exc:
    log.warning("EFFIS unreachable, will retry: %s", exc)
else:
    if fwi is None:
        log.info("no FWI published for %s yet", day)

Who is it for

  • ๐Ÿ”ฌ Researchers and data scientists building fire-risk models, validating forecasts or studying burnt-area trends.
  • ๐Ÿš’ Civil protection and forestry agencies wiring official EFFIS data into dashboards and alerting pipelines.
  • ๐Ÿ›ฐ๏ธ Earth-observation and GIS developers who need clean polygons and numeric rasters, not map tiles.
  • ๐Ÿ“ฐ Data journalists covering wildfire seasons with reproducible numbers.
  • ๐Ÿฆ Insurance and climate-risk analysts quantifying exposure.
  • ๐ŸŽ“ Students and educators who want real European fire data in a notebook in minutes.

If you use effis-client, please open an issue and tell us what you built. A list of users helps the project and helps other people find it.

Roadmap and ideas

These are directions, not promises. Each one is a good first contribution, and an issue to discuss it is welcome before a pull request.

  • A synchronous wrapper for scripts and notebooks
  • The richer burnt-area layer ms:modis.ba.poly (municipality, last update, land cover burnt)
  • A fire danger outlook for today and the next two days
  • Not planned: active-fire hotspots. The EFFIS hotspot layers are the FIRMS detections, served by firms-client
  • Optional GeoPandas / xarray helpers behind extras
  • A command line: effis-client perimeters --bbox ... --since 2021 > fires.geojson
  • Recorded-response test helpers for downstream projects
  • Example notebooks (notebooks/)
  • A fire context that reaches before 31 May 2024, from another source of the FWI
  • A model's answers on the faithfulness set (today: hand-written answers only)

Have another idea? Open an issue.

Contributing

Issues and pull requests are welcome, from typo fixes to new layers.

git clone https://github.com/agent-engineering-studio/effis-client
cd effis-client
uv sync
make check   # ruff, mypy --strict and pytest: the same gate CI runs
  • Tests run against recorded EFFIS responses in tests/fixtures/, so they are fast and do not hit the network.
  • Commits follow Conventional Commits.
  • Found a new MapServer quirk? That is a valuable contribution on its own: open an issue with the request and the response you got.

See CONTRIBUTING.md for details and the CHANGELOG for what changed.

Regenerating the figures

The images in this README come from live EFFIS data and the test fixtures:

uv run python docs/scripts/fetch_data.py /tmp/effis-data
uv run --with matplotlib python docs/scripts/render_images.py /tmp/effis-data docs/images tests/fixtures

Support the project

effis-client is free and maintained in spare time. The most useful things you can do:

  • โญ Star the repository. It is the simplest signal that this work matters, and it helps others find it.
  • ๐Ÿ“ฃ Share it with a colleague, a research group or a civil-protection team who works with wildfire data.
  • ๐Ÿ› Report quirks, broken layers and confusing docs.
  • ๐Ÿง‘โ€๐Ÿ’ป Contribute code, examples or notebooks from the roadmap.
  • ๐Ÿ“ Cite it in papers and reports that use it, alongside the EFFIS data citation.
  • ๐Ÿค Get in touch if your organisation depends on EFFIS data and wants to support or sponsor further development.

Data licence and attribution

EFFIS data are ยฉ European Union, Copernicus Emergency Management Service, published under CC BY 4.0. Anything you publish from them must say so, for example:

Data: European Forest Fire Information System (EFFIS), Copernicus Emergency Management Service, ยฉ European Union, CC BY 4.0.

The test fixtures and the figures in this README are EFFIS data under the same licence.

effis-client is an independent open-source project. It is not affiliated with or endorsed by the European Commission, the Joint Research Centre or the Copernicus programme.

Extracted from Limen, which uses the perimeters as the truth set for its wildfire backtest and the FWI rasters to check its own FWI chain (fwi-chain).

License

Code: Apache-2.0. Contributions are accepted under the same license.

Made for the people who keep Europe's forests from burning. ๐ŸŒฒ

About

Client for the public EFFIS services: burnt-area perimeters (WFS) and the official Fire Weather Index rasters (WMS), MapServer quirks included

agentengineering.it/effis-client/

Resources

Readme
Apache-2.0 license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

Generated from agent-engineering-studio/python-package-template
You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.