Skip to main content

pyfeuxdeforet-fr

CI PyPI

pyfeuxdeforet-fr is an unofficial async Python client for JSON data exposed by feuxdeforet.fr.

The package is intentionally small and close to the site payloads. It is meant to provide reusable transport and typed convenience models for future projects, including a possible Home Assistant / HACS integration, without baking Home Assistant entity decisions into the library.

Features

  • Async API client built for aiohttp.
  • Fetch French regions and departments from /api/regions.
  • Fetch national counters and vigilance/risk totals from /api/stats.
  • Fetch homepage news summaries from /api/home.
  • Fetch raw cartography GeoJSON from /fdf/cartographie/geojson.
  • Bootstraps the cartography proxy from /cartes/feux/, including its dynamic nonce and cookies.
  • Normalizes Point, MultiPoint, Polygon, MultiPolygon, and GeometryCollection feature geometries.
  • Raw payload helpers are available for integrations that need fields not yet modeled.
  • Typed package (py.typed) for downstream users.

Installation

pip install pyfeuxdeforet-fr

Quick start

import asyncio

from aiohttp import ClientSession
from pyfeuxdeforet_fr import FeuxDeForetClient


async def main() -> None:
    async with ClientSession() as session:
        client = FeuxDeForetClient(session=session)

        regions = await client.get_regions()
        stats = await client.get_stats()
        home = await client.get_home()
        geojson = await client.get_geojson(
            last_update="2026-07-05T00:11:12+02:00",
        )

        print(f"Regions: {len(regions or [])}")
        print(f"Stats: {stats}")
        print(f"Latest article: {home.articles[0].title if home and home.articles else None}")
        print(f"GeoJSON type: {geojson.get('type') if geojson else None}")


asyncio.run(main())

API overview

FeuxDeForetClient(session, base_url="https://feuxdeforet.fr")

Create a client using an injected aiohttp.ClientSession.

The caller owns the session lifecycle. This keeps the library suitable for applications that already manage connection pooling, such as Home Assistant.

get_regions() / get_regions_payload()

Return normalized Region objects, or the raw /api/regions payload.

Each Region contains Department entries from the source depts field.

get_stats() / get_stats_payload()

Return normalized Stats, or the raw /api/stats payload.

Known fields include published fire counts over several periods and aggregated risk-zone counters.

get_home() / get_home_payload()

Return normalized homepage article summaries, or the raw /api/home payload.

The raw payload is also kept on HomeData.raw because the homepage response may grow with sections that are not yet modeled.

get_geojson(scope="web", last_update=None, nonce=None, headers=None)

Return the raw cartography GeoJSON payload.

By default, each call first loads /cartes/feux/, extracts window.fdfBridge.proxyNonce, retains any response cookies, then reproduces the frontend proxy request with:

X-FDF-Nonce: <dynamic proxyNonce>
Referer: https://feuxdeforet.fr/cartes/feux/

last_update accepts either a datetime or an already formatted string. A manual nonce and extra headers remain available for diagnostics. The legacy nonce="0" value now enables automatic discovery instead of sending zero. The automatic proxy context is cached for 30 minutes, retried on transient HTML failures, and refreshed once when the GeoJSON proxy rejects a request. Transient upstream HTTP 5xx responses are returned as missing payloads without flooding normal Home Assistant logs.

extract_feature_geometries(feature)

Return a GeoJsonGeometry containing the first usable (longitude, latitude) point and every normalized polygon carried by a feature. This keeps complex GeometryCollection fires usable by map clients while preserving their perimeters for consumers that can render GeoJSON polygons.

Known limitations

  • This is an unofficial client and is not affiliated with feuxdeforet.fr.
  • The API is not publicly documented and may change without notice.
  • The HTML bootstrap format is private frontend behavior and may change without notice.
  • Most endpoints are intentionally exposed through raw helpers as well as typed models.

Development

For contributors:

python -m pip install -r requirements_dev.txt
pytest -q --cov
mypy pyfeuxdeforet_fr
python -m build

Demo script

Run the full feature demo with:

python examples/demo.py

It exercises raw payload helpers, normalized models, and the GeoJSON endpoint. The GeoJSON call accepts overrides while reverse engineering continues:

python examples/demo.py --last-update "2026-07-05T00:11:12+02:00"

License

Apache-2.0

Metadata

Release files for pyfeuxdeforet-fr 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfeuxdeforet-fr 0.3.1
File Size Uploaded Provenance Actions
pyfeuxdeforet_fr-0.3.1.tar.gz 18.0 kB With provenance Details for pyfeuxdeforet_fr-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyfeuxdeforet-fr 0.3.1
File Interpreter ABI Platform Actions
pyfeuxdeforet_fr-0.3.1-py3-none-any.whl Python 3 none any Details for pyfeuxdeforet_fr-0.3.1-py3-none-any.whl

Total release size: 31.5 kB

Release files / pyfeuxdeforet_fr-0.3.1.tar.gz

Download URL pyfeuxdeforet_fr-0.3.1.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5826a92a133fb596a06ae2381f50b673d6c6a818c25c939ac8c0d8fccb58a0da
BLAKE2b-256 checksum
How to use checksums
62dfa5510a1b7fad681ae2e8a3ee468554b11dc21c3b35d8cbbd3dfce4aff149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / pyfeuxdeforet_fr-0.3.1-py3-none-any.whl

Download URL pyfeuxdeforet_fr-0.3.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d40be537f3a3dac061afeb9d531cd39d30f6e4a033618d8acfb39bdada6aa923
BLAKE2b-256 checksum
How to use checksums
fffbdbd99d9c5de537189137bad1751e5a5ce00c53fcb36744022018da679280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Security for pyfeuxdeforet-fr 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyfeuxdeforet_fr-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page