Skip to main content

syunity-meteo

中文 | English

syunity-meteo collects Open-Meteo data selected for China and stores it in Apache IoTDB through syunity-core's pooled IotDBManager.

Install and start

Install dependencies, choose active_mode and update its IoTDB connection values in config.yaml, ensure IoTDB is running, then start the local service:

pip install -e .
python main.py

main.py imports the global settings instance from settings.py; its mode, IoTDB connection values, and standalone collection defaults are loaded from config.yaml. By default, development mode targets 127.0.0.1:6667 and collects Shanghai.

  • dev mode: Immediately runs the online interfaces, logs every API response and IoTDB write result, and keeps the scheduler running.

  • prod mode: Does not print application-level payloads. It fills historical data once, reads current weather and air quality at minute 00, 15, 30, and 45, and reads weather, radiation, and marine forecasts at 00:00, 06:00, 12:00, and 18:00.

  • History: Imported from 2006 one time in a background worker; online scheduling continues while it runs.

  • Current weather: Collected at each 15-minute boundary in prod.

  • Forecast: Collected at 00:00, 06:00, 12:00, and 18:00 in prod.

When used as a library, MeteoService does not log API results or IoTDB writes by default. Pass log_results=True to opt in:

service = MeteoService(settings, OpenMeteoClient(), store, log_results=True)

IoTDB schema

All data is in the configured database, defaulting to root.meteo. The standalone default city device identifier is shanghai.

Device path Timestamp Measurements
root.meteo.<city>.location Geocoding collection time City name, coordinates, timezone, country, and administrative area
root.meteo.<city>.history Open-Meteo hourly time temperature_2m, relative_humidity_2m, shortwave_radiation, precipitation, surface_pressure
root.meteo.<city>.current Local collection time Current weather values plus observed_at
root.meteo.<city>.air_quality Collection time payload (complete CAMS response JSON)
root.meteo.<city>.forecast Collection/issue time payload (complete ECMWF forecast JSON)
root.meteo.<city>.solar_radiation Collection/issue time payload (complete ECMWF radiation JSON)
root.meteo.<city>.marine Collection/issue time payload (complete ECMWF WAM response JSON)
root.meteo.<city>.metadata Mark creation time history_loaded

Forecast payloads are stored per issue time rather than forecast-valid time. This preserves all four daily forecast versions and avoids overwriting an earlier model run.

Data models

Domain Endpoint Model
City resolution geocoding-api.../v1/search Official Chinese geocoding
Current weather api.../v1/forecast ecmwf_ifs025
Future forecast api.../v1/forecast ecmwf_ifs025
Historical weather archive-api.../v1/archive era5_land
Air quality air-quality-api.../v1/air-quality CAMS default
Solar / radiation api.../v1/forecast ecmwf_ifs025
Marine waves marine-api.../v1/marine ecmwf_wam025

Project layout

main.py                         # Root local startup entry point
config.yaml                     # Editable IoTDB connection configuration
src/syunity_meteo/
  settings.py                   # YAML connection loading and collection schedule
  client.py                     # Open-Meteo API client
  iotdb_store.py                # syunity_core.database.db templates, writes, and queries
  service.py                    # One-time and recurring task scheduling
tests/                          # Standalone readable test functions

Metadata

Release files for syunity-meteo 0.1.0

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

Source distribution (sdist)

Source distribution for syunity-meteo 0.1.0
File Size Uploaded
syunity_meteo-0.1.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for syunity-meteo 0.1.0
File Interpreter ABI Platform
syunity_meteo-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.6 kB

Release files / syunity_meteo-0.1.0.tar.gz

Download URL syunity_meteo-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
29f89e91f7ff008a9b12c7f4f324cf283c804c8c1099b30c5dd9440c95c05cf8
BLAKE2b-256 checksum
How to use checksums
8d61a0d65485f85d70b92421144feaa563d2c4f1735649e1753a47c5ccba7b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / syunity_meteo-0.1.0-py3-none-any.whl

Download URL syunity_meteo-0.1.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b50b538cfdd9cb86de7a4237ac957845c355aacc198845b72d0fabe5dc3b7324
BLAKE2b-256 checksum
How to use checksums
621672f242c973e427e4037419e9b4fe117f3dae14d0e3ac3fae797f27b8a6c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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