FlightRadar客户端库。

flightradar-client的Python项目详细描述


python flightradar客户端

Build StatusCoverage Status

此库提供对本地Flightradar24源的方便访问。

安装

pip install flightradar-client

用法

这个库目前支持两种不同风格的飞行数据, 由fr24feeddump1090-mutability服务提供 在构建自己的系统时自动安装 Pi24 ADS-B receiver

对于每种口味,图书馆提供两种访问模式。*Feed类 调用update时获取一次数据并将其转换为FeedEntry。 物体。*FeedAggregator类保留了一点历史,并且 随后的update调用它试图填补任何空白(坐标和callsign 目前)在最新获取的数据集中丢失。

飞行雷达馈送

flightradar feed模式使用由fr24feed提供的json数据。 服务(通常在http://localhost:8754/flights.json下)。

FlightradarFlightsFeedFlightradarFlightsFeedAggregator支持 相同的参数:

NameTypeDescription
^{}required, tuple of latitude and longitudeUsed to calculate the distance to each aircraft.
^{}optional, float value in kilometres, default: don't filter by distanceOnly 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 portDefine 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下)。

Dump1090AircraftsFeedDump1090AircraftsFeedAggregator支持 相同的参数:

NameTypeDescription
^{}required, tuple of latitude and longitudeUsed to calculate the distance to each aircraft.
^{}optional, float value in kilometres, default: don't filter by distanceOnly 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 portDefine 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())

提要聚合器
importasyncioimportaiohttpfromflightradar_client.dump1090_aircraftsimportDump1090AircraftsFeedAggregatorsession=aiohttp.ClientSession()# Home Coordinates: Latitude: -33.5, Longitude: 151.5feed_aggregator=Dump1090AircraftsFeedAggregator((-33.5,151.5),session)LOOP=asyncio.get_event_loop()status,entries=LOOP.run_until_complete(feed_aggregator.update())

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在使用文件删除文件时的异常行为。删除()   具有非版本化多通关系的java乐观锁版本化实体   Java:对元素进行排序   java为数组中的对象赋值   java获取特定的键及其值   java如何从Oracle获取时区ID而不是时区偏移量   git共享后java Eclipse maven EAR项目不工作   java将包含“”的JSONObject转换为带有JSON的普通字符串   java如何在javafx中基于时间更改场景   java在Apache的httpclient上向HttpPost添加参数   我应该使用哪个Java类来表示Git SSH URL?   java如何才能不序列化继承的非瞬态字段?   线程“JavaFX应用程序线程”java中出现异常。lang.NoClassDefFoundError:javafx/scene/control/ButtonBar   特定表的java jooQ代码生成   具有排序键的Java树映射与HashMap的性能   java内部类不应实现可序列化   返回值时不触发java ValueChangeEvent   在java中,如何在一个单词的中间添加字符?   SparkContext、JavaSparkContext、SQLContext和SparkSession之间的java差异?