Skip to main content

pyopensky

The pyopensky Python library provides functions to download data from the OpenSky Network live API and historical databases. It aims at making ADS-B and Mode S data from OpenSky easily accessible in the Python programming environment.

Key features:

  • Access to live aircraft state vectors and flight information via REST API
  • Query historical ADS-B and Mode S data from the Trino database
  • Decode and rebuild flight trajectories from raw messages
  • Support for spatial and temporal filtering
  • Built-in caching for efficient data retrieval
  • Integration with pandas DataFrames for easy data analysis

Full documentation on https://mode-s.org/pyopensky/

Installation

pip install pyopensky

or add it in your project with

uv add pyopensky

The library is also available on conda-forge, although this approach is no longer recommended:

conda install -c conda-forge pyopensky

Credentials

Access to the OpenSky Network historical database requires authentication. See details in the documentation on how to:

  • Apply an OpenSky Network account
  • Configure your credentials for API access
  • Set up authentication for the Trino database

Usage

1. REST API

Access live and recent flight data.

Functions

from pyopensky.rest import REST

rest = REST()

rest.states()
rest.tracks(icao24)
rest.routes(callsign)
rest.aircraft(icao24, begin, end)
rest.arrival(airport, begin, end)
rest.departure(airport, begin, end)

Examples

from pyopensky.rest import REST

rest = REST()

# Get current state vectors for all aircraft
rest.states()

# Get trajectory for a specific aircraft
rest.tracks(icao24="3c6444")

# Get route information for a callsign
rest.routes(callsign="AFR292")

# Get flights for a specific aircraft in a time range
# NOTE: do NOT use REST for historical data, use trino instead!!
rest.aircraft(icao24="3c6444", begin="2024-01-01", end="2024-01-02")

# Get arrivals at an airport
# NOTE: do NOT use REST for historical data, use trino instead!!
rest.arrival(airport="EHAM", begin="2024-01-01 12:00", end="2024-01-01 13:00")

# Get departures from an airport
# NOTE: do NOT use REST for historical data, use trino instead!!
rest.departure(airport="LFPG", begin="2024-01-01 12:00", end="2024-01-01 13:00")

2. Trino Interface

Query historical ADS-B and Mode S data with advanced selection and processing.

Functions

from pyopensky.trino import Trino

trino = Trino()
# full description of the whole set of parameters in the documentation
trino.flightlist(start, stop, *, airport, callsign, icao24)
trino.rawdata(start, stop, *, callsign, icao24, bounds)
trino.history(start, stop, *, callsign, icao24, bounds)
trino.rebuild(start, stop, *, icao24, bounds)

Release files for pyopensky 2.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyopensky 2.17
File Size Uploaded
pyopensky-2.17.tar.gz 352.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyopensky 2.17
File Interpreter ABI Platform
pyopensky-2.17-py3-none-any.whl Python 3 none any Details

Total release size: 385.9 kB

Release files / pyopensky-2.17.tar.gz

Download URL pyopensky-2.17.tar.gz
Size 352.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c54b141436775e7053056c1f56203ac597ccdec30b061c55bf5914bcbf7c21f4
BLAKE2b-256 checksum
How to use checksums
92b092172b82d00802d4983e29eb8934ba5e3715bd5d8efa5d6a5d39f15cd02d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pyopensky-2.17-py3-none-any.whl

Download URL pyopensky-2.17-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0796cc7c593032de5ccd6b8e295348fbe067370ae189edfe7ea30c55cb5a3a6b
BLAKE2b-256 checksum
How to use checksums
aa8a55e4df5ead43b147bfd83150f277ce082cddf4df1e796d47f2124ab3a9ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2.17 This release

2 release files

2.16

2 release files

2.15

2 release files

2.14

2 release files

2.12

2 release files

2.11

2 release files

2.10

2 release files

2.9

2 release files

2.8

2 release files

2.7

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

1.4

2 release files

1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page