Skip to content

7etsuo/meteomatics-c-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Meteomatics C Client

A lightweight C client for interacting with the Meteomatics Weather API. This client fetches weather data including temperature, precipitation, and wind speed for specified locations.

Prerequisites

You'll need to install the following libraries:

# For Debian/Ubuntu
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libjansson-dev

# For Fedora
sudo dnf install libcurl-devel
sudo dnf install jansson-devel

Environment Setup

Add these environment variables to your ~/.bashrc or ~/.zshrc:

export METEOMATICS_USERNAME="your_username"
export METEOMATICS_PASSWORD="your_password"

Don't forget to source your shell configuration after adding the variables:

source ~/.bashrc  # or source ~/.zshrc

Building

make

Running

./main

Features

  • Fetches weather data including:
    • Temperature (2m above ground in Celsius)
    • Precipitation (1-hour in mm)
    • Wind speed (10m above ground in m/s)
  • Secure credential management via environment variables
  • Robust error handling and memory management
  • JSON response processing with sensitive data filtering

Default Configuration

  • Location: San Francisco (37.7749,-122.4194)
  • Time: 2024-10-23T00:00:00Z
  • Format: JSON

Cleanup

make clean

About

A lightweight C client for the Meteomatics Weather API that fetches weather data (temperature, precipitation, and wind speed) using libcurl for HTTP requests and jansson for JSON parsing. The client includes error handling, memory management, and secure credential handling through environment variables.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors