Skip to main content

A comprehensive METAR and TAF decoder for aviation weather reports

Project description

Weather Decoder 1.0

A comprehensive, modular Python library for parsing and decoding aviation weather reports (METAR and TAF).

Features

  • METAR Decoder: Parse Meteorological Terminal Air Reports
  • TAF Decoder: Parse Terminal Aerodrome Forecasts
  • Modular Architecture: Clean, maintainable code with specialized parsers
  • Command Line Interface: Easy-to-use CLI tools
  • Comprehensive Parsing: Handles wind, visibility, weather phenomena, sky conditions, and more
  • Remarks Decoding: Intelligent parsing of remarks sections
  • Multiple Formats: Support for various international weather report formats

Installation

pip install -e .

Quick Start

Python API

from weather_decoder import MetarDecoder, TafDecoder

# Decode METAR
metar_decoder = MetarDecoder()
metar_data = metar_decoder.decode("METAR KJFK 061751Z 28008KT 10SM FEW250 22/18 A2992")
print(metar_data)

# Decode TAF
taf_decoder = TafDecoder()
taf_data = taf_decoder.decode("TAF KJFK 061730Z 0618/0724 28008KT 9999 FEW250")
print(taf_data)

Command Line

# Decode METAR
decode-metar "METAR KJFK 061751Z 28008KT 10SM FEW250 22/18 A2992"

# Decode TAF
decode-taf "TAF KJFK 061730Z 0618/0724 28008KT 9999 FEW250"

# Process files
decode-metar -f metars.txt
decode-taf -f tafs.txt

# Interactive mode
decode-metar
decode-taf

Architecture

The Weather Decoder 1.0 features a clean, modular architecture:

weather_decoder/
├── core/           # Main decoder classes
├── data/           # Data classes for parsed reports
├── parsers/        # Specialized component parsers
├── utils/          # Constants, patterns, and formatters
└── cli/            # Command line interfaces

Components

  • Core Decoders: Orchestrate the parsing process
  • Specialized Parsers: Handle specific weather components (wind, visibility, etc.)
  • Data Classes: Structured representation of parsed data
  • Utilities: Shared constants, patterns, and formatting functions
  • CLI: User-friendly command line interfaces

Benefits of the Modular Design

  1. Maintainability: Each parser handles a specific component
  2. Testability: Components can be tested in isolation
  3. Extensibility: Easy to add new parsers or modify existing ones
  4. Reusability: Parsers can be used independently
  5. Clarity: Clear separation of concerns

Supported Features

METAR Features

  • Station identification
  • Observation time
  • Wind information (including variable direction and gusts)
  • Visibility (including RVR)
  • Weather phenomena
  • Sky conditions
  • Temperature and dewpoint
  • Altimeter settings
  • Trends
  • Comprehensive remarks parsing

TAF Features

  • Station identification and issue time
  • Valid periods
  • Wind forecasts
  • Visibility forecasts
  • Weather phenomena forecasts
  • Sky condition forecasts
  • Temperature forecasts (TX/TN)
  • Change groups (TEMPO, BECMG, FM, PROB)
  • Pressure settings (QNH)
  • Remarks parsing

Migration from Version 1.x

The new modular structure maintains API compatibility while providing better organization:

# Old way (still works)
from weather_decoder import MetarDecoder, TafDecoder

# New way (recommended for advanced usage)
from weather_decoder.core.metar_decoder import MetarDecoder
from weather_decoder.parsers.wind_parser import WindParser

Contributing

Contributions are welcome! The modular architecture makes it easy to:

  1. Add new parsers for additional weather components
  2. Improve existing parsers
  3. Add support for new weather report formats
  4. Enhance the CLI tools

License

MIT License - see LICENSE file for details.

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

weather_decoder-1.1.1.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

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

weather_decoder-1.1.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file weather_decoder-1.1.1.tar.gz.

File metadata

  • Download URL: weather_decoder-1.1.1.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for weather_decoder-1.1.1.tar.gz
Algorithm Hash digest
SHA256 edaa02c3282eab2dda8d40c11a114beca5212c399a97ff4574368a081d45f3fa
MD5 4c570efa81d66cc50a871de634fe2077
BLAKE2b-256 71a5544294e40c0408b2bf0a53ffccd006f50665c5cd7106e1e01309b2d76e41

See more details on using hashes here.

File details

Details for the file weather_decoder-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for weather_decoder-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 294a61c7a5df3fc220d54a0f0d4ea8978d2b3219845d6a6cfd64d6de89a36c79
MD5 ece34be5ec9ae4244acf3be258f5f4d7
BLAKE2b-256 c33fdc2ec0ee578ea9cf8201ab4d6f478ef81d3550e7aedd4d0ed14402a76183

See more details on using hashes here.

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