Skip to main content

Async Python client for the feuxdeforet.fr unofficial API

Project description

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.
  • Sends the reverse-engineered x-fdf-nonce: 0 header for the cartography endpoint by default.
  • 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="0", headers=None)

Return the raw cartography GeoJSON payload.

The observed frontend call uses:

x-fdf-nonce: 0

last_update accepts either a datetime or an already formatted string. Extra headers can be passed while continuing the reverse engineering of the frontend/proxy behavior.

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 GeoJSON endpoint may require additional browser/proxy context beyond the observed nonce header.
  • 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" --nonce 0

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfeuxdeforet_fr-0.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfeuxdeforet_fr-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pyfeuxdeforet_fr-0.1.0.tar.gz.

File metadata

  • Download URL: pyfeuxdeforet_fr-0.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfeuxdeforet_fr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b5839a71d73cb09fef300569c523bc1b8edff64157b2fe9d3057b4b8dee6ad59
MD5 a9e3be1d59eb2aba31ab843ac83a4c9e
BLAKE2b-256 ca53753474ac2a1022d43c5178d0e5658d2a4239101bc6e02b16daeebdf13597

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfeuxdeforet_fr-0.1.0.tar.gz:

Publisher: publish.yml on jul-fls/pyfeuxdeforet-fr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfeuxdeforet_fr-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfeuxdeforet_fr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 747fc3e026d88ebfbdbad80fe203bc6b25359710f0326e1b2f13f57a4d1fce97
MD5 43233460ec4ac43ce93ea9b484c39b43
BLAKE2b-256 97f5fcc98dd670541e38e9b7a9e92631f4314f87b49e6869f7a4360ee9028236

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfeuxdeforet_fr-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jul-fls/pyfeuxdeforet-fr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page