FlightRadar客户端库。
flightradar-client的Python项目详细描述
python flightradar客户端
此库提供对本地Flightradar24源的方便访问。
安装
pip install flightradar-client
用法
这个库目前支持两种不同风格的飞行数据,
由fr24feed
和dump1090-mutability
服务提供
在构建自己的系统时自动安装
Pi24 ADS-B receiver。
对于每种口味,图书馆提供两种访问模式。*Feed
类
调用update
时获取一次数据并将其转换为FeedEntry
。
物体。*FeedAggregator
类保留了一点历史,并且
随后的update
调用它试图填补任何空白(坐标和callsign
目前)在最新获取的数据集中丢失。
飞行雷达馈送
flightradar feed模式使用由fr24feed
提供的json数据。
服务(通常在http://localhost:8754/flights.json
下)。
FlightradarFlightsFeed
和FlightradarFlightsFeedAggregator
支持
相同的参数:
Name | Type | Description |
---|---|---|
^{ | required, tuple of latitude and longitude | Used to calculate the distance to each aircraft. |
^{ | optional, float value in kilometres, default: don't filter by distance | Only aircrafts within this radius around the home coordinates are included in the result set. |
^{ | optional, full url to access the Pi24 ADS-B receiver JSON, default: construct with hostname and port | Define if you have customised access to Pi24 ADS-B receiver or use HTTPS for example. |
^{ | optional, hostname of the Pi24 ADS-B receiver, default: ^{ | Define if you are not running this library on your Pi24 ADS-B receiver. |
^{ | optional, port of the Pi24 ADS-B receiver's flights service, default: ^{ | Define if you have configured a different port on your Pi24 ADS-B receiver. |
进给
importasyncioimportaiohttpfromflightradar_client.fr24feed_flightsimportFlightradarFlightsFeedsession=aiohttp.ClientSession()# Home Coordinates: Latitude: -33.5, Longitude: 151.5feed=FlightradarFlightsFeed((-33.5,151.5),session)LOOP=asyncio.get_event_loop()status,entries=LOOP.run_until_complete(feed.update())
提要聚合器
importasyncioimportaiohttpfromflightradar_client.fr24feed_flightsimportFlightradarFlightsFeedAggregatorsession=aiohttp.ClientSession()# Home Coordinates: Latitude: -33.5, Longitude: 151.5feed_aggregator=FlightradarFlightsFeedAggregator((-33.5,151.5),session)LOOP=asyncio.get_event_loop()status,entries=LOOP.run_until_complete(feed_aggregator.update())
转储1090馈送
dump1090提要模式使用由dump1090-mutability
提供的json数据。
服务(通常在http://localhost:8888/data/aircraft.json
下)。
Dump1090AircraftsFeed
和Dump1090AircraftsFeedAggregator
支持
相同的参数:
Name | Type | Description |
---|---|---|
^{ | required, tuple of latitude and longitude | Used to calculate the distance to each aircraft. |
^{ | optional, float value in kilometres, default: don't filter by distance | Only aircrafts within this radius around the home coordinates are included in the result set. |
^{ | optional, full url to access the Pi24 ADS-B receiver JSON, default: construct with hostname and port | Define if you have customised access to Pi24 ADS-B receiver or use HTTPS for example. |
^{ | optional, hostname of the Pi24 ADS-B receiver, default: ^{ | Define if you are not running this library on your Pi24 ADS-B receiver. |
^{ | optional, port of the Pi24 ADS-B receiver's dump1090 service, default: ^{ | Define if you have configured a different port on your Pi24 ADS-B receiver. |
进给
importasyncioimportaiohttpfromflightradar_client.dump1090_aircraftsimportDump1090AircraftsFeedsession=aiohttp.ClientSession()# Home Coordinates: Latitude: -33.5, Longitude: 151.5feed=Dump1090AircraftsFeed((-33.5,151.5),session)LOOP=asyncio.get_event_loop()status,entries=LOOP.run_until_complete(feed.update())