Stellaria
Stellaria is an ergonomic Rust client library for NASA's Web APIs. It provides a convenient, type-safe way to concurrently call the endpoints, build state-guaranteed request parameters, and handle the REST API gracefully.
Quick start
Add the crate to your project using cargo add stellaria.
This crate uses
reqwestfor HTTP. Your binary or test harness should usetokio(see examples below).
Usage
Example: get today's APOD.
use StellariaClient;
use ApodParams;
async
Example: request a date range or a count.
use NaiveDate;
use StellariaClient;
use ApodParams;
async
Tests
The repository includes a comprehensive set of unit tests for the parameter builder and integration-style tests that hit the real API. To run tests locally, set API_TOKEN then:
Note: tests that contact the real API depend on network access and a valid API key.
Environment
The test suites expect an API_TOKEN environment variable (or .env file) containing a valid NASA API key. You can obtain a key at https://api.nasa.gov.
# or use a .env file for tests
Contributing
Contributions are welcome:
- Fork the repository.
- Create a feature branch.
- Open a pull request with a clear description and tests.
Please run cargo fmt and cargo clippy before opening PRs.
License
Dual licensed under MIT OR Apache-2.0. See the LICENSE file for details.