An IGC toolbox for aviation sports written in Rust.
rustigc/
├── rustigc/ - Core Rust library
├── rustigc-py/ - Python bindings
├── rustigc-wasm/ - WASM bindings
├── rustigc-tools/ - CLI tools
└── rustigc-test-data/ - Shared IGC test files and their scoring references
LOD/LAD: Coordinate higher precisionTDS: Sub-second time divisionuse rustigc::Log;
let content = std::fs::read("flight.igc")?;
let log = Log::new(&content)?;
println!("Pilot: {}", log.headers["PLT"].text);
println!("Fixes: {}", log.track.len());
from rustigc_py import Log
log = Log.from_file("flight.igc")
print(f"Pilot: {log.pilot_name}")
print(f"Glider: {log.glider_type}")
print(f"Fixes: {len(log.track)}")
# Flight sections
flight = log.flights().longest
print(f"Takeoff: {flight.takeoff}")
print(f"Landing: {flight.landing}")
import { readFileSync } from "node:fs";
import { Log } from "rustigc-wasm";
const igc = readFileSync("flight.igc");
const log = new Log(igc);
console.log(log.header("PLT"), log.fix_count);
console.log(log.score("xcontest"));
See rustigc-wasm/README.md, which covers instantiating the wasm first.
rustigc-xc-score --league xcontest < flight.igc
# Build all components
cargo build --release
# Run tests
cargo test
# Build Python bindings
cd rustigc-py
pip install maturin
maturin develop
rustigc is still very early in its development cycle. It is a pet project I’m using to learn Rust.
I’m still exploring everything Rust has to offer, so there is a good chance some things in there are
not done correctly or could be improved. Public APIs are likely to change.
However, rustigc is tested on thousands of tracklogs, accounting for many oddities found in the
real world.
If you have a tracklog that does not parse or score correctly, please open an issue and share the
tracklog.
The following sources have been extremely helpful in building rustigc so far:
igc-xc-score and rustigc scoring are documented here)GPL-2.0-or-later WITH Classpath-exception-2.0 for the library and its bindingsGPL-2.0-or-later for rustigc-toolsThe Classpath exception means linking against the library or its bindings — statically or
dynamically, from Rust, Python, JavaScript, or any other language — does not require your own code
to be GPL-licensed. Only modifications to rustigc itself stay under the GPL. See
LICENSE for the full text.