A Python interface for OpenSky database
Project description
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
[!IMPORTANT] Do NOT use REST API for historical data, use trino instead!
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)
[!IMPORTANT] Refer to the documentation for advanced usage and parameter details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyopensky-2.16.tar.gz.
File metadata
- Download URL: pyopensky-2.16.tar.gz
- Upload date:
- Size: 343.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eef16991b30ab711d10d98d64558b5ef670e1f3cf656e23d5ec8366b36375cf
|
|
| MD5 |
c8feb9ddec7c9a8400383eef29a830af
|
|
| BLAKE2b-256 |
0caee7fcbc9c7611426c0a9482748f0dffc4f65104423d785307069b48161a66
|
File details
Details for the file pyopensky-2.16-py3-none-any.whl.
File metadata
- Download URL: pyopensky-2.16-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5495356efbd46fccfb37f76abf3bbe116c0f94a8ea4676230490e8ccf8d8f6
|
|
| MD5 |
870a0b1b60a96559b0c8f081f95155cf
|
|
| BLAKE2b-256 |
d6f7e1b48f8c3e82954e528fff289934d3da4dd368784e31fed063c34af23d1c
|