Crates.io | flydent |
lib.rs | flydent |
version | 0.5.0 |
created_at | 2025-09-25 00:30:48.239242+00 |
updated_at | 2025-09-26 01:00:37.233083+00 |
description | A tool for processing aircraft callsigns and ITU data |
homepage | https://github.com/hut8/flydent |
repository | https://github.com/hut8/flydent |
max_upload_size | |
id | 1853981 |
size | 139,129 |
A Rust port of the Python flydenity library for parsing aircraft registration callsigns and ICAO 24-bit identifiers.
cargo build --release
use flydent::{Parser, EntityResult};
let parser = Parser::new();
// Parse a callsign
if let Some(result) = parser.parse_simple("T6ABC") {
match result {
EntityResult::Country { nation, iso2, iso3, description } => {
println!("Country: {} ({}/{}) - {}", nation, iso2, iso3, description);
}
EntityResult::Organization { name, description } => {
println!("Organization: {} - {}", name, description);
}
}
}
// Parse ICAO 24-bit identifier
if let Some(result) = parser.parse("700123", false, true) {
println!("ICAO result: {:?}", result);
}
# Parse aircraft callsigns
./target/release/flydent T6ABC N123ABC 4Y123
# Parse ICAO 24-bit identifiers
./target/release/flydent --icao24bit 700123
# Show help
./target/release/flydent --help
$ ./target/release/flydent T6ABC
{"T6ABC":{"description":"general","iso2":"AF","iso3":"AFG","nation":"Afghanistan"}}
$ ./target/release/flydent 4Y123
{"4Y123":{"description":"general","name":"International Civil Aviation Organization"}}
$ ./target/release/flydent --icao24bit 700123
{"700123":{"description":"general","iso2":"AF","iso3":"AFG","nation":"Afghanistan"}}
This Rust port uses compile-time macros to parse the CSV data files and generate efficient lookup structures:
once_cell::sync::Lazy
The binary includes no external dependencies at runtime - all ITU data is embedded directly in the executable.
This implementation maintains full compatibility with the original Python flydenity library:
The Rust version offers significant performance improvements:
cargo test
The test suite includes:
Uses the same ITU (International Telecommunication Union) datasets as the original:
processed_itu_countries_regex.csv
- Country callsign patterns and ICAO rangesprocessed_itu_organizations_regex.csv
- International organization patternsThis project maintains the same license as the original Flydenity project by Colleen Roller, from which this code was ported and data was copied.