Expand description
§opensky
A Rust client for the OpenSky Network Trino database.
This crate provides access to historical flight data from the OpenSky Network, allowing you to query ADS-B trajectory data for aircraft worldwide.
§Quick Start
use opensky::{Trino, QueryParams};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a Trino client (reads credentials from ~/.config/opensky/settings.conf)
let mut trino = Trino::new().await?;
// Query flight history
let params = QueryParams::new()
.icao24("485a32")
.time_range("2025-01-01 10:00:00", "2025-01-01 12:00:00");
let data = trino.history(params).await?;
println!("Got {} rows", data.len());
// Export to CSV
data.to_csv("flight.csv")?;
Ok(())
}§Configuration
Credentials are read from a platform-specific config file:
- Linux:
~/.config/opensky/settings.conf - macOS:
~/Library/Application Support/opensky/settings.conf - Windows:
%LOCALAPPDATA%\opensky\settings.conf
[default]
username = your_username
password = your_passwordRegister for an account at https://opensky-network.org/.
Re-exports§
pub use cache::cache_dir;pub use cache::cache_stats;pub use cache::clear_cache;pub use cache::purge_old_cache;pub use cache::CacheStats;pub use config::Config;pub use query::build_history_query;pub use query::build_flightlist_query;pub use query::build_rawdata_query;pub use query::build_query_preview;pub use query::build_query_preview_method;pub use trino::QueryStatus;pub use trino::Trino;pub use types::Bounds;pub use types::FlightData;pub use types::OpenSkyError;pub use types::QueryParams;pub use types::RawTable;pub use types::Result;pub use types::FLIGHT_COLUMNS;pub use types::FLIGHTLIST_COLUMNS;pub use types::RAWDATA_COLUMNS;
Modules§
- cache
- Query result caching for OpenSky data.
- config
- Configuration management for OpenSky credentials.
- query
- SQL query builder for OpenSky Trino database.
- trino
- Trino HTTP client for OpenSky database.
- types
- Core types for OpenSky queries and results.
Structs§
- Data
Frame - A contiguous growable collection of
Seriesthat have the same length.
Functions§
- write_
csv - Write a DataFrame to a CSV file.
- write_
parquet - Write a DataFrame to a Parquet file.