Skip to content

Python API

Acropole is a library — it exposes a Python API, not a command-line interface. The public surface is two classes, both importable from the package root:

from acropole import FuelEstimator, AircraftFuelEstimator

FuelEstimator

The high-level, DataFrame-in / DataFrame-out estimator. Accepts any eager DataFrame narwhals supports (pandas, polars, pyarrow, …), dispatches per aircraft typecode, and returns the same type enriched with fuel_flow (kg/s), fuel_flow_kgh (kg/h) and — when a second column is given — fuel_cumsum (kg).

The CI validates pandas, Polars and PyArrow. Other eager Narwhals backends are not covered by this project’s backend matrix.

Missing typecodes yield unknown fuel flow with a warning. With timestamps, insufficient samples can also make computed derivatives unknown. Cumulative fuel propagates unknown contributions from the first affected row onward; see Missing data and cumulative fuel.

  • estimate(flight, **col_mapping) — score a frame; map column names with keyword arguments (see Map your own columns).
  • for_aircraft(typecode) — return an AircraftFuelEstimator bound to a typecode, reusing the loaded ONNX session and parameters.

AircraftFuelEstimator

The typecode-bound, numpy-only fast path. Built for a single aircraft type with all per-aircraft constants precomputed; estimate() takes 1-D numpy arrays and returns a 1-D array of fuel flow in kg/s.


The full API — every public class, method and function with its signature and docstring — is generated from the source by mkdocstrings and browsable under the API section of this Reference, rendered automatically at build time from src/acropole.