# fwi-chain > A small Python library with no dependencies for the Canadian Fire Weather Index chain (Van Wagner 1987): FFMC, DMC, DC, ISI, BUI and FWI from four noon readings, one day at a time with an explicit state; walking a chain over many days from a stored point, redoing it when better rain arrives, a climatology in 21 quantiles, the EFFIS danger classes, and what moved the index from one day to the next. It also gives the answers as facts, an MCP server and a check that a text quotes the numbers right. - Install: `pip install fwi-chain` (extra: `mcp`). Python 3.12+. No dependencies. - A fire weather index is not an alert and not a forecast of fires. The official fire danger for Europe is published by EFFIS. - The library fetches no weather: the caller brings one noon reading per day (temperature in C, relative humidity in %, 10 m wind in km/h, rain over the previous 24 h in mm). - The three moisture codes are recursive: persist the state between days. A chain started from the standard codes needs weeks before DMC and DC mean anything. - A day without readings is skipped, never filled with zeros. - No clock is read: "today" is always an argument. - It follows the equations as printed in Van Wagner (1987). The cffdrs R package follows the 1985 FORTRAN program: over its 48-day test series the two differ by at most 0.25 FWI points, and agree on the EFFIS class every day. `CFFDRS_PARAMS` (or `FwiParams(constants="cffdrs")`) takes the program's constants and matches cffdrs to 0.006. ## Docs - [Home](https://agentengineering.it/fwi-chain/): the guide: what the FWI is, install, quick start, the state, what is inside - [Riuso (PA)](https://agentengineering.it/fwi-chain/riuso/): in Italian, for a public body: the fire danger diary, what it does not do, what stays with the body - [Social media kit](https://agentengineering.it/fwi-chain/social-kit/): ready-made posts and images to tell others about the library - [Changelog](https://agentengineering.it/fwi-chain/changelog/): what changed in each release - [Contributing](https://agentengineering.it/fwi-chain/contributing/): how to contribute ## Guide - [How the FWI works](https://agentengineering.it/fwi-chain/how-fwi-works/): the FWI System in plain language: the three moisture codes, the three indices, a worked example by hand, the danger classes - [Getting started](https://agentengineering.it/fwi-chain/getting-started/): install, the first day, a season, persisting the state - [Cookbook](https://agentengineering.it/fwi-chain/cookbook/): recipes: a daily job, many stations, the southern hemisphere, classes, CSV - [Facts, explanation and MCP](https://agentengineering.it/fwi-chain/ai/): the answers as facts, what moved the index, the text check, the MCP server and its four tools - [Notebooks, the page and Docker](https://agentengineering.it/fwi-chain/examples/): the seven notebooks, the page for a public body, Docker and the ports - [FAQ](https://agentengineering.it/fwi-chain/faq/): common questions: official or not, cffdrs and xclim, why persist the state ## Reference - [API reference](https://agentengineering.it/fwi-chain/api/): every public name with its arguments, by hand, with examples - [Reference (generated)](https://agentengineering.it/fwi-chain/reference/): every public name, its signature and its docstring, read from the source - [Validation](https://agentengineering.it/fwi-chain/validation/): what the numbers are checked against, and what they are not - [Benchmark](https://agentengineering.it/fwi-chain/benchmark/): known cases where the answer is known: 48 days against cffdrs, the rain each code ignores, a stored state too old ## For agents - [Full documentation as text](https://agentengineering.it/fwi-chain/llms-full.txt): every page above, with the API reference rendered from the docstrings - [Agent skill](https://agentengineering.it/fwi-chain/skills/fwi-chain/SKILL.md): how to use the library and the traps of the data, for coding agents ## Optional - [Source code](https://github.com/agent-engineering-studio/fwi-chain): the repository - [EFFIS](https://forest-fire.emergency.copernicus.eu/): the official fire danger of Europe, and the danger classes used here