Services
See the library quickstart to learn more.
fr24
¤
Classes:
Name | Description |
---|---|
FR24 |
|
FR24
¤
FR24(client: AsyncClient | None = None)
See docs quickstart.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
AsyncClient | None
|
The |
None
|
Methods:
Name | Description |
---|---|
login |
:param creds: Reads credentials from the environment variables or the |
Attributes:
Name | Type | Description |
---|---|---|
http |
The HTTP client for use in requests |
|
flight_list |
Flight list service. |
|
playback |
Playback service. |
|
live_feed |
Live feed service. |
|
live_feed_playback |
Live feed playback service. |
|
airport_list |
Airport list service. |
|
find |
Find service. |
|
nearest_flights |
Nearest flights service. |
|
live_flights_status |
Live flights status service. |
|
follow_flight |
Follow flight service. |
|
top_flights |
Top flights service. |
|
flight_details |
Flight details service. |
|
playback_flight |
Playback flight service. |
http
instance-attribute
¤
http = HTTPClient(
AsyncClient(http2=True) if client is None else client
)
The HTTP client for use in requests
live_feed_playback
instance-attribute
¤
live_feed_playback = build_live_feed_playback()
Live feed playback service.
nearest_flights
instance-attribute
¤
nearest_flights = build_nearest_flights()
Nearest flights service.
live_flights_status
instance-attribute
¤
live_flights_status = build_live_flights_status()
Live flights status service.
playback_flight
instance-attribute
¤
playback_flight = build_playback_flight()
Playback flight service.
login
async
¤
login(
creds: TokenSubscriptionKey
| UsernamePassword
| None
| Literal["from_env"] = "from_env",
) -> None
Parameters:
Name | Type | Description | Default |
---|---|---|---|
creds
|
TokenSubscriptionKey | UsernamePassword | None | Literal['from_env']
|
Reads credentials from the environment variables or the config file if |
'from_env'
|
service
¤
Classes:
Attributes:
Name | Type | Description |
---|---|---|
RequestT |
Arguments for the request |
|
WriteLocation |
TypeAlias
|
|
WriteLocation
module-attribute
¤
ServiceFactory
dataclass
¤
ServiceFactory(http: HTTPClient)
Methods:
Attributes:
Name | Type | Description |
---|---|---|
http |
HTTPClient
|
|
SupportsFetch
¤
APIResult
dataclass
¤
APIResult(request: RequestT, response: Response)
SupportsWriteTable
¤
FlightListService
dataclass
¤
FlightListService(__factory: ServiceFactory)
Bases: SupportsFetch[FlightListParams]
Flight list service.
Classes:
Name | Description |
---|---|
FetchAllArgs |
Arguments for fetching all pages of the flight list. |
Methods:
Name | Description |
---|---|
fetch |
Fetch the flight list. |
fetch_all |
Fetch all pages of the flight list. |
new_result_collection |
Create an empty list of flight list API results. |
FetchAllArgs
dataclass
¤
FetchAllArgs(
reg: str | None = None,
flight: str | None = None,
page: int = 1,
limit: int = 10,
timestamp: IntoTimestamp
| Literal["now"]
| None = "now",
delay: int = 5,
)
Bases: FlightListParams
Arguments for fetching all pages of the flight list.
Methods:
Name | Description |
---|---|
__post_init__ |
|
Attributes:
Name | Type | Description |
---|---|---|
delay |
int
|
|
reg |
str | None
|
Aircraft registration (e.g. |
flight |
str | None
|
Flight number (e.g. |
page |
int
|
Page number |
limit |
int
|
Number of results per page - use |
timestamp |
IntoTimestamp | Literal['now'] | None
|
Show flights with ATD before this Unix timestamp |
kind |
Literal['reg', 'flight']
|
|
ident |
str
|
|
limit
class-attribute
instance-attribute
¤
limit: int = 10
Number of results per page - use 100
if authenticated.
timestamp
class-attribute
instance-attribute
¤
timestamp: IntoTimestamp | Literal['now'] | None = 'now'
Show flights with ATD before this Unix timestamp
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> FlightListResult
Fetch the flight list. See fr24.json.FlightListParams for the detailed signature.
fetch_all
async
¤
fetch_all(
*args: Any, **kwargs: Any
) -> AsyncIterator[FlightListResult]
Fetch all pages of the flight list.
See fr24.service.FlightListService.FetchAllArgs for the detailed signature.
new_result_collection
¤
new_result_collection() -> FlightListResultCollection
Create an empty list of flight list API results.
Methods to_dict
and to_polars
can be used collect all unique rows in
each flight list.
FlightListResult
dataclass
¤
FlightListResult(request: RequestT, response: Response)
Bases: APIResult[FlightListParams]
, SupportsToDict[FlightList]
, SupportsToPolars
, SupportsWriteTable
A single result from the flight list API.
Methods:
Name | Description |
---|---|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|
FlightListResultCollection
¤
Bases: list[FlightListResult]
, SupportsToDict[FlightList]
, SupportsToPolars
, SupportsWriteTable
A list of results from the flight list API.
Methods:
Name | Description |
---|---|
to_dict |
Collects the raw bytes in each response into a single result. |
to_polars |
|
write_table |
|
to_dict
¤
to_dict() -> FlightList
Collects the raw bytes in each response into a single result. Duplicates are identified by their (flight id, time of departure), and are removed.
No checking is made for the homogenity of the request parameters.
PlaybackService
dataclass
¤
PlaybackService(__factory: ServiceFactory)
Bases: SupportsFetch[PlaybackParams]
Playback service.
Methods:
Name | Description |
---|---|
fetch |
See fr24.json.PlaybackParams for the detailed signature. |
metadata |
|
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> PlaybackResult
See fr24.json.PlaybackParams for the detailed signature.
PlaybackResult
dataclass
¤
PlaybackResult(request: RequestT, response: Response)
Bases: APIResult[PlaybackParams]
, SupportsToDict[Playback]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|
LiveFeedService
dataclass
¤
LiveFeedService(__factory: ServiceFactory)
Bases: SupportsFetch[LiveFeedParams]
Live feed service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the live feed. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> LiveFeedResult
Fetch the live feed. See fr24.grpc.LiveFeedParams for the detailed signature.
LiveFeedResult
dataclass
¤
Bases: APIResult[LiveFeedParams]
, SupportsToProto[LiveFeedResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
int
|
|
request |
RequestT
|
|
response |
Response
|
|
LiveFeedPlaybackService
dataclass
¤
LiveFeedPlaybackService(__factory: ServiceFactory)
Bases: SupportsFetch[LiveFeedPlaybackParams]
Live feed service.
Methods:
Name | Description |
---|---|
fetch |
Fetch a playback of the live feed. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> LiveFeedPlaybackResult
Fetch a playback of the live feed. See fr24.grpc.LiveFeedPlaybackParams for the detailed signature.
LiveFeedPlaybackResult
dataclass
¤
LiveFeedPlaybackResult(
request: RequestT, response: Response
)
Bases: APIResult[LiveFeedPlaybackParams]
, SupportsToProto[PlaybackResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|
AirportListService
dataclass
¤
AirportListService(__factory: ServiceFactory)
Bases: SupportsFetch[AirportListParams]
Airport list service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the airport list. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> AirportListResult
Fetch the airport list. See fr24.json.AirportListParams for the detailed signature.
AirportListResult
dataclass
¤
AirportListResult(request: RequestT, response: Response)
Bases: APIResult[AirportListParams]
, SupportsToDict[AirportList]
Methods:
Name | Description |
---|---|
to_dict |
Parse the response into a dictionary. |
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|
FindService
dataclass
¤
FindService(__factory: ServiceFactory)
Bases: SupportsFetch[FindParams]
Find service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the find results. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> FindResult
Fetch the find results. See fr24.json.FindParams for the detailed signature.
FindResult
dataclass
¤
FindResult(request: RequestT, response: Response)
Bases: APIResult[FindParams]
, SupportsToDict[Find]
A single result from the find API.
Methods:
Name | Description |
---|---|
to_dict |
Parse the response into a dictionary. |
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|
NearestFlightsService
dataclass
¤
NearestFlightsService(__factory: ServiceFactory)
Bases: SupportsFetch[NearestFlightsParams]
Nearest flights service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the nearest flights. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> NearestFlightsResult
Fetch the nearest flights. See fr24.grpc.NearestFlightsParams for the detailed signature.
NearestFlightsResult
dataclass
¤
Bases: APIResult[NearestFlightsParams]
, SupportsToProto[NearestFlightsResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
int
|
|
request |
RequestT
|
|
response |
Response
|
|
LiveFlightsStatusService
dataclass
¤
LiveFlightsStatusService(__factory: ServiceFactory)
Bases: SupportsFetch[LiveFlightsStatusParams]
Live flights status service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the live flights status. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> LiveFlightsStatusResult
Fetch the live flights status. See fr24.grpc.LiveFlightsStatusParams for the detailed signature.
LiveFlightsStatusResult
dataclass
¤
Bases: APIResult[LiveFlightsStatusParams]
, SupportsToProto[LiveFlightsStatusResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
int
|
|
request |
RequestT
|
|
response |
Response
|
|
FollowFlightService
dataclass
¤
FollowFlightService(__factory: ServiceFactory)
Follow flight service for real-time streaming.
Methods:
Name | Description |
---|---|
stream |
Stream real-time updates for a flight. |
stream
async
¤
stream(
*args: Any, **kwargs: Any
) -> AsyncGenerator[FollowFlightResult, None]
Stream real-time updates for a flight. See fr24.grpc.FollowFlightParams for the detailed signature.
FollowFlightResult
dataclass
¤
FollowFlightResult(
request: FollowFlightParams, response: bytes
)
Bases: SupportsToProto[FollowFlightResponse]
, SupportsToDict[dict[str, Any]]
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
Attributes:
Name | Type | Description |
---|---|---|
request |
FollowFlightParams
|
|
response |
bytes
|
|
TopFlightsService
dataclass
¤
TopFlightsService(__factory: ServiceFactory)
Bases: SupportsFetch[TopFlightsParams]
Top flights service.
Methods:
Name | Description |
---|---|
fetch |
Fetch the top flights. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> TopFlightsResult
Fetch the top flights. See fr24.grpc.TopFlightsParams for the detailed signature.
TopFlightsResult
dataclass
¤
Bases: APIResult[TopFlightsParams]
, SupportsToProto[TopFlightsResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
int
|
|
request |
RequestT
|
|
response |
Response
|
|
FlightDetailsService
dataclass
¤
FlightDetailsService(__factory: ServiceFactory)
Bases: SupportsFetch[FlightDetailsParams]
Flight details service.
Methods:
Name | Description |
---|---|
fetch |
Fetch flight details. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> FlightDetailsResult
Fetch flight details. See fr24.grpc.FlightDetailsParams for the detailed signature.
FlightDetailsResult
dataclass
¤
Bases: APIResult[FlightDetailsParams]
, SupportsToProto[FlightDetailsResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
timestamp |
int
|
|
request |
RequestT
|
|
response |
Response
|
|
PlaybackFlightService
dataclass
¤
PlaybackFlightService(__factory: ServiceFactory)
Bases: SupportsFetch[PlaybackFlightParams]
Playback flight service.
Methods:
Name | Description |
---|---|
fetch |
Fetch playback flight details. |
fetch
async
¤
fetch(*args: Any, **kwargs: Any) -> PlaybackFlightResult
Fetch playback flight details. See fr24.grpc.PlaybackFlightParams for the detailed signature.
PlaybackFlightResult
dataclass
¤
PlaybackFlightResult(request: RequestT, response: Response)
Bases: APIResult[PlaybackFlightParams]
, SupportsToProto[PlaybackFlightResponse]
, SupportsToDict[dict[str, Any]]
, SupportsToPolars
, SupportsWriteTable
Methods:
Name | Description |
---|---|
to_proto |
|
to_dict |
|
to_polars |
|
write_table |
|
Attributes:
Name | Type | Description |
---|---|---|
request |
RequestT
|
|
response |
Response
|
|