Skip to content

Estimate fuel from the command line

You don't need to write any Python to estimate fuel flow. Installing acropole gives you an acropole command that reads a flight file, estimates fuel flow, and writes the enriched table back to disk.

Install the cli extra

Unlike the library, the CLI reads files itself, so it needs a dataframe backend installed. acropole[cli] provides one (polars):

uv add "acropole[cli]"      # or: pip install "acropole[cli]"

If you already have polars, pyarrow or pandas installed, the CLI uses that instead — it picks the first one it finds, in that order.

pandas alone supports CSV. Reading or writing Parquet with pandas also needs pyarrow or fastparquet, installed separately. For CSV and Parquet support together, install acropole[cli]. Adding pyarrow to a pandas-only installation also enables Parquet and makes the CLI select PyArrow ahead of pandas. Missing file-format dependencies produce an error on stderr, an installation hint, and exit status 1.

For the full list of options, see the CLI reference.

A simple CSV with standard column names

If your file already uses the standard names (typecode, groundspeed, altitude, vertical_rate, …), just point the command at it:

acropole estimate flight.csv

This writes flight_fuel.csv next to the input — the original columns plus fuel_flow (kg/s) and fuel_flow_kgh (kg/h). On success the command prints:

wrote 1234 rows with fuel columns to flight_fuel.csv

A CSV with your own column names

When your columns use different names, map each feature with the matching flag. Map only what differs — anything you omit falls back to the standard name. The bundled QAR flight uses non-standard names:

acropole estimate examples/example_flight.csv \
  --typecode FLPL_AIRC_TYPE --groundspeed GRND_SPD_KT --altitude ALTI_STD_FT \
  --vertical-rate VERT_SPD_FTMN --airspeed TRUE_AIR_SPD_KT --mass MASS_KG \
  --second FLIGHT_TIME --out result.csv

Passing --second (here the FLIGHT_TIME column) lets the model derive accelerations and adds a fuel_cumsum column (cumulative kg burned).

Write parquet instead of CSV

The output format follows the --out extension, independent of the input:

acropole estimate flight.csv --out flight_fuel.parquet

A parquet input works the same way — acropole estimate flight.parquet writes flight_fuel.parquet by default.

Process a batch of files

The command handles one file per call; loop in your shell to process many. Each file is written next to itself with a _fuel suffix:

for f in flights/*.csv; do
  acropole estimate "$f"
done

Or write the results into a separate directory:

mkdir -p enriched
for f in flights/*.csv; do
  acropole estimate "$f" --out "enriched/$(basename "$f")"
done

Errors stop the run

If a file is missing, has an unsupported format, or lacks a mapped column, the command prints the error to stderr and exits with status 1. Missing optional file-format dependencies are handled the same way. In a loop, add || continue after the command to skip a bad file and keep going.