Skip to main content

Biodiversity and moth observation analysis for West Flanders

Project description

NatuurSpotter

NatuurSpotter is a Python project for collecting and analyzing moth observation data in West Flanders (Belgium). It pulls public data from waarnemingen.be and can generate CSV summaries, interactive maps, seasonal charts, and PDF species reports.

Features

  • Scrape day-by-day moth observations for West Flanders
  • Build monthly biodiversity summaries (CSV) for dashboards (including Node-RED)
  • Generate interactive observation maps (HTML)
  • Create species PDF reports with image, description, rarity, and recent observations
  • Run seasonal analysis and (optionally) add an LLM-based ecological explanation

Requirements

  • Python 3.9 or newer
  • Internet access (for waarnemingen.be, Wikimedia, Wikipedia, Geoapify, and optionally Together)

Installation

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Or install as a package:

pip install -e .

Install the optional Together dependency only when you need the LLM explanation in seasonal_analysis:

pip install -e ".[llm]"
# or, when using requirements.txt:
pip install "together>=2.0"

Environment Variables

Copy .env.example to .env and fill in your keys.

cp .env.example .env

Required for map/geocoding features:

  • GEOAPIFY_API_KEY

Optional for LLM explanation in seasonal_analysis:

  • TOGETHER_API_KEY

Quick Usage

from natuurspotter import biodiversity_analysis, observations_map, species_info, seasonal_analysis

# Monthly biodiversity CSV outputs in ./output/
summary_df, raw_df = biodiversity_analysis(month=1, year=2026)

# Interactive map in ./output/observations_map_YYYY-MM-DD.html
map_path = observations_map(day="2026-01-22")

# PDF species report in ./output/
species_info("Agrotis segetum")

# Seasonal chart + optional LLM explanation (if TOGETHER_API_KEY is set)
seasonal_analysis("Agrotis segetum", 2025)

Script Usage

# Generate monthly biodiversity CSV files in ./output/
python3 scripts/run_natuurspotter.py biodiversity --month 1 --year 2026

# Generate daily observation map in ./output/
python3 scripts/run_natuurspotter.py map --day 2026-01-22

Output Files

Generated files are written to output/:

  • biodiversity_summary_<year>-<month>.csv
  • biodiversity_raw_<year>-<month>.csv
  • observations_map_<date>.html
  • <species_name>.pdf

Project Structure

NatuurSpotter/
├── src/
│   └── natuurspotter/
│       ├── __init__.py
│       ├── core.py
│       └── fonts/
├── requirements.txt
├── pyproject.toml
├── scripts/
│   └── run_natuurspotter.py
├── examples/
│   ├── demo.ipynb
│   └── demo1.ipynb
├── integrations/
│   └── node-red/
│       └── node_red_flow.json
├── output/                  # generated files (git-ignored)
└── README.md

Notes

  • This project relies on external website/API responses. If a provider changes HTML/API format, parts of the scraper may need updates.
  • API keys are read from environment variables; do not commit real keys.
  • If keys were previously exposed, rotate them before publishing.

License

MIT License. See LICENSE.

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

natuurspotter-0.1.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

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

natuurspotter-0.1.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for natuurspotter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15637aeed59e6eaf2808c87e657bdccea9fd55da89a351d20176437fd096ffce
MD5 0b2283b3bc29d53ef054642558bf8e84
BLAKE2b-256 0a6cf601f38f46a298c90b70792f6cf9b7c762e6a764ad86ed5585ac7a27baac

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on mintyfizz/NatuurSpotter

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

File details

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

File metadata

  • Download URL: natuurspotter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for natuurspotter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70af859e5398d455e8b4eb6d9d7baf37e6be8283eaa7ff6cae6db91256062e90
MD5 83394a1509c0195090292ee2c074843a
BLAKE2b-256 e23773deba563d0436a98c4fecdedde2c4521e09715febdfd9e72b53ac4a0c8d

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on mintyfizz/NatuurSpotter

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