https://github.com/7etsuo/meteomatics-c-client
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.
https://github.com/7etsuo/meteomatics-c-client
Last synced: about 1 year ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/7etsuo/meteomatics-c-client
- Owner: 7etsuo
- Created: 2024-10-24T08:56:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-24T08:59:53.000Z (over 1 year ago)
- Last Synced: 2025-04-12T04:51:44.894Z (about 1 year ago)
- Language: C
- Size: 6.84 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
# 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`:
```bash
export METEOMATICS_USERNAME="your_username"
export METEOMATICS_PASSWORD="your_password"
```
Don't forget to source your shell configuration after adding the variables:
```bash
source ~/.bashrc # or source ~/.zshrc
```
## Building
```bash
make
```
## Running
```bash
./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
```bash
make clean
```