Giter Club home page Giter Club logo

flightdata's Introduction

Notice

This is currently broken due to an API change (see issue #1). Hopefully I or someone else will get around to updating it soon.


A Python library to download data from flightradar24.com.

Supports downloading both archived ("playback") as well as "real-time" data, and can convert all units to SI.

Note

This uses an unofficial and completely unsupported API that can (and has in the past) change at any moment, so try not to abuse it. Also there are two unknown fields (unknown1 and unknown2) which don't seem important (they're usually zero), but are still returned.

Requirements

  • Python 2.7 (3.x may also work)
  • requests

Usage

Sample usage:

import flightradar

zone = 'full' # gets current data for every tracked flight in the world!
data = flightradar.get_current(zone)

print data.next() # ranges in the thousands (e.g. 7,000+) so just print the first flight

gives:

{'src': 'HGH', 'squawk': '1306', 'track': 253, 'type': 'A333', 'icao_addr': '78012D', 'reg_num': 'B-HLJ', 'long': 115.46, 'unknown2': 0, 'dest': 'HKG', 'radar': 'T-VHHH21', 'unknown1': 0, 'callsign': 'HDA623', 'time': datetime.datetime(2014, 6, 15, 20, 35, 23), 'flight_num': 'KA623', 'lat': 22.62, 'alt': 8092.4400000000005, 'time_epoch': 1402882523, 'speed': 240.759999792, 'id': '395791a', 'vert_speed': -12.354560000000001}

All units are (optionally) converted to SI (m and m/s) and time stamps are made available as Python datetime objects.

API

  • get_historical() will get data from a given time span (going back a few weeks) and return an iterator yielding dictionaries as above.

  • get_recent() is a helper that does the same for a given time span, beginning from the current date and time.

  • get_current() returns all the current data for a given zone. A list of supported zones can be found here.

Also see logger.py for some CSV logging functionality.

Credit

This is based on some code by @palli found here.

flightdata's People

Contributors

roger- avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.