A Python client for the Flightradar24 API with CLI support
Project description
Pyfr24
A Python client for the Flightradar24 API that provides an interface to fetch, plot and analyze flight data. The package includes both a Python API and a command-line interface for accessing flight data.
Full documentation: https://pyfr24.readthedocs.io/
Installation
# Install from PyPI
pip install pyfr24
# Or from source
git clone https://github.com/stiles/pyfr24.git
cd pyfr24
pip install -e .
Basic usage
Python API
from pyfr24 import FR24API
# Initialize the client
api = FR24API("your_api_token")
# Get flight tracks for a specific flight ID
tracks = api.get_flight_tracks("39bebe6e")
# Export flight data
output_dir = api.export_flight_data(
"39bebe6e",
background='osm', # OpenStreetMap background
orientation='horizontal' # 16:9 aspect ratio
)
Full Python docs: https://pyfr24.readthedocs.io/en/latest/usage/api/
Command-line interface
# Export flight data
pyfr24 export-flight --flight-id 39a84c3c --output-dir data/flight_39a84c3c
# Get live flights for an aircraft registration
pyfr24 live-flights --registration N12345
# Get flight positions within a bounding box (Los Angeles area)
pyfr24 flight-positions --bounds "33.5,-118.8,34.5,-117.5"
Full CLI reference: https://pyfr24.readthedocs.io/en/latest/usage/cli/
API token
Your Flightradar24 API token can be provided:
-
Via environment variable:
export FLIGHTRADAR_API_KEY="your_api_token"
-
As a command-line argument:
pyfr24 --token "your_api_token" flight-summary --flight BA123
-
Through an interactive prompt when no token is provided
Features
- Flight data retrieval (live flights, historical tracks and flight info)
- Data export in multiple formats (CSV, GeoJSON and KML)
- Map visualizations with multiple background options
- Speed and altitude profile charts
- Error handling and logging
- Testing
Contributing
Contributions are welcome. Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass with
python run_tests.py - Submit a pull request
License
This project is licensed under the MIT License.
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 pyfr24-0.1.5.tar.gz.
File metadata
- Download URL: pyfr24-0.1.5.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d031a49ea47af2d1f2f9b11ce60594a252eb6ea77a7e38db2a48009f843808
|
|
| MD5 |
16e9cb1e58b754e77f7a5bf658f4d7c9
|
|
| BLAKE2b-256 |
df6405e0894a3bd7acf60a395d0c1f51776b6a3fda620512a2e71d2fbc770354
|
File details
Details for the file pyfr24-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pyfr24-0.1.5-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cf25aea95dc1654b267e7ddde5fc816552772628ac14e425834776b4b21e958
|
|
| MD5 |
4fc4f9840af351139afa60d73e17e5f3
|
|
| BLAKE2b-256 |
7d758842b3cef54905c1eb085ad61c152813a4524a8f6732db37914b36dd366c
|