Metadata-Version: 2.3
Name: whitebox-plugin-data-aircraft
Version: 0.1.1
Summary: Aircraft Data plugin for Whitebox
License: GNU Affero General Public License v3
Author: avilabss
Author-email: contact@avilabs.net
Requires-Python: >=3.14.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown

# Whitebox Plugin - Aircraft Data

This is an Aircraft Data plugin for
[Whitebox](https://gitlab.com/whitebox-aero).

## Installation

Simply install the plugin to Whitebox:

```shell
poetry add whitebox-plugin-data-aircraft
```

## Aircraft lookup API

The plugin provides the `data-aircraft` capability and looks up aircraft
registration, model, operator, and type information in the managed OpenSky and
aircraft type datasets.

Discover the endpoint through the plugin URL map:

```javascript
const url = Whitebox.api.getPluginProvidedPath("data-aircraft.lookup");
const response = await Whitebox.api.client.get(url, {
  params: { icao_addr: "5055096" },
});
```

The direct endpoint is:

```text
GET /plugin-views/whitebox_plugin_data_aircraft/aircraft/lookup/?icao_addr=<icao_addr>
```

The required `icao_addr` parameter accepts a decimal ICAO address or a
hexadecimal ICAO24 address. Decimal values are returned as unpadded lowercase
hexadecimal; other values are lowercased as-is.

A successful lookup returns the OpenSky row and, when available, its joined
aircraft type row:

```json
{
  "found": true,
  "icao24": "4d2278",
  "aircraft": {
    "registration": "9H-TJD",
    "model": "Boeing 737-800",
    "operator": "Corendon Airlines",
    "typecode": "B738"
  },
  "type_info": {
    "manufacturer_name": "BOEING",
    "model": "737-800"
  }
}
```

When no aircraft row or dataset is available, the endpoint returns HTTP 200:

```json
{
  "found": false,
  "icao24": "4d2278"
}
```

Omitting `icao_addr` returns HTTP 400:

```json
{
  "error": "Query parameter 'icao_addr' is required"
}
```

## Additional Instructions

- [Plugin Development Guide](https://docs.whitebox.aero/plugin_guide/#plugin-development-workflow)
- [Plugin Testing Guide](https://docs.whitebox.aero/plugin_guide/#testing-plugins)
- [Contributing Guidelines](https://docs.whitebox.aero/development_guide/#contributing)

