Skip to main content

OSTK (OpenSky ToolKit) - Nifty tools for opensky with good vibes

Project description

OSTK - Nifty OpenSky tools with good vibes

OSTK (OpenSky ToolKit) provides advanced trajectory reconstruction tools for OpenSky Network ADS-B data, through CLI or Python. It offers enhanced trajectory accuracy through improved CPR decoding.It also includes an LLM-powered agent for natural language queries.

Features

  • Accurate trajectory reconstruction from raw ADS-B messages with enhanced CPR decoding
  • Outlier filtering for cleaner trajectories
  • LLM-powered agent for natural language OpenSky queries
  • Command-line interface for trajectory queries and configuration management
  • Built on pyopensky's Trino interface with caching support

All can be accessed though your terminal console:

# get trajectory rebuild from raw ADS-B messages
ostk trajectory rebuild ...

# get historical trajectory data with various filters
ostk trajectory history ...

# download historical data via natural language
ostk agent console

or python API:

from ostk import rebuild

flight = rebuild(icao24, start, stop)
from ostk import Agent

agent = Agent()
params = agent.parse_query("...")
flight = agent.execute_query(params)

Installation and configure

Install via pip:

pip install ostk

Configure OpenSky credentials (for pyopensky):

# set credentials
ostk pyopensky config set

# show config
ostk pyopensky config show

Quick Start

Rebuild Trajectory

from ostk import rebuild

# Rebuild trajectory from raw ADS-B messages
df = rebuild(
    icao24="485A32",
    start="2025-11-08 12:00:00",
    stop="2025-11-08 15:00:00"
)

Returns a pandas DataFrame with columns: time, icao24, lat, lon, baroaltitude, velocity, heading, vertrate

LLM Agent

from ostk import Agent

# Initialize agent
agent = Agent()

# Parse natural language query
params = agent.parse_query(
    "Download flights from Amsterdam Schiphol to London Heatharow on Nov 8, 2025 between 13:00 and 15:00"
)

# Execute and get results
df = agent.execute_query(params)

Command Line

Rebuild Trajectory

# Rebuild trajectory from raw ADS-B messages
ostk trajectory rebuild --icao24 485A32 --start "2025-11-08 12:00:00" --stop "2025-11-08 15:00:00" -o trajectory_rebuild.csv

Download History Trajectory

# Download historical data with icao24 filter
ostk trajectory history --start "2025-11-08 12:00:00" --stop "2025-11-08 15:00:00" --icao24 485A32 -o trajectory_history.csv

# Download historical data with airport filters
ostk trajectory history --start "2025-11-08 13:00:00" --stop "2025-11-08 15:00:00" --departure-airport EHAM --arrival-airport EGLL -o trajectory_history.csv

LLM Agent

# set OpenAI API key for LLM agent
ostk agent config set-key

# launch OSTK LLM agent 
ostk agent console

Trajectory Reconstruction Example

Setup LLM Agent

To use the LLM-powered agent, config your OpenAI API key:

ostk agent config set-key

The follow the instruction to input your OpenAI API key. The config file locations are:

  • Linux/macOS: ~/.config/ostk/settings.conf
  • Windows: %LOCALAPPDATA%\ostk\settings.conf

Documentation

How Does Trajectory Rebuild Work?

The rebuild() function reconstructs trajectories by:

  1. Querying raw position and velocity messages from OpenSky's database
  2. Pairing odd and even CPR frames for accurate global position decoding
  3. Validating positions with reference points to filter outliers
  4. Merging position and velocity data with temporal alignment

When to use rebuild() vs pyopensky.trino.history():

Feature rebuild() history()
Accuracy Higher (raw CPR decoding) Standard (pre-computed)
Outliers Fewer (with validation) More common
Speed Slower (decoding overhead) Faster (direct query)
Filtering icao24 + time only Full filtering support

Use history() for faster queries with complex filtering, however with many outliers. Use rebuild() for maximum accuracy and fewer outliers.

Trajectory Reconstruction Example

Authors

Related Projects

  • pyopensky - Python interface for OpenSky Network data
  • pyModeS - ADS-B and Mode S message decoder

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ostk-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ostk-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file ostk-0.1.0.tar.gz.

File metadata

  • Download URL: ostk-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for ostk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1da39133c4b1234a13ffd8fba1d438656b51e3f67b3baed332c107cf5eac9a66
MD5 4617f98d40554094fe6e90157ba7605f
BLAKE2b-256 2a94c6b95748eb943d019ccd76dbb3608495abf48e958967a6500ddd9ae2481b

See more details on using hashes here.

File details

Details for the file ostk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ostk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for ostk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75eb1be66181ca07eac412061e3d9c78beb567e6eefbd0748d00f9172953402e
MD5 b1b4a44afc6eb3432d45fd17e5ed99f2
BLAKE2b-256 d79bfe0e03aa9f4f9f52947e7fc730ec27a143d8ef0bb90c93ce05a3a4448754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page