| Crates.io | openweathermap_lib |
| lib.rs | openweathermap_lib |
| version | 0.1.0-pre.3 |
| created_at | 2025-07-13 01:36:30.016856+00 |
| updated_at | 2025-07-14 15:38:03.749082+00 |
| description | A Rust library for interacting with the OpenWeatherMap API |
| homepage | |
| repository | https://github.com/tonymarkham/rusty-openweathermap-library |
| max_upload_size | |
| id | 1749883 |
| size | 85,270 |
A Rust library for interacting with the OpenWeatherMap API. This library supports both native Rust applications and WebAssembly targets.
Add this to your Cargo.toml:
[dependencies]
openweathermap_lib = "0.1.0-pre.2"
use openweathermap_lib::weather::client::WeatherClient;
use openweathermap_lib::location::types::Location;
async fn example() {
// Initialize with your API key
let client = WeatherClient::new("your_api_key");
// Get weather by location
let location = Location {
latitude: 40.7128,
longitude: -74.0060,
};
let weather = client.get_current_weather(location).await.unwrap();
println!("Temperature: {}°C", weather.main.temp);
}
.
├── src/ # Source code
│ ├── lib.rs # Library entry point
│ ├── weather/ # Weather-related functionality
│ └── location/ # Location-related functionality
├── schemas/ # JSON schemas
├── Cargo.toml # Rust package manifest
├── Cargo.lock # Dependency lock file
├── LICENSE # MIT License
└── CONTRIBUTING.md # Contribution guidelines
To clone this repository, run the following command:
git clone https://github.com/tonymarkham/rusty-openweathermap-library.git
cd rusty-openweathermap-library
cargo build --release
Ensure you have wasm-pack installed:
cargo install wasm-pack
wasm-pack build --target web
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute to this project.